Skip to contentSkip to conversation

Enable CONFIG_TIMER for all Kirkwood / MVEBU boards

PATCH In review Stefan Roese 3 participants 21 messages Sep 15, 2022 – Nov 8, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v3 cover Enable CONFIG_TIMER for all Kirkwood / MVEBU boards

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(-)
Signature · 1 line
2.37.3
#1 lore raw

PATCH v3 1/8 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")

---
v3:
- Add Fixes tag

v2:
- New patch

 drivers/timer/orion-timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/timer/orion-timer.c +1 -1
index fd30e1bf036c..d7d1a1b24462 100644
@@ -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)
Signature · 1 line
2.37.3
#2 lore raw

Re: [PATCH v3 1/8] timer: orion-timer: Use timer_conv_64() to fix timer wrap around

Quoted 9 lines · Stefan Roese

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")

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 15 lines

---
v3:
- Add Fixes tag

v2:
- New patch

  drivers/timer/orion-timer.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/timer/orion-timer.c +0 -0
index fd30e1bf036c..d7d1a1b24462 100644

drivers/timer/orion-timer.c static uint64_t orion_timer_get_count(struct udevice *dev) · line 25

Quoted 8 lines
drivers/timer/orion-timer.c +1 -1
@@ -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

Signature · 3 lines
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: [email protected]
#3 lore raw

PATCH v3 2/8 timer: orion-timer: Add support for other Armada SoC's

In reply to Stefan Roese

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

---
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(-)
drivers/timer/Kconfig +4 -1
index 404929014810..b0814acca3fb 100644
@@ -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"
drivers/timer/orion-timer.c +39 -3

73 lines not on this page · raw message

Signature · 1 line
2.37.3
#4 lore raw

PATCH v3 3/8 timer: orion-timer: Add timer_get_boot_us() for BOOTSTAGE support

In reply to Stefan Roese

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

---
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(-)
drivers/timer/orion-timer.c +64 -19
index 14f318e57d4d..cd63ea916237 100644
@@ -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[] = {
Signature · 1 line
2.37.3
#5 lore raw

PATCH v3 4/8 arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms

In reply to Stefan Roese

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.

---
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(-)
arch/arm/Kconfig +4 -0
index 82cd456f51f1..4ed100ab0ede 100644
@@ -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"
arch/arm/mach-mvebu/include/mach/config.h +0 -5
index 4add0d9e1030..9b5036c31dd3 100644
@@ -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 */
Signature · 1 line
2.37.3
#6 lore raw

Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms

Hi Stefan,

Quoted 62 lines · Stefan Roese

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.

---
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(-)
arch/arm/Kconfig +4 -0
index 82cd456f51f1..4ed100ab0ede 100644
@@ -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"
arch/arm/mach-mvebu/include/mach/config.h +0 -6
index 4add0d9e1030..9b5036c31dd3 100644
@@ -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 */
--
Quoted 2 lines

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.

#7 lore raw

Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms

Quoted 59 lines · Chris Packham

Hi Stefan,

Quoted 55 lines · Stefan Roese

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.

---
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(-)
arch/arm/Kconfig +4 -0
index 82cd456f51f1..4ed100ab0ede 100644
@@ -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"
arch/arm/mach-mvebu/include/mach/config.h +0 -0
index 4add0d9e1030..9b5036c31dd3 100644
@@ -41,9 +41,4 @@
 #endif
 #endif
 
Quoted 13 lines
Quoted 9 lines
arch/arm/mach-mvebu/include/mach/config.h +0 -6
-/* 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

arch/arm/Kconfig +1 -1
index 710f171f87..e8968d61cd 100644
@@ -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.

#8 lore raw

Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms

Hi Chris,

Quoted 90 lines · Chris Packham
Quoted 59 lines · Chris Packham

Hi Stefan,

Quoted 55 lines · Stefan Roese

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.

---
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(-)
arch/arm/Kconfig +4 -0
index 82cd456f51f1..4ed100ab0ede 100644
@@ -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"
arch/arm/mach-mvebu/include/mach/config.h +0 -0
index 4add0d9e1030..9b5036c31dd3 100644
@@ -41,9 +41,4 @@
  #endif
  #endif
 
Quoted 13 lines
Quoted 9 lines
arch/arm/mach-mvebu/include/mach/config.h +0 -6
-/* 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

arch/arm/Kconfig +1 -1
index 710f171f87..e8968d61cd 100644
@@ -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
Quoted 1 line

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

#9 lore raw

Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms

Quoted 95 lines · Stefan Roese,

Hi Chris,

Quoted 1 line · Chris Packham

On Sat, Nov 5, 2022 at 5:03 PM Chris Packham <[email protected]>

Quoted 49 lines · wrote:
Quoted 49 lines

Hi Stefan,

Quoted 45 lines · Stefan Roese

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.

---
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(-)
arch/arm/Kconfig +4 -0
index 82cd456f51f1..4ed100ab0ede 100644
@@ -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
 
Quoted 3 lines
Quoted 3 lines

Review

Quoted 3 lines
arch/arm/Kconfig +0 -0
  config TARGET_STV0991
         bool "Support stv0991"
(quoted diff) +0 -0

b/arch/arm/mach-mvebu/include/mach/config.h

Quoted 37 lines
Quoted 7 lines
Quoted 7 lines

index 4add0d9e1030..9b5036c31dd3 100644

arch/arm/mach-mvebu/include/mach/config.h +0 -0
@@ -41,9 +41,4 @@
  #endif
  #endif
 
Quoted 13 lines
Quoted 9 lines
arch/arm/mach-mvebu/include/mach/config.h +0 -6
-/* 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

arch/arm/Kconfig +1 -1
index 710f171f87..e8968d61cd 100644
@@ -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
Quoted 5 lines
Quoted 1 line

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.

Quoted 3 lines

Thanks,
Stefan

#10 lore raw

Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms

Hi Chris,

Quoted 109 lines · Chris Packham

On Mon, 7 Nov 2022, 7:23 PM Stefan Roese, <[email protected] <mailto:[email protected]>> wrote:

    Hi Chris,

    On 05.11.22 05:08, Chris Packham wrote:
     > On Sat, Nov 5, 2022 at 5:03 PM Chris Packham
    <[email protected] <mailto:[email protected]>> wrote:
     >>
     >> Hi Stefan,
     >>
     >> On Fri, Sep 16, 2022 at 2:23 AM Stefan Roese <[email protected]
    <mailto:[email protected]>> 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 <[email protected] <mailto:[email protected]>>
     >>> Tested-by: Tony Dinh <[email protected] <mailto:[email protected]>>
     >>> ---
     >>> 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.
Quoted 1 line

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

#11 lore raw

Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms

Quoted 117 lines · On Monday 07 November 2022 09:13:37 Stefan Roese wrote:

Hi Chris,

Quoted 110 lines · Chris Packham

On Mon, 7 Nov 2022, 7:23 PM Stefan Roese, <[email protected] <mailto:[email protected]>> wrote:

    Hi Chris,

    On 05.11.22 05:08, Chris Packham wrote:
     > On Sat, Nov 5, 2022 at 5:03 PM Chris Packham
    <[email protected] <mailto:[email protected]>> wrote:
     >>
     >> Hi Stefan,
     >>
     >> On Fri, Sep 16, 2022 at 2:23 AM Stefan Roese <[email protected]
    <mailto:[email protected]>> 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 <[email protected] <mailto:[email protected]>>
     >>> Tested-by: Tony Dinh <[email protected] <mailto:[email protected]>>
     >>> ---
     >>> 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.
Quoted 3 lines

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.

Quoted 5 lines

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.

#12 lore raw

Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms

Quoted 119 lines · Pali Rohár
Quoted 117 lines · On Monday 07 November 2022 09:13:37 Stefan Roese wrote:

Hi Chris,

Quoted 113 lines · Chris Packham

On Mon, 7 Nov 2022, 7:23 PM Stefan Roese, <[email protected] <mailto:[email protected]>> wrote:

    Hi Chris,

    On 05.11.22 05:08, Chris Packham wrote:
     > On Sat, Nov 5, 2022 at 5:03 PM Chris Packham
    <[email protected] <mailto:[email protected]>> wrote:
     >>
     >> Hi Stefan,
     >>
     >> On Fri, Sep 16, 2022 at 2:23 AM Stefan Roese <[email protected]
    <mailto:[email protected]>> 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 <[email protected] <mailto:[email protected]>>
     >>> Tested-by: Tony Dinh <[email protected] <mailto:[email protected]>>
     >>> ---
     >>> 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.

Quoted 8 lines
Quoted 5 lines

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.

#13 lore raw

Re: [PATCH v3 4/8] arm: mvebu: Use CONFIG_TIMER on all MVEBU & KIRKWOOD platforms

Quoted 126 lines · Chris Packham
Quoted 125 lines · Pali Rohár
Quoted 122 lines · On Monday 07 November 2022 09:13:37 Stefan Roese wrote:

Hi Chris,

Quoted 110 lines · Chris Packham

On Mon, 7 Nov 2022, 7:23 PM Stefan Roese, <[email protected] <mailto:[email protected]>> wrote:

     Hi Chris,

     On 05.11.22 05:08, Chris Packham wrote:
      > On Sat, Nov 5, 2022 at 5:03 PM Chris Packham
     <[email protected] <mailto:[email protected]>> wrote:
      >>
      >> Hi Stefan,
      >>
      >> On Fri, Sep 16, 2022 at 2:23 AM Stefan Roese <[email protected]
     <mailto:[email protected]>> 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 <[email protected] <mailto:[email protected]>>
      >>> Tested-by: Tony Dinh <[email protected] <mailto:[email protected]>>
      >>> ---
      >>> 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.
Quoted 3 lines

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

Quoted 6 lines
Quoted 2 lines

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

#14 lore raw

PATCH v3 5/8 arm: mvebu: dts: Makefile: Compile Armada 375 dtb in a separate step

In reply to Stefan Roese

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.

---
v3:
- No change

v2:
- No change

 arch/arm/dts/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm/dts/Makefile +5 -1
index 7330121dbaba..03e79e14681f 100644
@@ -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			\
Signature · 1 line
2.37.3
#15 lore raw

PATCH v3 6/8 arm: mvebu: dts: armada-375.dtsi: Add timer0 & timer1

In reply to Stefan Roese

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

---
v3:
- No change

v2:
- No change

 arch/arm/dts/armada-375.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/dts/armada-375.dtsi +2 -2
index 20a8c352b2f1..a044b3fc994f 100644
@@ -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>,
Signature · 1 line
2.37.3
#16 lore raw

PATCH v3 7/8 arm: mvebu: dts: mvebu-u-boot.dtsi: Add "u-boot, dm-pre-reloc" to timer DT node

In reply to Stefan Roese

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).

---
v3:
- No change

v2:
- No change

 arch/arm/dts/mvebu-u-boot.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm/dts/mvebu-u-boot.dtsi +11 -0
index 5538f95148de..db4bf39920b1 100644
@@ -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;
Signature · 1 line
2.37.3
#17 lore raw

PATCH v3 8/8 kirkwood: lsxl: Sync defconfigs

In reply to Stefan Roese

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.

---
v3:
- New patch

v2:
- New patch

 configs/lschlv2_defconfig | 2 --
 configs/lsxhl_defconfig   | 2 --
 2 files changed, 4 deletions(-)
configs/lschlv2_defconfig +0 -2
index cfccfdcfc407..441cd8ef24ff 100644
@@ -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
configs/lsxhl_defconfig +0 -2
index 1945b72450c2..f350f8ff427a 100644
@@ -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
Signature · 1 line
2.37.3
#18 lore raw
In reply to Stefan Roese

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

Quoted 38 lines · 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(-)
Signature · 1 line
2.37.3
#19 lore raw
In reply to Stefan Roese
Quoted 24 lines · Stefan Roese

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

Quoted 11 lines
  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

#20 lore raw
In reply to Stefan Roese
Quoted 24 lines · Stefan Roese

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

Quoted 11 lines
  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