All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards
@ 2022-09-15 14:20 Stefan Roese
  2022-09-15 14:20 ` [PATCH v3 1/8] timer: orion-timer: Use timer_conv_64() to fix timer wrap around Stefan Roese
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Stefan Roese @ 2022-09-15 14:20 UTC (permalink / raw)
  To: u-boot; +Cc: pali, mibodhi, michael

This patchset enhaces the recently added Orion Timer driver to support
all other Kirkwood & 32bit MVEBU Armada platforms. Additionally, this
timer support is then enabled per default for those platforms, so that
the board config files don't need to be changed. Also necessary is
some dts hacking, so that the timer DT node is available in early
U-Boot stages.

I've successfully tested this patchset on an Armada XP board. Additional
test on other boards and platforms are very welcome and necessary.

Thanks,
Stefan

Stefan Roese (8):
  timer: orion-timer: Use timer_conv_64() to fix timer wrap around
  timer: orion-timer: Add support for other Armada SoC's
  timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support
  arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms
  arm: mvebu: dts: Makefile: Compile Armada 375 dtb in a separate step
  arm: mvebu: dts: armada-375.dtsi: Add timer0 & timer1
  arm: mvebu: dts: mvebu-u-boot.dtsi: Add "u-boot,dm-pre-reloc" to timer
    DT node
  kirkwood: lsxl: Sync defconfigs

 arch/arm/Kconfig                          |   4 +
 arch/arm/dts/Makefile                     |   6 +-
 arch/arm/dts/armada-375.dtsi              |   4 +-
 arch/arm/dts/mvebu-u-boot.dtsi            |  11 +++
 arch/arm/mach-mvebu/include/mach/config.h |   5 --
 configs/lschlv2_defconfig                 |   2 -
 configs/lsxhl_defconfig                   |   2 -
 drivers/timer/Kconfig                     |   5 +-
 drivers/timer/orion-timer.c               | 103 +++++++++++++++++++---
 9 files changed, 118 insertions(+), 24 deletions(-)

-- 
2.37.3


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH v3 1/8] timer: orion-timer: Use timer_conv_64() to fix timer wrap around
  2022-09-15 14:20 [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Stefan Roese
@ 2022-09-15 14:20 ` Stefan Roese
  2022-09-18 10:49   ` Stefan Roese
  2022-09-15 14:20 ` [PATCH v3 2/8] timer: orion-timer: Add support for other Armada SoC's Stefan Roese
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Stefan Roese @ 2022-09-15 14:20 UTC (permalink / raw)
  To: u-boot; +Cc: pali, mibodhi, michael, Stefan Herbrechtsmeier

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 <stefan.herbrechtsmeier-oss@weidmueller.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
---
v3:
- Add Fixes tag

v2:
- New patch

 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 fd30e1bf036c..d7d1a1b24462 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)
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 2/8] timer: orion-timer: Add support for other Armada SoC's
  2022-09-15 14:20 [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Stefan Roese
  2022-09-15 14:20 ` [PATCH v3 1/8] timer: orion-timer: Use timer_conv_64() to fix timer wrap around Stefan Roese
@ 2022-09-15 14:20 ` Stefan Roese
  2022-09-15 14:20 ` [PATCH v3 3/8] timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support Stefan Roese
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Stefan Roese @ 2022-09-15 14:20 UTC (permalink / raw)
  To: u-boot; +Cc: pali, mibodhi, michael

This patch adds support for other Marvell Armada SoC's, supporting the
25MHz fixed clock operation, like the Armada XP etc.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
---
v3:
- No change

v2:
- Use timer_conv_64() in timer_early_get_count()

 drivers/timer/Kconfig       |  5 ++++-
 drivers/timer/orion-timer.c | 42 ++++++++++++++++++++++++++++++++++---
 2 files changed, 43 insertions(+), 4 deletions(-)

diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig
index 404929014810..b0814acca3fb 100644
--- a/drivers/timer/Kconfig
+++ b/drivers/timer/Kconfig
@@ -197,8 +197,11 @@ config OMAP_TIMER
 config ORION_TIMER
 	bool "Orion timer support"
 	depends on TIMER
+	default y if ARCH_KIRKWOOD || (ARCH_MVEBU && ARMADA_32BIT)
+	select TIMER_EARLY if ARCH_MVEBU
 	help
-	  Select this to enable an timer for Orion devices.
+	  Select this to enable an timer for Orion and Armada devices
+	  like Armada XP etc.
 
 config RISCV_TIMER
 	bool "RISC-V timer support"
diff --git a/drivers/timer/orion-timer.c b/drivers/timer/orion-timer.c
index d7d1a1b24462..14f318e57d4d 100644
--- a/drivers/timer/orion-timer.c
+++ b/drivers/timer/orion-timer.c
@@ -11,10 +11,34 @@
 #define TIMER0_RELOAD		0x10
 #define TIMER0_VAL		0x14
 
+enum input_clock_type {
+	INPUT_CLOCK_NON_FIXED,
+	INPUT_CLOCK_25MHZ,	/* input clock rate is fixed to 25MHz */
+};
+
 struct orion_timer_priv {
 	void *base;
 };
 
+#define MVEBU_TIMER_FIXED_RATE_25MHZ	25000000
+
+/**
+ * timer_early_get_rate() - Get the timer rate before driver model
+ */
+unsigned long notrace timer_early_get_rate(void)
+{
+	return MVEBU_TIMER_FIXED_RATE_25MHZ;
+}
+
+/**
+ * timer_early_get_count() - Get the timer count before driver model
+ *
+ */
+u64 notrace timer_early_get_count(void)
+{
+	return timer_conv_64(~readl(MVEBU_TIMER_BASE + TIMER0_VAL));
+}
+
 static uint64_t orion_timer_get_count(struct udevice *dev)
 {
 	struct orion_timer_priv *priv = dev_get_priv(dev);
@@ -25,6 +49,7 @@ static uint64_t orion_timer_get_count(struct udevice *dev)
 static int orion_timer_probe(struct udevice *dev)
 {
 	struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev);
+	enum input_clock_type type = dev_get_driver_data(dev);
 	struct orion_timer_priv *priv = dev_get_priv(dev);
 
 	priv->base = devfdt_remap_addr_index(dev, 0);
@@ -33,11 +58,20 @@ static int orion_timer_probe(struct udevice *dev)
 		return -ENOMEM;
 	}
 
-	uc_priv->clock_rate = CONFIG_SYS_TCLK;
-
 	writel(~0, priv->base + TIMER0_VAL);
 	writel(~0, priv->base + TIMER0_RELOAD);
 
+	if (type == INPUT_CLOCK_25MHZ) {
+		/*
+		 * On Armada XP / 38x ..., the 25MHz clock source needs to
+		 * be enabled
+		 */
+		setbits_le32(priv->base + TIMER_CTRL, BIT(11));
+		uc_priv->clock_rate = MVEBU_TIMER_FIXED_RATE_25MHZ;
+	} else {
+		uc_priv->clock_rate = CONFIG_SYS_TCLK;
+	}
+
 	/* enable timer */
 	setbits_le32(priv->base + TIMER_CTRL, TIMER0_EN | TIMER0_RELOAD_EN);
 
@@ -49,7 +83,9 @@ static const struct timer_ops orion_timer_ops = {
 };
 
 static const struct udevice_id orion_timer_ids[] = {
-	{ .compatible = "marvell,orion-timer" },
+	{ .compatible = "marvell,orion-timer", .data = INPUT_CLOCK_NON_FIXED },
+	{ .compatible = "marvell,armada-370-timer", .data = INPUT_CLOCK_25MHZ },
+	{ .compatible = "marvell,armada-xp-timer", .data = INPUT_CLOCK_25MHZ },
 	{}
 };
 
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 3/8] timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support
  2022-09-15 14:20 [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Stefan Roese
  2022-09-15 14:20 ` [PATCH v3 1/8] timer: orion-timer: Use timer_conv_64() to fix timer wrap around Stefan Roese
  2022-09-15 14:20 ` [PATCH v3 2/8] timer: orion-timer: Add support for other Armada SoC's Stefan Roese
@ 2022-09-15 14:20 ` Stefan Roese
  2022-09-15 14:20 ` [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms Stefan Roese
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Stefan Roese @ 2022-09-15 14:20 UTC (permalink / raw)
  To: u-boot; +Cc: pali, mibodhi, michael

Add timer_get_boot_us() to support boards, that have CONFIG_BOOTSTAGE
enabled, like pogo_v4.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
---
v3:
- Also support fixed input clock in early timer code
- Consolidate code for this

v2:
- Change timer_get_boot_us() to use the timer_early functions
- Remove #if CONFIG_IS_ENABLED(BOOTSTAGE)

 drivers/timer/orion-timer.c | 83 ++++++++++++++++++++++++++++---------
 1 file changed, 64 insertions(+), 19 deletions(-)

diff --git a/drivers/timer/orion-timer.c b/drivers/timer/orion-timer.c
index 14f318e57d4d..cd63ea916237 100644
--- a/drivers/timer/orion-timer.c
+++ b/drivers/timer/orion-timer.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 #include <asm/io.h>
 #include <common.h>
+#include <div64.h>
 #include <dm/device.h>
 #include <dm/fdtaddr.h>
 #include <timer.h>
@@ -22,12 +23,56 @@ struct orion_timer_priv {
 
 #define MVEBU_TIMER_FIXED_RATE_25MHZ	25000000
 
+static bool early_init_done __section(".data") = false;
+
+/* Common functions for early (boot) and DM based timer */
+static void orion_timer_init(void *base, enum input_clock_type type)
+{
+	writel(~0, base + TIMER0_VAL);
+	writel(~0, base + TIMER0_RELOAD);
+
+	if (type == INPUT_CLOCK_25MHZ) {
+		/*
+		 * On Armada XP / 38x ..., the 25MHz clock source needs to
+		 * be enabled
+		 */
+		setbits_le32(base + TIMER_CTRL, BIT(11));
+	}
+
+	/* enable timer */
+	setbits_le32(base + TIMER_CTRL, TIMER0_EN | TIMER0_RELOAD_EN);
+}
+
+static uint64_t orion_timer_get_count(void *base)
+{
+	return timer_conv_64(~readl(base + TIMER0_VAL));
+}
+
+/* Early (e.g. bootstage etc) timer functions */
+static void notrace timer_early_init(void)
+{
+	/* Only init the timer once */
+	if (early_init_done)
+		return;
+	early_init_done = true;
+
+	if (IS_ENABLED(CONFIG_ARCH_MVEBU))
+		orion_timer_init((void *)MVEBU_TIMER_BASE, INPUT_CLOCK_25MHZ);
+	else
+		orion_timer_init((void *)MVEBU_TIMER_BASE, INPUT_CLOCK_NON_FIXED);
+}
+
 /**
  * timer_early_get_rate() - Get the timer rate before driver model
  */
 unsigned long notrace timer_early_get_rate(void)
 {
-	return MVEBU_TIMER_FIXED_RATE_25MHZ;
+	timer_early_init();
+
+	if (IS_ENABLED(CONFIG_ARCH_MVEBU))
+		return MVEBU_TIMER_FIXED_RATE_25MHZ;
+	else
+		return CONFIG_SYS_TCLK;
 }
 
 /**
@@ -36,14 +81,25 @@ unsigned long notrace timer_early_get_rate(void)
  */
 u64 notrace timer_early_get_count(void)
 {
-	return timer_conv_64(~readl(MVEBU_TIMER_BASE + TIMER0_VAL));
+	timer_early_init();
+
+	return orion_timer_get_count((void *)MVEBU_TIMER_BASE);
 }
 
-static uint64_t orion_timer_get_count(struct udevice *dev)
+ulong timer_get_boot_us(void)
+{
+	u64 ticks;
+
+	ticks = timer_early_get_count();
+	return lldiv(ticks * 1000, timer_early_get_rate());
+}
+
+/* DM timer functions */
+static uint64_t dm_orion_timer_get_count(struct udevice *dev)
 {
 	struct orion_timer_priv *priv = dev_get_priv(dev);
 
-	return timer_conv_64(~readl(priv->base + TIMER0_VAL));
+	return orion_timer_get_count(priv->base);
 }
 
 static int orion_timer_probe(struct udevice *dev)
@@ -58,28 +114,17 @@ static int orion_timer_probe(struct udevice *dev)
 		return -ENOMEM;
 	}
 
-	writel(~0, priv->base + TIMER0_VAL);
-	writel(~0, priv->base + TIMER0_RELOAD);
-
-	if (type == INPUT_CLOCK_25MHZ) {
-		/*
-		 * On Armada XP / 38x ..., the 25MHz clock source needs to
-		 * be enabled
-		 */
-		setbits_le32(priv->base + TIMER_CTRL, BIT(11));
+	if (type == INPUT_CLOCK_25MHZ)
 		uc_priv->clock_rate = MVEBU_TIMER_FIXED_RATE_25MHZ;
-	} else {
+	else
 		uc_priv->clock_rate = CONFIG_SYS_TCLK;
-	}
-
-	/* enable timer */
-	setbits_le32(priv->base + TIMER_CTRL, TIMER0_EN | TIMER0_RELOAD_EN);
+	orion_timer_init(priv->base, type);
 
 	return 0;
 }
 
 static const struct timer_ops orion_timer_ops = {
-	.get_count = orion_timer_get_count,
+	.get_count = dm_orion_timer_get_count,
 };
 
 static const struct udevice_id orion_timer_ids[] = {
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms
  2022-09-15 14:20 [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Stefan Roese
                   ` (2 preceding siblings ...)
  2022-09-15 14:20 ` [PATCH v3 3/8] timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support Stefan Roese
@ 2022-09-15 14:20 ` Stefan Roese
  2022-11-05  4:03   ` Chris Packham
  2022-09-15 14:20 ` [PATCH v3 5/8] arm: mvebu: dts: Makefile: Compile Armada 375 dtb in a separate step Stefan Roese
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 21+ messages in thread
From: Stefan Roese @ 2022-09-15 14:20 UTC (permalink / raw)
  To: u-boot; +Cc: pali, mibodhi, michael

Now that the new timer support is available for these platforms, let's
select this IF for all these platforms. This way it's not necessary
that each board changes it's config header.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
---
v3:
- No change

v2:
- No change

 arch/arm/Kconfig                          | 4 ++++
 arch/arm/mach-mvebu/include/mach/config.h | 5 -----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 82cd456f51f1..4ed100ab0ede 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -618,6 +618,7 @@ config ARCH_KIRKWOOD
 	select BOARD_EARLY_INIT_F
 	select CPU_ARM926EJS
 	select GPIO_EXTRA_HEADER
+	select TIMER
 
 config ARCH_MVEBU
 	bool "Marvell MVEBU family (Armada XP/375/38x/3700/7K/8K)"
@@ -629,6 +630,8 @@ config ARCH_MVEBU
 	select GPIO_EXTRA_HEADER
 	select SPL_DM_SPI if SPL
 	select SPL_DM_SPI_FLASH if SPL
+	select SPL_TIMER if SPL
+	select TIMER
 	select OF_CONTROL
 	select OF_SEPARATE
 	select SPI
@@ -639,6 +642,7 @@ config ARCH_ORION5X
 	select CPU_ARM926EJS
 	select GPIO_EXTRA_HEADER
 	select SPL_SEPARATE_BSS if SPL
+	select TIMER
 
 config TARGET_STV0991
 	bool "Support stv0991"
diff --git a/arch/arm/mach-mvebu/include/mach/config.h b/arch/arm/mach-mvebu/include/mach/config.h
index 4add0d9e1030..9b5036c31dd3 100644
--- a/arch/arm/mach-mvebu/include/mach/config.h
+++ b/arch/arm/mach-mvebu/include/mach/config.h
@@ -41,9 +41,4 @@
 #endif
 #endif
 
-/* Use common timer */
-#define CONFIG_SYS_TIMER_COUNTS_DOWN
-#define CONFIG_SYS_TIMER_COUNTER	(MVEBU_TIMER_BASE + 0x14)
-#define CONFIG_SYS_TIMER_RATE		25000000
-
 #endif /* __MVEBU_CONFIG_H */
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 5/8] arm: mvebu: dts: Makefile: Compile Armada 375 dtb in a separate step
  2022-09-15 14:20 [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Stefan Roese
                   ` (3 preceding siblings ...)
  2022-09-15 14:20 ` [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms Stefan Roese
@ 2022-09-15 14:20 ` Stefan Roese
  2022-09-15 14:20 ` [PATCH v3 6/8] arm: mvebu: dts: armada-375.dtsi: Add timer0 & timer1 Stefan Roese
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Stefan Roese @ 2022-09-15 14:20 UTC (permalink / raw)
  To: u-boot; +Cc: pali, mibodhi, michael

This patch changes the compilation, so that the Armada 375 board(s) are
compiled in a separate step. This is necessary for the timer dts
conversion, as A375 has a different / timer description in the dts.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
---
v3:
- No change

v2:
- No change

 arch/arm/dts/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 7330121dbaba..03e79e14681f 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -233,8 +233,11 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
 	tegra210-p3450-0000.dtb
 
 ifdef CONFIG_ARMADA_32BIT
+ifdef CONFIG_ARMADA_375
+dtb-$(CONFIG_ARCH_MVEBU) +=			\
+	armada-375-db.dtb
+else
 dtb-$(CONFIG_ARCH_MVEBU) +=			\
-	armada-375-db.dtb			\
 	armada-385-atl-x530.dtb			\
 	armada-385-atl-x530DP.dtb		\
 	armada-385-db-88f6820-amc.dtb		\
@@ -254,6 +257,7 @@ dtb-$(CONFIG_ARCH_MVEBU) +=			\
 	armada-xp-maxbcm.dtb			\
 	armada-xp-synology-ds414.dtb		\
 	armada-xp-theadorable.dtb
+endif
 else
 dtb-$(CONFIG_ARCH_MVEBU) +=			\
 	armada-3720-db.dtb			\
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 6/8] arm: mvebu: dts: armada-375.dtsi: Add timer0 & timer1
  2022-09-15 14:20 [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Stefan Roese
                   ` (4 preceding siblings ...)
  2022-09-15 14:20 ` [PATCH v3 5/8] arm: mvebu: dts: Makefile: Compile Armada 375 dtb in a separate step Stefan Roese
@ 2022-09-15 14:20 ` Stefan Roese
  2022-09-15 14:20 ` [PATCH v3 7/8] arm: mvebu: dts: mvebu-u-boot.dtsi: Add "u-boot, dm-pre-reloc" to timer DT node Stefan Roese
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Stefan Roese @ 2022-09-15 14:20 UTC (permalink / raw)
  To: u-boot; +Cc: pali, mibodhi, michael

Add the DT bindings / descriptions for timer0 & timer1, exactly as done
in mainline Linux.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
---
v3:
- No change

v2:
- No change

 arch/arm/dts/armada-375.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/armada-375.dtsi b/arch/arm/dts/armada-375.dtsi
index 20a8c352b2f1..a044b3fc994f 100644
--- a/arch/arm/dts/armada-375.dtsi
+++ b/arch/arm/dts/armada-375.dtsi
@@ -187,7 +187,7 @@
 				reg = <0xc000 0x58>;
 			};
 
-			timer@c600 {
+			timer0: timer@c600 {
 				compatible = "arm,cortex-a9-twd-timer";
 				reg = <0xc600 0x20>;
 				interrupts = <GIC_PPI 13 (IRQ_TYPE_EDGE_RISING | GIC_CPU_MASK_SIMPLE(2))>;
@@ -416,7 +416,7 @@
 				interrupts = <GIC_PPI 15 IRQ_TYPE_LEVEL_HIGH>;
 			};
 
-			timer@20300 {
+			timer1: timer@20300 {
 				compatible = "marvell,armada-375-timer", "marvell,armada-370-timer";
 				reg = <0x20300 0x30>, <0x21040 0x30>;
 				interrupts-extended = <&gic  GIC_SPI  8 IRQ_TYPE_LEVEL_HIGH>,
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 7/8] arm: mvebu: dts: mvebu-u-boot.dtsi: Add "u-boot, dm-pre-reloc" to timer DT node
  2022-09-15 14:20 [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Stefan Roese
                   ` (5 preceding siblings ...)
  2022-09-15 14:20 ` [PATCH v3 6/8] arm: mvebu: dts: armada-375.dtsi: Add timer0 & timer1 Stefan Roese
@ 2022-09-15 14:20 ` Stefan Roese
  2022-09-15 14:20 ` [PATCH v3 8/8] kirkwood: lsxl: Sync defconfigs Stefan Roese
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Stefan Roese @ 2022-09-15 14:20 UTC (permalink / raw)
  To: u-boot; +Cc: pali, mibodhi, michael

Adding the "u-boot,dm-pre-reloc" DT property to the timer node is
necesssary to support the timer in the early boot phases (e.g.
SPL & pre-reloc).

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
---
v3:
- No change

v2:
- No change

 arch/arm/dts/mvebu-u-boot.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/dts/mvebu-u-boot.dtsi b/arch/arm/dts/mvebu-u-boot.dtsi
index 5538f95148de..db4bf39920b1 100644
--- a/arch/arm/dts/mvebu-u-boot.dtsi
+++ b/arch/arm/dts/mvebu-u-boot.dtsi
@@ -15,6 +15,17 @@
 	u-boot,dm-pre-reloc;
 };
 
+#ifdef CONFIG_ARMADA_375
+/* Armada 375 has multiple timers, use timer1 here */
+&timer1 {
+	u-boot,dm-pre-reloc;
+};
+#else
+&timer {
+	u-boot,dm-pre-reloc;
+};
+#endif
+
 #ifdef CONFIG_SPL_SPI
 &spi0 {
 	u-boot,dm-pre-reloc;
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 8/8] kirkwood: lsxl: Sync defconfigs
  2022-09-15 14:20 [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Stefan Roese
                   ` (6 preceding siblings ...)
  2022-09-15 14:20 ` [PATCH v3 7/8] arm: mvebu: dts: mvebu-u-boot.dtsi: Add "u-boot, dm-pre-reloc" to timer DT node Stefan Roese
@ 2022-09-15 14:20 ` Stefan Roese
  2022-09-15 15:53 ` [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Pali Rohár
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Stefan Roese @ 2022-09-15 14:20 UTC (permalink / raw)
  To: u-boot; +Cc: pali, mibodhi, michael

With the recent changes in the Orion timer driver Kconfig setup, the
board specific enabling is not needed any more. This patch sync's these
2 boards with their current defconfig version.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Michael Walle <michael@walle.cc>
Tested-by: Tony Dinh <mibodhi@gmail.com>
---
v3:
- New patch

v2:
- New patch

 configs/lschlv2_defconfig | 2 --
 configs/lsxhl_defconfig   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/configs/lschlv2_defconfig b/configs/lschlv2_defconfig
index cfccfdcfc407..441cd8ef24ff 100644
--- a/configs/lschlv2_defconfig
+++ b/configs/lschlv2_defconfig
@@ -70,7 +70,5 @@ CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_KIRKWOOD_SPI=y
-CONFIG_TIMER=y
-CONFIG_ORION_TIMER=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
diff --git a/configs/lsxhl_defconfig b/configs/lsxhl_defconfig
index 1945b72450c2..f350f8ff427a 100644
--- a/configs/lsxhl_defconfig
+++ b/configs/lsxhl_defconfig
@@ -71,7 +71,5 @@ CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_KIRKWOOD_SPI=y
-CONFIG_TIMER=y
-CONFIG_ORION_TIMER=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards
  2022-09-15 14:20 [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Stefan Roese
                   ` (7 preceding siblings ...)
  2022-09-15 14:20 ` [PATCH v3 8/8] kirkwood: lsxl: Sync defconfigs Stefan Roese
@ 2022-09-15 15:53 ` Pali Rohár
  2022-09-20  6:59 ` Stefan Roese
  2022-10-06 10:44 ` Stefan Roese
  10 siblings, 0 replies; 21+ messages in thread
From: Pali Rohár @ 2022-09-15 15:53 UTC (permalink / raw)
  To: Stefan Roese; +Cc: u-boot, mibodhi, michael

Hello! Now I have tested this patch series on Turris Omnia - A385,
loaded via UART kwboot and seems that everything is working fine.

On Thursday 15 September 2022 16:20:35 Stefan Roese wrote:
> This patchset enhaces the recently added Orion Timer driver to support
> all other Kirkwood & 32bit MVEBU Armada platforms. Additionally, this
> timer support is then enabled per default for those platforms, so that
> the board config files don't need to be changed. Also necessary is
> some dts hacking, so that the timer DT node is available in early
> U-Boot stages.
> 
> I've successfully tested this patchset on an Armada XP board. Additional
> test on other boards and platforms are very welcome and necessary.
> 
> Thanks,
> Stefan
> 
> Stefan Roese (8):
>   timer: orion-timer: Use timer_conv_64() to fix timer wrap around
>   timer: orion-timer: Add support for other Armada SoC's
>   timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support
>   arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms
>   arm: mvebu: dts: Makefile: Compile Armada 375 dtb in a separate step
>   arm: mvebu: dts: armada-375.dtsi: Add timer0 & timer1
>   arm: mvebu: dts: mvebu-u-boot.dtsi: Add "u-boot,dm-pre-reloc" to timer
>     DT node
>   kirkwood: lsxl: Sync defconfigs
> 
>  arch/arm/Kconfig                          |   4 +
>  arch/arm/dts/Makefile                     |   6 +-
>  arch/arm/dts/armada-375.dtsi              |   4 +-
>  arch/arm/dts/mvebu-u-boot.dtsi            |  11 +++
>  arch/arm/mach-mvebu/include/mach/config.h |   5 --
>  configs/lschlv2_defconfig                 |   2 -
>  configs/lsxhl_defconfig                   |   2 -
>  drivers/timer/Kconfig                     |   5 +-
>  drivers/timer/orion-timer.c               | 103 +++++++++++++++++++---
>  9 files changed, 118 insertions(+), 24 deletions(-)
> 
> -- 
> 2.37.3
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 1/8] timer: orion-timer: Use timer_conv_64() to fix timer wrap around
  2022-09-15 14:20 ` [PATCH v3 1/8] timer: orion-timer: Use timer_conv_64() to fix timer wrap around Stefan Roese
@ 2022-09-18 10:49   ` Stefan Roese
  0 siblings, 0 replies; 21+ messages in thread
From: Stefan Roese @ 2022-09-18 10:49 UTC (permalink / raw)
  To: u-boot; +Cc: pali, mibodhi, michael, Stefan Herbrechtsmeier

On 15.09.22 16:20, Stefan Roese wrote:
> 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 <stefan.herbrechtsmeier-oss@weidmueller.com>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Tested-by: Tony Dinh <mibodhi@gmail.com>

Applied to u-boot-marvell/master

Thanks,
Stefan

> ---
> v3:
> - Add Fixes tag
> 
> v2:
> - New patch
> 
>   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 fd30e1bf036c..d7d1a1b24462 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)

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards
  2022-09-15 14:20 [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Stefan Roese
                   ` (8 preceding siblings ...)
  2022-09-15 15:53 ` [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Pali Rohár
@ 2022-09-20  6:59 ` Stefan Roese
  2022-10-06 10:44 ` Stefan Roese
  10 siblings, 0 replies; 21+ messages in thread
From: Stefan Roese @ 2022-09-20  6:59 UTC (permalink / raw)
  To: u-boot; +Cc: pali, mibodhi, michael

On 15.09.22 16:20, Stefan Roese wrote:
> This patchset enhaces the recently added Orion Timer driver to support
> all other Kirkwood & 32bit MVEBU Armada platforms. Additionally, this
> timer support is then enabled per default for those platforms, so that
> the board config files don't need to be changed. Also necessary is
> some dts hacking, so that the timer DT node is available in early
> U-Boot stages.
> 
> I've successfully tested this patchset on an Armada XP board. Additional
> test on other boards and platforms are very welcome and necessary.
> 
> Thanks,
> Stefan
> 
> Stefan Roese (8):
>    timer: orion-timer: Use timer_conv_64() to fix timer wrap around
>    timer: orion-timer: Add support for other Armada SoC's
>    timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support
>    arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms
>    arm: mvebu: dts: Makefile: Compile Armada 375 dtb in a separate step
>    arm: mvebu: dts: armada-375.dtsi: Add timer0 & timer1
>    arm: mvebu: dts: mvebu-u-boot.dtsi: Add "u-boot,dm-pre-reloc" to timer
>      DT node
>    kirkwood: lsxl: Sync defconfigs
> 
>   arch/arm/Kconfig                          |   4 +
>   arch/arm/dts/Makefile                     |   6 +-
>   arch/arm/dts/armada-375.dtsi              |   4 +-
>   arch/arm/dts/mvebu-u-boot.dtsi            |  11 +++
>   arch/arm/mach-mvebu/include/mach/config.h |   5 --
>   configs/lschlv2_defconfig                 |   2 -
>   configs/lsxhl_defconfig                   |   2 -
>   drivers/timer/Kconfig                     |   5 +-
>   drivers/timer/orion-timer.c               | 103 +++++++++++++++++++---
>   9 files changed, 118 insertions(+), 24 deletions(-)
> 

Applied to u-boot-marvell/next

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards
  2022-09-15 14:20 [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Stefan Roese
                   ` (9 preceding siblings ...)
  2022-09-20  6:59 ` Stefan Roese
@ 2022-10-06 10:44 ` Stefan Roese
  10 siblings, 0 replies; 21+ messages in thread
From: Stefan Roese @ 2022-10-06 10:44 UTC (permalink / raw)
  To: u-boot; +Cc: pali, mibodhi, michael

On 15.09.22 16:20, Stefan Roese wrote:
> This patchset enhaces the recently added Orion Timer driver to support
> all other Kirkwood & 32bit MVEBU Armada platforms. Additionally, this
> timer support is then enabled per default for those platforms, so that
> the board config files don't need to be changed. Also necessary is
> some dts hacking, so that the timer DT node is available in early
> U-Boot stages.
> 
> I've successfully tested this patchset on an Armada XP board. Additional
> test on other boards and platforms are very welcome and necessary.
> 
> Thanks,
> Stefan
> 
> Stefan Roese (8):
>    timer: orion-timer: Use timer_conv_64() to fix timer wrap around
>    timer: orion-timer: Add support for other Armada SoC's
>    timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support
>    arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms
>    arm: mvebu: dts: Makefile: Compile Armada 375 dtb in a separate step
>    arm: mvebu: dts: armada-375.dtsi: Add timer0 & timer1
>    arm: mvebu: dts: mvebu-u-boot.dtsi: Add "u-boot,dm-pre-reloc" to timer
>      DT node
>    kirkwood: lsxl: Sync defconfigs
> 
>   arch/arm/Kconfig                          |   4 +
>   arch/arm/dts/Makefile                     |   6 +-
>   arch/arm/dts/armada-375.dtsi              |   4 +-
>   arch/arm/dts/mvebu-u-boot.dtsi            |  11 +++
>   arch/arm/mach-mvebu/include/mach/config.h |   5 --
>   configs/lschlv2_defconfig                 |   2 -
>   configs/lsxhl_defconfig                   |   2 -
>   drivers/timer/Kconfig                     |   5 +-
>   drivers/timer/orion-timer.c               | 103 +++++++++++++++++++---
>   9 files changed, 118 insertions(+), 24 deletions(-)
> 

Applied to u-boot-marvell/master

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms
  2022-09-15 14:20 ` [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms Stefan Roese
@ 2022-11-05  4:03   ` Chris Packham
  2022-11-05  4:08     ` Chris Packham
  0 siblings, 1 reply; 21+ messages in thread
From: Chris Packham @ 2022-11-05  4:03 UTC (permalink / raw)
  To: Stefan Roese; +Cc: u-boot, pali, mibodhi, michael

Hi Stefan,

On Fri, Sep 16, 2022 at 2:23 AM Stefan Roese <sr@denx.de> wrote:
>
> Now that the new timer support is available for these platforms, let's
> select this IF for all these platforms. This way it's not necessary
> that each board changes it's config header.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Tested-by: Tony Dinh <mibodhi@gmail.com>
> ---
> v3:
> - No change
>
> v2:
> - No change
>
>  arch/arm/Kconfig                          | 4 ++++
>  arch/arm/mach-mvebu/include/mach/config.h | 5 -----
>  2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 82cd456f51f1..4ed100ab0ede 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -618,6 +618,7 @@ config ARCH_KIRKWOOD
>         select BOARD_EARLY_INIT_F
>         select CPU_ARM926EJS
>         select GPIO_EXTRA_HEADER
> +       select TIMER
>
>  config ARCH_MVEBU
>         bool "Marvell MVEBU family (Armada XP/375/38x/3700/7K/8K)"
> @@ -629,6 +630,8 @@ config ARCH_MVEBU
>         select GPIO_EXTRA_HEADER
>         select SPL_DM_SPI if SPL
>         select SPL_DM_SPI_FLASH if SPL
> +       select SPL_TIMER if SPL
> +       select TIMER
>         select OF_CONTROL
>         select OF_SEPARATE
>         select SPI
> @@ -639,6 +642,7 @@ config ARCH_ORION5X
>         select CPU_ARM926EJS
>         select GPIO_EXTRA_HEADER
>         select SPL_SEPARATE_BSS if SPL
> +       select TIMER
>
>  config TARGET_STV0991
>         bool "Support stv0991"
> diff --git a/arch/arm/mach-mvebu/include/mach/config.h b/arch/arm/mach-mvebu/include/mach/config.h
> index 4add0d9e1030..9b5036c31dd3 100644
> --- a/arch/arm/mach-mvebu/include/mach/config.h
> +++ b/arch/arm/mach-mvebu/include/mach/config.h
> @@ -41,9 +41,4 @@
>  #endif
>  #endif
>
> -/* Use common timer */
> -#define CONFIG_SYS_TIMER_COUNTS_DOWN
> -#define CONFIG_SYS_TIMER_COUNTER       (MVEBU_TIMER_BASE + 0x14)
> -#define CONFIG_SYS_TIMER_RATE          25000000
> -
>  #endif /* __MVEBU_CONFIG_H */
> --
> 2.37.3
>

I think this may have broken the 64-bit mvebu SoCs (at least reverting
it gets my AC5X series back to a working state). As far as I can tell
none of them have anything that would bring in any timer driver.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms
  2022-11-05  4:03   ` Chris Packham
@ 2022-11-05  4:08     ` Chris Packham
  2022-11-07  6:23       ` Stefan Roese
  0 siblings, 1 reply; 21+ messages in thread
From: Chris Packham @ 2022-11-05  4:08 UTC (permalink / raw)
  To: Stefan Roese; +Cc: u-boot, pali, mibodhi, michael

On Sat, Nov 5, 2022 at 5:03 PM Chris Packham <judge.packham@gmail.com> wrote:
>
> Hi Stefan,
>
> On Fri, Sep 16, 2022 at 2:23 AM Stefan Roese <sr@denx.de> wrote:
> >
> > Now that the new timer support is available for these platforms, let's
> > select this IF for all these platforms. This way it's not necessary
> > that each board changes it's config header.
> >
> > Signed-off-by: Stefan Roese <sr@denx.de>
> > Tested-by: Tony Dinh <mibodhi@gmail.com>
> > ---
> > v3:
> > - No change
> >
> > v2:
> > - No change
> >
> >  arch/arm/Kconfig                          | 4 ++++
> >  arch/arm/mach-mvebu/include/mach/config.h | 5 -----
> >  2 files changed, 4 insertions(+), 5 deletions(-)
> >
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > index 82cd456f51f1..4ed100ab0ede 100644
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -618,6 +618,7 @@ config ARCH_KIRKWOOD
> >         select BOARD_EARLY_INIT_F
> >         select CPU_ARM926EJS
> >         select GPIO_EXTRA_HEADER
> > +       select TIMER
> >
> >  config ARCH_MVEBU
> >         bool "Marvell MVEBU family (Armada XP/375/38x/3700/7K/8K)"
> > @@ -629,6 +630,8 @@ config ARCH_MVEBU
> >         select GPIO_EXTRA_HEADER
> >         select SPL_DM_SPI if SPL
> >         select SPL_DM_SPI_FLASH if SPL
> > +       select SPL_TIMER if SPL
> > +       select TIMER
> >         select OF_CONTROL
> >         select OF_SEPARATE
> >         select SPI
> > @@ -639,6 +642,7 @@ config ARCH_ORION5X
> >         select CPU_ARM926EJS
> >         select GPIO_EXTRA_HEADER
> >         select SPL_SEPARATE_BSS if SPL
> > +       select TIMER
> >
> >  config TARGET_STV0991
> >         bool "Support stv0991"
> > diff --git a/arch/arm/mach-mvebu/include/mach/config.h b/arch/arm/mach-mvebu/include/mach/config.h
> > index 4add0d9e1030..9b5036c31dd3 100644
> > --- a/arch/arm/mach-mvebu/include/mach/config.h
> > +++ b/arch/arm/mach-mvebu/include/mach/config.h
> > @@ -41,9 +41,4 @@
> >  #endif
> >  #endif
> >
> > -/* Use common timer */
> > -#define CONFIG_SYS_TIMER_COUNTS_DOWN
> > -#define CONFIG_SYS_TIMER_COUNTER       (MVEBU_TIMER_BASE + 0x14)
> > -#define CONFIG_SYS_TIMER_RATE          25000000
> > -
> >  #endif /* __MVEBU_CONFIG_H */
> > --
> > 2.37.3
> >
>
> I think this may have broken the 64-bit mvebu SoCs (at least reverting
> it gets my AC5X series back to a working state). As far as I can tell
> none of them have anything that would bring in any timer driver.

The following seems to sort things out without the need for a revert

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 710f171f87..e8968d61cd 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -640,7 +640,7 @@ config ARCH_MVEBU
        select SPL_DM_SPI if SPL
        select SPL_DM_SPI_FLASH if SPL
        select SPL_TIMER if SPL
-       select TIMER
+       select TIMER if !ARM64
        select OF_CONTROL
        select OF_SEPARATE
        select SPI

I'll include it in the series I'm about to send.

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms
  2022-11-05  4:08     ` Chris Packham
@ 2022-11-07  6:23       ` Stefan Roese
  2022-11-07  8:11         ` Chris Packham
  0 siblings, 1 reply; 21+ messages in thread
From: Stefan Roese @ 2022-11-07  6:23 UTC (permalink / raw)
  To: Chris Packham; +Cc: u-boot, pali, mibodhi, michael

Hi Chris,

On 05.11.22 05:08, Chris Packham wrote:
> On Sat, Nov 5, 2022 at 5:03 PM Chris Packham <judge.packham@gmail.com> wrote:
>>
>> Hi Stefan,
>>
>> On Fri, Sep 16, 2022 at 2:23 AM Stefan Roese <sr@denx.de> wrote:
>>>
>>> Now that the new timer support is available for these platforms, let's
>>> select this IF for all these platforms. This way it's not necessary
>>> that each board changes it's config header.
>>>
>>> Signed-off-by: Stefan Roese <sr@denx.de>
>>> Tested-by: Tony Dinh <mibodhi@gmail.com>
>>> ---
>>> v3:
>>> - No change
>>>
>>> v2:
>>> - No change
>>>
>>>   arch/arm/Kconfig                          | 4 ++++
>>>   arch/arm/mach-mvebu/include/mach/config.h | 5 -----
>>>   2 files changed, 4 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>>> index 82cd456f51f1..4ed100ab0ede 100644
>>> --- a/arch/arm/Kconfig
>>> +++ b/arch/arm/Kconfig
>>> @@ -618,6 +618,7 @@ config ARCH_KIRKWOOD
>>>          select BOARD_EARLY_INIT_F
>>>          select CPU_ARM926EJS
>>>          select GPIO_EXTRA_HEADER
>>> +       select TIMER
>>>
>>>   config ARCH_MVEBU
>>>          bool "Marvell MVEBU family (Armada XP/375/38x/3700/7K/8K)"
>>> @@ -629,6 +630,8 @@ config ARCH_MVEBU
>>>          select GPIO_EXTRA_HEADER
>>>          select SPL_DM_SPI if SPL
>>>          select SPL_DM_SPI_FLASH if SPL
>>> +       select SPL_TIMER if SPL
>>> +       select TIMER
>>>          select OF_CONTROL
>>>          select OF_SEPARATE
>>>          select SPI
>>> @@ -639,6 +642,7 @@ config ARCH_ORION5X
>>>          select CPU_ARM926EJS
>>>          select GPIO_EXTRA_HEADER
>>>          select SPL_SEPARATE_BSS if SPL
>>> +       select TIMER
>>>
>>>   config TARGET_STV0991
>>>          bool "Support stv0991"
>>> diff --git a/arch/arm/mach-mvebu/include/mach/config.h b/arch/arm/mach-mvebu/include/mach/config.h
>>> index 4add0d9e1030..9b5036c31dd3 100644
>>> --- a/arch/arm/mach-mvebu/include/mach/config.h
>>> +++ b/arch/arm/mach-mvebu/include/mach/config.h
>>> @@ -41,9 +41,4 @@
>>>   #endif
>>>   #endif
>>>
>>> -/* Use common timer */
>>> -#define CONFIG_SYS_TIMER_COUNTS_DOWN
>>> -#define CONFIG_SYS_TIMER_COUNTER       (MVEBU_TIMER_BASE + 0x14)
>>> -#define CONFIG_SYS_TIMER_RATE          25000000
>>> -
>>>   #endif /* __MVEBU_CONFIG_H */
>>> --
>>> 2.37.3
>>>
>>
>> I think this may have broken the 64-bit mvebu SoCs (at least reverting
>> it gets my AC5X series back to a working state). As far as I can tell
>> none of them have anything that would bring in any timer driver.
> 
> The following seems to sort things out without the need for a revert
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 710f171f87..e8968d61cd 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -640,7 +640,7 @@ config ARCH_MVEBU
>          select SPL_DM_SPI if SPL
>          select SPL_DM_SPI_FLASH if SPL
>          select SPL_TIMER if SPL
> -       select TIMER
> +       select TIMER if !ARM64
>          select OF_CONTROL
>          select OF_SEPARATE
>          select SPI
> 
> I'll include it in the series I'm about to send.

Thanks. Even though I wonder a bit that no other ARM64 Marvell user
stumbled over this yet.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms
  2022-11-07  6:23       ` Stefan Roese
@ 2022-11-07  8:11         ` Chris Packham
  2022-11-07  8:13           ` Stefan Roese
  0 siblings, 1 reply; 21+ messages in thread
From: Chris Packham @ 2022-11-07  8:11 UTC (permalink / raw)
  To: Stefan Roese; +Cc: u-boot, Pavol Rohár, Tony Dinh, Michael Walle

On Mon, 7 Nov 2022, 7:23 PM Stefan Roese, <sr@denx.de> wrote:

> Hi Chris,
>
> On 05.11.22 05:08, Chris Packham wrote:
> > On Sat, Nov 5, 2022 at 5:03 PM Chris Packham <judge.packham@gmail.com>
> wrote:
> >>
> >> Hi Stefan,
> >>
> >> On Fri, Sep 16, 2022 at 2:23 AM Stefan Roese <sr@denx.de> wrote:
> >>>
> >>> Now that the new timer support is available for these platforms, let's
> >>> select this IF for all these platforms. This way it's not necessary
> >>> that each board changes it's config header.
> >>>
> >>> Signed-off-by: Stefan Roese <sr@denx.de>
> >>> Tested-by: Tony Dinh <mibodhi@gmail.com>
> >>> ---
> >>> v3:
> >>> - No change
> >>>
> >>> v2:
> >>> - No change
> >>>
> >>>   arch/arm/Kconfig                          | 4 ++++
> >>>   arch/arm/mach-mvebu/include/mach/config.h | 5 -----
> >>>   2 files changed, 4 insertions(+), 5 deletions(-)
> >>>
> >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >>> index 82cd456f51f1..4ed100ab0ede 100644
> >>> --- a/arch/arm/Kconfig
> >>> +++ b/arch/arm/Kconfig
> >>> @@ -618,6 +618,7 @@ config ARCH_KIRKWOOD
> >>>          select BOARD_EARLY_INIT_F
> >>>          select CPU_ARM926EJS
> >>>          select GPIO_EXTRA_HEADER
> >>> +       select TIMER
> >>>
> >>>   config ARCH_MVEBU
> >>>          bool "Marvell MVEBU family (Armada XP/375/38x/3700/7K/8K)"
> >>> @@ -629,6 +630,8 @@ config ARCH_MVEBU
> >>>          select GPIO_EXTRA_HEADER
> >>>          select SPL_DM_SPI if SPL
> >>>          select SPL_DM_SPI_FLASH if SPL
> >>> +       select SPL_TIMER if SPL
> >>> +       select TIMER
> >>>          select OF_CONTROL
> >>>          select OF_SEPARATE
> >>>          select SPI
> >>> @@ -639,6 +642,7 @@ config ARCH_ORION5X
> >>>          select CPU_ARM926EJS
> >>>          select GPIO_EXTRA_HEADER
> >>>          select SPL_SEPARATE_BSS if SPL
> >>> +       select TIMER
> >>>
> >>>   config TARGET_STV0991
> >>>          bool "Support stv0991"
> >>> diff --git a/arch/arm/mach-mvebu/include/mach/config.h
> b/arch/arm/mach-mvebu/include/mach/config.h
> >>> index 4add0d9e1030..9b5036c31dd3 100644
> >>> --- a/arch/arm/mach-mvebu/include/mach/config.h
> >>> +++ b/arch/arm/mach-mvebu/include/mach/config.h
> >>> @@ -41,9 +41,4 @@
> >>>   #endif
> >>>   #endif
> >>>
> >>> -/* Use common timer */
> >>> -#define CONFIG_SYS_TIMER_COUNTS_DOWN
> >>> -#define CONFIG_SYS_TIMER_COUNTER       (MVEBU_TIMER_BASE + 0x14)
> >>> -#define CONFIG_SYS_TIMER_RATE          25000000
> >>> -
> >>>   #endif /* __MVEBU_CONFIG_H */
> >>> --
> >>> 2.37.3
> >>>
> >>
> >> I think this may have broken the 64-bit mvebu SoCs (at least reverting
> >> it gets my AC5X series back to a working state). As far as I can tell
> >> none of them have anything that would bring in any timer driver.
> >
> > The following seems to sort things out without the need for a revert
> >
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > index 710f171f87..e8968d61cd 100644
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -640,7 +640,7 @@ config ARCH_MVEBU
> >          select SPL_DM_SPI if SPL
> >          select SPL_DM_SPI_FLASH if SPL
> >          select SPL_TIMER if SPL
> > -       select TIMER
> > +       select TIMER if !ARM64
> >          select OF_CONTROL
> >          select OF_SEPARATE
> >          select SPI
> >
> > I'll include it in the series I'm about to send.
>
> Thanks. Even though I wonder a bit that no other ARM64 Marvell user
> stumbled over this yet.
>

Yeah I did wonder. I do have access to another less obscure Marvell board
at $dayjob. I'll see if I can confirm whether it needs the same change or
not.


> Thanks,
> Stefan
>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms
  2022-11-07  8:11         ` Chris Packham
@ 2022-11-07  8:13           ` Stefan Roese
  2022-11-07  8:45             ` Pali Rohár
  0 siblings, 1 reply; 21+ messages in thread
From: Stefan Roese @ 2022-11-07  8:13 UTC (permalink / raw)
  To: Chris Packham; +Cc: u-boot, Pavol Rohár, Tony Dinh, Michael Walle

Hi Chris,

On 07.11.22 09:11, Chris Packham wrote:
> 
> 
> On Mon, 7 Nov 2022, 7:23 PM Stefan Roese, <sr@denx.de 
> <mailto:sr@denx.de>> wrote:
> 
>     Hi Chris,
> 
>     On 05.11.22 05:08, Chris Packham wrote:
>      > On Sat, Nov 5, 2022 at 5:03 PM Chris Packham
>     <judge.packham@gmail.com <mailto:judge.packham@gmail.com>> wrote:
>      >>
>      >> Hi Stefan,
>      >>
>      >> On Fri, Sep 16, 2022 at 2:23 AM Stefan Roese <sr@denx.de
>     <mailto:sr@denx.de>> wrote:
>      >>>
>      >>> Now that the new timer support is available for these
>     platforms, let's
>      >>> select this IF for all these platforms. This way it's not necessary
>      >>> that each board changes it's config header.
>      >>>
>      >>> Signed-off-by: Stefan Roese <sr@denx.de <mailto:sr@denx.de>>
>      >>> Tested-by: Tony Dinh <mibodhi@gmail.com <mailto:mibodhi@gmail.com>>
>      >>> ---
>      >>> v3:
>      >>> - No change
>      >>>
>      >>> v2:
>      >>> - No change
>      >>>
>      >>>   arch/arm/Kconfig                          | 4 ++++
>      >>>   arch/arm/mach-mvebu/include/mach/config.h | 5 -----
>      >>>   2 files changed, 4 insertions(+), 5 deletions(-)
>      >>>
>      >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>      >>> index 82cd456f51f1..4ed100ab0ede 100644
>      >>> --- a/arch/arm/Kconfig
>      >>> +++ b/arch/arm/Kconfig
>      >>> @@ -618,6 +618,7 @@ config ARCH_KIRKWOOD
>      >>>          select BOARD_EARLY_INIT_F
>      >>>          select CPU_ARM926EJS
>      >>>          select GPIO_EXTRA_HEADER
>      >>> +       select TIMER
>      >>>
>      >>>   config ARCH_MVEBU
>      >>>          bool "Marvell MVEBU family (Armada XP/375/38x/3700/7K/8K)"
>      >>> @@ -629,6 +630,8 @@ config ARCH_MVEBU
>      >>>          select GPIO_EXTRA_HEADER
>      >>>          select SPL_DM_SPI if SPL
>      >>>          select SPL_DM_SPI_FLASH if SPL
>      >>> +       select SPL_TIMER if SPL
>      >>> +       select TIMER
>      >>>          select OF_CONTROL
>      >>>          select OF_SEPARATE
>      >>>          select SPI
>      >>> @@ -639,6 +642,7 @@ config ARCH_ORION5X
>      >>>          select CPU_ARM926EJS
>      >>>          select GPIO_EXTRA_HEADER
>      >>>          select SPL_SEPARATE_BSS if SPL
>      >>> +       select TIMER
>      >>>
>      >>>   config TARGET_STV0991
>      >>>          bool "Support stv0991"
>      >>> diff --git a/arch/arm/mach-mvebu/include/mach/config.h
>     b/arch/arm/mach-mvebu/include/mach/config.h
>      >>> index 4add0d9e1030..9b5036c31dd3 100644
>      >>> --- a/arch/arm/mach-mvebu/include/mach/config.h
>      >>> +++ b/arch/arm/mach-mvebu/include/mach/config.h
>      >>> @@ -41,9 +41,4 @@
>      >>>   #endif
>      >>>   #endif
>      >>>
>      >>> -/* Use common timer */
>      >>> -#define CONFIG_SYS_TIMER_COUNTS_DOWN
>      >>> -#define CONFIG_SYS_TIMER_COUNTER       (MVEBU_TIMER_BASE + 0x14)
>      >>> -#define CONFIG_SYS_TIMER_RATE          25000000
>      >>> -
>      >>>   #endif /* __MVEBU_CONFIG_H */
>      >>> --
>      >>> 2.37.3
>      >>>
>      >>
>      >> I think this may have broken the 64-bit mvebu SoCs (at least
>     reverting
>      >> it gets my AC5X series back to a working state). As far as I can
>     tell
>      >> none of them have anything that would bring in any timer driver.
>      >
>      > The following seems to sort things out without the need for a revert
>      >
>      > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>      > index 710f171f87..e8968d61cd 100644
>      > --- a/arch/arm/Kconfig
>      > +++ b/arch/arm/Kconfig
>      > @@ -640,7 +640,7 @@ config ARCH_MVEBU
>      >          select SPL_DM_SPI if SPL
>      >          select SPL_DM_SPI_FLASH if SPL
>      >          select SPL_TIMER if SPL
>      > -       select TIMER
>      > +       select TIMER if !ARM64
>      >          select OF_CONTROL
>      >          select OF_SEPARATE
>      >          select SPI
>      >
>      > I'll include it in the series I'm about to send.
> 
>     Thanks. Even though I wonder a bit that no other ARM64 Marvell user
>     stumbled over this yet.
> 
> 
> Yeah I did wonder. I do have access to another less obscure Marvell 
> board at $dayjob. I'll see if I can confirm whether it needs the same 
> change or not.

Cool, thanks. I'm running a CI build right now and will push your
patches later today if all works fine.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms
  2022-11-07  8:13           ` Stefan Roese
@ 2022-11-07  8:45             ` Pali Rohár
  2022-11-08  7:33               ` Chris Packham
  0 siblings, 1 reply; 21+ messages in thread
From: Pali Rohár @ 2022-11-07  8:45 UTC (permalink / raw)
  To: Stefan Roese; +Cc: Chris Packham, u-boot, Tony Dinh, Michael Walle

On Monday 07 November 2022 09:13:37 Stefan Roese wrote:
> Hi Chris,
> 
> On 07.11.22 09:11, Chris Packham wrote:
> > 
> > 
> > On Mon, 7 Nov 2022, 7:23 PM Stefan Roese, <sr@denx.de
> > <mailto:sr@denx.de>> wrote:
> > 
> >     Hi Chris,
> > 
> >     On 05.11.22 05:08, Chris Packham wrote:
> >      > On Sat, Nov 5, 2022 at 5:03 PM Chris Packham
> >     <judge.packham@gmail.com <mailto:judge.packham@gmail.com>> wrote:
> >      >>
> >      >> Hi Stefan,
> >      >>
> >      >> On Fri, Sep 16, 2022 at 2:23 AM Stefan Roese <sr@denx.de
> >     <mailto:sr@denx.de>> wrote:
> >      >>>
> >      >>> Now that the new timer support is available for these
> >     platforms, let's
> >      >>> select this IF for all these platforms. This way it's not necessary
> >      >>> that each board changes it's config header.
> >      >>>
> >      >>> Signed-off-by: Stefan Roese <sr@denx.de <mailto:sr@denx.de>>
> >      >>> Tested-by: Tony Dinh <mibodhi@gmail.com <mailto:mibodhi@gmail.com>>
> >      >>> ---
> >      >>> v3:
> >      >>> - No change
> >      >>>
> >      >>> v2:
> >      >>> - No change
> >      >>>
> >      >>>   arch/arm/Kconfig                          | 4 ++++
> >      >>>   arch/arm/mach-mvebu/include/mach/config.h | 5 -----
> >      >>>   2 files changed, 4 insertions(+), 5 deletions(-)
> >      >>>
> >      >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >      >>> index 82cd456f51f1..4ed100ab0ede 100644
> >      >>> --- a/arch/arm/Kconfig
> >      >>> +++ b/arch/arm/Kconfig
> >      >>> @@ -618,6 +618,7 @@ config ARCH_KIRKWOOD
> >      >>>          select BOARD_EARLY_INIT_F
> >      >>>          select CPU_ARM926EJS
> >      >>>          select GPIO_EXTRA_HEADER
> >      >>> +       select TIMER
> >      >>>
> >      >>>   config ARCH_MVEBU
> >      >>>          bool "Marvell MVEBU family (Armada XP/375/38x/3700/7K/8K)"
> >      >>> @@ -629,6 +630,8 @@ config ARCH_MVEBU
> >      >>>          select GPIO_EXTRA_HEADER
> >      >>>          select SPL_DM_SPI if SPL
> >      >>>          select SPL_DM_SPI_FLASH if SPL
> >      >>> +       select SPL_TIMER if SPL
> >      >>> +       select TIMER
> >      >>>          select OF_CONTROL
> >      >>>          select OF_SEPARATE
> >      >>>          select SPI
> >      >>> @@ -639,6 +642,7 @@ config ARCH_ORION5X
> >      >>>          select CPU_ARM926EJS
> >      >>>          select GPIO_EXTRA_HEADER
> >      >>>          select SPL_SEPARATE_BSS if SPL
> >      >>> +       select TIMER
> >      >>>
> >      >>>   config TARGET_STV0991
> >      >>>          bool "Support stv0991"
> >      >>> diff --git a/arch/arm/mach-mvebu/include/mach/config.h
> >     b/arch/arm/mach-mvebu/include/mach/config.h
> >      >>> index 4add0d9e1030..9b5036c31dd3 100644
> >      >>> --- a/arch/arm/mach-mvebu/include/mach/config.h
> >      >>> +++ b/arch/arm/mach-mvebu/include/mach/config.h
> >      >>> @@ -41,9 +41,4 @@
> >      >>>   #endif
> >      >>>   #endif
> >      >>>
> >      >>> -/* Use common timer */
> >      >>> -#define CONFIG_SYS_TIMER_COUNTS_DOWN
> >      >>> -#define CONFIG_SYS_TIMER_COUNTER       (MVEBU_TIMER_BASE + 0x14)
> >      >>> -#define CONFIG_SYS_TIMER_RATE          25000000
> >      >>> -
> >      >>>   #endif /* __MVEBU_CONFIG_H */
> >      >>> --
> >      >>> 2.37.3
> >      >>>
> >      >>
> >      >> I think this may have broken the 64-bit mvebu SoCs (at least
> >     reverting
> >      >> it gets my AC5X series back to a working state). As far as I can
> >     tell
> >      >> none of them have anything that would bring in any timer driver.
> >      >
> >      > The following seems to sort things out without the need for a revert
> >      >
> >      > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >      > index 710f171f87..e8968d61cd 100644
> >      > --- a/arch/arm/Kconfig
> >      > +++ b/arch/arm/Kconfig
> >      > @@ -640,7 +640,7 @@ config ARCH_MVEBU
> >      >          select SPL_DM_SPI if SPL
> >      >          select SPL_DM_SPI_FLASH if SPL
> >      >          select SPL_TIMER if SPL
> >      > -       select TIMER
> >      > +       select TIMER if !ARM64
> >      >          select OF_CONTROL
> >      >          select OF_SEPARATE
> >      >          select SPI
> >      >
> >      > I'll include it in the series I'm about to send.
> > 
> >     Thanks. Even though I wonder a bit that no other ARM64 Marvell user
> >     stumbled over this yet.
> > 
> > 
> > Yeah I did wonder. I do have access to another less obscure Marvell
> > board at $dayjob. I'll see if I can confirm whether it needs the same
> > change or not.
> 
> Cool, thanks. I'm running a CI build right now and will push your
> patches later today if all works fine.
> 
> Thanks,
> Stefan

Sorry, I have not tested A3720 with all those changes. So I do not know.
I tested only A385 and it worked fine.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms
  2022-11-07  8:45             ` Pali Rohár
@ 2022-11-08  7:33               ` Chris Packham
  2022-11-08  7:37                 ` Stefan Roese
  0 siblings, 1 reply; 21+ messages in thread
From: Chris Packham @ 2022-11-08  7:33 UTC (permalink / raw)
  To: Pali Rohár; +Cc: Stefan Roese, u-boot, Tony Dinh, Michael Walle

On Mon, Nov 7, 2022 at 9:45 PM Pali Rohár <pali@kernel.org> wrote:
>
> On Monday 07 November 2022 09:13:37 Stefan Roese wrote:
> > Hi Chris,
> >
> > On 07.11.22 09:11, Chris Packham wrote:
> > >
> > >
> > > On Mon, 7 Nov 2022, 7:23 PM Stefan Roese, <sr@denx.de
> > > <mailto:sr@denx.de>> wrote:
> > >
> > >     Hi Chris,
> > >
> > >     On 05.11.22 05:08, Chris Packham wrote:
> > >      > On Sat, Nov 5, 2022 at 5:03 PM Chris Packham
> > >     <judge.packham@gmail.com <mailto:judge.packham@gmail.com>> wrote:
> > >      >>
> > >      >> Hi Stefan,
> > >      >>
> > >      >> On Fri, Sep 16, 2022 at 2:23 AM Stefan Roese <sr@denx.de
> > >     <mailto:sr@denx.de>> wrote:
> > >      >>>
> > >      >>> Now that the new timer support is available for these
> > >     platforms, let's
> > >      >>> select this IF for all these platforms. This way it's not necessary
> > >      >>> that each board changes it's config header.
> > >      >>>
> > >      >>> Signed-off-by: Stefan Roese <sr@denx.de <mailto:sr@denx.de>>
> > >      >>> Tested-by: Tony Dinh <mibodhi@gmail.com <mailto:mibodhi@gmail.com>>
> > >      >>> ---
> > >      >>> v3:
> > >      >>> - No change
> > >      >>>
> > >      >>> v2:
> > >      >>> - No change
> > >      >>>
> > >      >>>   arch/arm/Kconfig                          | 4 ++++
> > >      >>>   arch/arm/mach-mvebu/include/mach/config.h | 5 -----
> > >      >>>   2 files changed, 4 insertions(+), 5 deletions(-)
> > >      >>>
> > >      >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > >      >>> index 82cd456f51f1..4ed100ab0ede 100644
> > >      >>> --- a/arch/arm/Kconfig
> > >      >>> +++ b/arch/arm/Kconfig
> > >      >>> @@ -618,6 +618,7 @@ config ARCH_KIRKWOOD
> > >      >>>          select BOARD_EARLY_INIT_F
> > >      >>>          select CPU_ARM926EJS
> > >      >>>          select GPIO_EXTRA_HEADER
> > >      >>> +       select TIMER
> > >      >>>
> > >      >>>   config ARCH_MVEBU
> > >      >>>          bool "Marvell MVEBU family (Armada XP/375/38x/3700/7K/8K)"
> > >      >>> @@ -629,6 +630,8 @@ config ARCH_MVEBU
> > >      >>>          select GPIO_EXTRA_HEADER
> > >      >>>          select SPL_DM_SPI if SPL
> > >      >>>          select SPL_DM_SPI_FLASH if SPL
> > >      >>> +       select SPL_TIMER if SPL
> > >      >>> +       select TIMER
> > >      >>>          select OF_CONTROL
> > >      >>>          select OF_SEPARATE
> > >      >>>          select SPI
> > >      >>> @@ -639,6 +642,7 @@ config ARCH_ORION5X
> > >      >>>          select CPU_ARM926EJS
> > >      >>>          select GPIO_EXTRA_HEADER
> > >      >>>          select SPL_SEPARATE_BSS if SPL
> > >      >>> +       select TIMER
> > >      >>>
> > >      >>>   config TARGET_STV0991
> > >      >>>          bool "Support stv0991"
> > >      >>> diff --git a/arch/arm/mach-mvebu/include/mach/config.h
> > >     b/arch/arm/mach-mvebu/include/mach/config.h
> > >      >>> index 4add0d9e1030..9b5036c31dd3 100644
> > >      >>> --- a/arch/arm/mach-mvebu/include/mach/config.h
> > >      >>> +++ b/arch/arm/mach-mvebu/include/mach/config.h
> > >      >>> @@ -41,9 +41,4 @@
> > >      >>>   #endif
> > >      >>>   #endif
> > >      >>>
> > >      >>> -/* Use common timer */
> > >      >>> -#define CONFIG_SYS_TIMER_COUNTS_DOWN
> > >      >>> -#define CONFIG_SYS_TIMER_COUNTER       (MVEBU_TIMER_BASE + 0x14)
> > >      >>> -#define CONFIG_SYS_TIMER_RATE          25000000
> > >      >>> -
> > >      >>>   #endif /* __MVEBU_CONFIG_H */
> > >      >>> --
> > >      >>> 2.37.3
> > >      >>>
> > >      >>
> > >      >> I think this may have broken the 64-bit mvebu SoCs (at least
> > >     reverting
> > >      >> it gets my AC5X series back to a working state). As far as I can
> > >     tell
> > >      >> none of them have anything that would bring in any timer driver.
> > >      >
> > >      > The following seems to sort things out without the need for a revert
> > >      >
> > >      > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > >      > index 710f171f87..e8968d61cd 100644
> > >      > --- a/arch/arm/Kconfig
> > >      > +++ b/arch/arm/Kconfig
> > >      > @@ -640,7 +640,7 @@ config ARCH_MVEBU
> > >      >          select SPL_DM_SPI if SPL
> > >      >          select SPL_DM_SPI_FLASH if SPL
> > >      >          select SPL_TIMER if SPL
> > >      > -       select TIMER
> > >      > +       select TIMER if !ARM64
> > >      >          select OF_CONTROL
> > >      >          select OF_SEPARATE
> > >      >          select SPI
> > >      >
> > >      > I'll include it in the series I'm about to send.
> > >
> > >     Thanks. Even though I wonder a bit that no other ARM64 Marvell user
> > >     stumbled over this yet.
> > >
> > >
> > > Yeah I did wonder. I do have access to another less obscure Marvell
> > > board at $dayjob. I'll see if I can confirm whether it needs the same
> > > change or not.
> >
> > Cool, thanks. I'm running a CI build right now and will push your
> > patches later today if all works fine.
> >
> > Thanks,
> > Stefan
>
> Sorry, I have not tested A3720 with all those changes. So I do not know.
> I tested only A385 and it worked fine.

I can confirm that the original change broke CN9130 and the if !ARM64
fixes it. So with the PR that Stefan has just sent and Tom has merged
v2023.01-rc1 should be good on the 64 bit MVEBU boards.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms
  2022-11-08  7:33               ` Chris Packham
@ 2022-11-08  7:37                 ` Stefan Roese
  0 siblings, 0 replies; 21+ messages in thread
From: Stefan Roese @ 2022-11-08  7:37 UTC (permalink / raw)
  To: Chris Packham, Pali Rohár; +Cc: u-boot, Tony Dinh, Michael Walle

On 08.11.22 08:33, Chris Packham wrote:
> On Mon, Nov 7, 2022 at 9:45 PM Pali Rohár <pali@kernel.org> wrote:
>>
>> On Monday 07 November 2022 09:13:37 Stefan Roese wrote:
>>> Hi Chris,
>>>
>>> On 07.11.22 09:11, Chris Packham wrote:
>>>>
>>>>
>>>> On Mon, 7 Nov 2022, 7:23 PM Stefan Roese, <sr@denx.de
>>>> <mailto:sr@denx.de>> wrote:
>>>>
>>>>      Hi Chris,
>>>>
>>>>      On 05.11.22 05:08, Chris Packham wrote:
>>>>       > On Sat, Nov 5, 2022 at 5:03 PM Chris Packham
>>>>      <judge.packham@gmail.com <mailto:judge.packham@gmail.com>> wrote:
>>>>       >>
>>>>       >> Hi Stefan,
>>>>       >>
>>>>       >> On Fri, Sep 16, 2022 at 2:23 AM Stefan Roese <sr@denx.de
>>>>      <mailto:sr@denx.de>> wrote:
>>>>       >>>
>>>>       >>> Now that the new timer support is available for these
>>>>      platforms, let's
>>>>       >>> select this IF for all these platforms. This way it's not necessary
>>>>       >>> that each board changes it's config header.
>>>>       >>>
>>>>       >>> Signed-off-by: Stefan Roese <sr@denx.de <mailto:sr@denx.de>>
>>>>       >>> Tested-by: Tony Dinh <mibodhi@gmail.com <mailto:mibodhi@gmail.com>>
>>>>       >>> ---
>>>>       >>> v3:
>>>>       >>> - No change
>>>>       >>>
>>>>       >>> v2:
>>>>       >>> - No change
>>>>       >>>
>>>>       >>>   arch/arm/Kconfig                          | 4 ++++
>>>>       >>>   arch/arm/mach-mvebu/include/mach/config.h | 5 -----
>>>>       >>>   2 files changed, 4 insertions(+), 5 deletions(-)
>>>>       >>>
>>>>       >>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>>>>       >>> index 82cd456f51f1..4ed100ab0ede 100644
>>>>       >>> --- a/arch/arm/Kconfig
>>>>       >>> +++ b/arch/arm/Kconfig
>>>>       >>> @@ -618,6 +618,7 @@ config ARCH_KIRKWOOD
>>>>       >>>          select BOARD_EARLY_INIT_F
>>>>       >>>          select CPU_ARM926EJS
>>>>       >>>          select GPIO_EXTRA_HEADER
>>>>       >>> +       select TIMER
>>>>       >>>
>>>>       >>>   config ARCH_MVEBU
>>>>       >>>          bool "Marvell MVEBU family (Armada XP/375/38x/3700/7K/8K)"
>>>>       >>> @@ -629,6 +630,8 @@ config ARCH_MVEBU
>>>>       >>>          select GPIO_EXTRA_HEADER
>>>>       >>>          select SPL_DM_SPI if SPL
>>>>       >>>          select SPL_DM_SPI_FLASH if SPL
>>>>       >>> +       select SPL_TIMER if SPL
>>>>       >>> +       select TIMER
>>>>       >>>          select OF_CONTROL
>>>>       >>>          select OF_SEPARATE
>>>>       >>>          select SPI
>>>>       >>> @@ -639,6 +642,7 @@ config ARCH_ORION5X
>>>>       >>>          select CPU_ARM926EJS
>>>>       >>>          select GPIO_EXTRA_HEADER
>>>>       >>>          select SPL_SEPARATE_BSS if SPL
>>>>       >>> +       select TIMER
>>>>       >>>
>>>>       >>>   config TARGET_STV0991
>>>>       >>>          bool "Support stv0991"
>>>>       >>> diff --git a/arch/arm/mach-mvebu/include/mach/config.h
>>>>      b/arch/arm/mach-mvebu/include/mach/config.h
>>>>       >>> index 4add0d9e1030..9b5036c31dd3 100644
>>>>       >>> --- a/arch/arm/mach-mvebu/include/mach/config.h
>>>>       >>> +++ b/arch/arm/mach-mvebu/include/mach/config.h
>>>>       >>> @@ -41,9 +41,4 @@
>>>>       >>>   #endif
>>>>       >>>   #endif
>>>>       >>>
>>>>       >>> -/* Use common timer */
>>>>       >>> -#define CONFIG_SYS_TIMER_COUNTS_DOWN
>>>>       >>> -#define CONFIG_SYS_TIMER_COUNTER       (MVEBU_TIMER_BASE + 0x14)
>>>>       >>> -#define CONFIG_SYS_TIMER_RATE          25000000
>>>>       >>> -
>>>>       >>>   #endif /* __MVEBU_CONFIG_H */
>>>>       >>> --
>>>>       >>> 2.37.3
>>>>       >>>
>>>>       >>
>>>>       >> I think this may have broken the 64-bit mvebu SoCs (at least
>>>>      reverting
>>>>       >> it gets my AC5X series back to a working state). As far as I can
>>>>      tell
>>>>       >> none of them have anything that would bring in any timer driver.
>>>>       >
>>>>       > The following seems to sort things out without the need for a revert
>>>>       >
>>>>       > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>>>>       > index 710f171f87..e8968d61cd 100644
>>>>       > --- a/arch/arm/Kconfig
>>>>       > +++ b/arch/arm/Kconfig
>>>>       > @@ -640,7 +640,7 @@ config ARCH_MVEBU
>>>>       >          select SPL_DM_SPI if SPL
>>>>       >          select SPL_DM_SPI_FLASH if SPL
>>>>       >          select SPL_TIMER if SPL
>>>>       > -       select TIMER
>>>>       > +       select TIMER if !ARM64
>>>>       >          select OF_CONTROL
>>>>       >          select OF_SEPARATE
>>>>       >          select SPI
>>>>       >
>>>>       > I'll include it in the series I'm about to send.
>>>>
>>>>      Thanks. Even though I wonder a bit that no other ARM64 Marvell user
>>>>      stumbled over this yet.
>>>>
>>>>
>>>> Yeah I did wonder. I do have access to another less obscure Marvell
>>>> board at $dayjob. I'll see if I can confirm whether it needs the same
>>>> change or not.
>>>
>>> Cool, thanks. I'm running a CI build right now and will push your
>>> patches later today if all works fine.
>>>
>>> Thanks,
>>> Stefan
>>
>> Sorry, I have not tested A3720 with all those changes. So I do not know.
>> I tested only A385 and it worked fine.
> 
> I can confirm that the original change broke CN9130 and the if !ARM64
> fixes it. So with the PR that Stefan has just sent and Tom has merged
> v2023.01-rc1 should be good on the 64 bit MVEBU boards.

Thanks Chris for testing and confirming this fix.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-11-08  7:37 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15 14:20 [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Stefan Roese
2022-09-15 14:20 ` [PATCH v3 1/8] timer: orion-timer: Use timer_conv_64() to fix timer wrap around Stefan Roese
2022-09-18 10:49   ` Stefan Roese
2022-09-15 14:20 ` [PATCH v3 2/8] timer: orion-timer: Add support for other Armada SoC's Stefan Roese
2022-09-15 14:20 ` [PATCH v3 3/8] timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support Stefan Roese
2022-09-15 14:20 ` [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms Stefan Roese
2022-11-05  4:03   ` Chris Packham
2022-11-05  4:08     ` Chris Packham
2022-11-07  6:23       ` Stefan Roese
2022-11-07  8:11         ` Chris Packham
2022-11-07  8:13           ` Stefan Roese
2022-11-07  8:45             ` Pali Rohár
2022-11-08  7:33               ` Chris Packham
2022-11-08  7:37                 ` Stefan Roese
2022-09-15 14:20 ` [PATCH v3 5/8] arm: mvebu: dts: Makefile: Compile Armada 375 dtb in a separate step Stefan Roese
2022-09-15 14:20 ` [PATCH v3 6/8] arm: mvebu: dts: armada-375.dtsi: Add timer0 & timer1 Stefan Roese
2022-09-15 14:20 ` [PATCH v3 7/8] arm: mvebu: dts: mvebu-u-boot.dtsi: Add "u-boot, dm-pre-reloc" to timer DT node Stefan Roese
2022-09-15 14:20 ` [PATCH v3 8/8] kirkwood: lsxl: Sync defconfigs Stefan Roese
2022-09-15 15:53 ` [PATCH v3 0/8] Enable CONFIG_TIMER for all Kirkwood / MVEBU boards Pali Rohár
2022-09-20  6:59 ` Stefan Roese
2022-10-06 10:44 ` Stefan Roese

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.