ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Cody Eksal <masterr3c0rd@epochal.quest>,
	Chris Morgan <macromorgan@hotmail.com>,
	linux-sunxi@lists.linux.dev
Subject: [PATCH 2/3] sunxi: spl: initialise timer before clocks
Date: Sat,  2 Aug 2025 00:49:17 +0100	[thread overview]
Message-ID: <20250801234918.19176-3-andre.przywara@arm.com> (raw)
In-Reply-To: <20250801234918.19176-1-andre.przywara@arm.com>

Recent changes in the H6 clock code added delay() calls into the SPL clock
setup routine, which requires the timers to work. When compiling for
AArch64, we are always using the Arm Generic Timer (aka. arch timer),
which does not require further setup, hence having an empty timer_init()
routine.
However for 32-bit SoCs we use the Allwinner timers, which require some
setup routine, and hence we need timer_init() to be called before
clock_init().

Swap the order of the two calls, to be more robust when compiling the H6
clock code for AArch32 or when using the Allwinner timers for whatever
reason.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/arm/mach-sunxi/board.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index fb4837c2082..432b1c10f92 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -476,8 +476,8 @@ void board_init_f(ulong dummy)
 	/* Enable non-secure access to some peripherals */
 	tzpc_init();
 
-	clock_init();
 	timer_init();
+	clock_init();
 	gpio_init();
 
 	spl_init();
-- 
2.46.3


  parent reply	other threads:[~2025-08-01 23:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-01 23:49 [PATCH 0/3] sunxi: assorted fixes to DRAM and clock init Andre Przywara
2025-08-01 23:49 ` [PATCH 1/3] sunxi: a133: dram: fix data type for address variable Andre Przywara
2025-08-11 15:36   ` Jernej Škrabec
2025-08-01 23:49 ` Andre Przywara [this message]
2025-08-11 15:34   ` [PATCH 2/3] sunxi: spl: initialise timer before clocks Jernej Škrabec
2025-08-11 15:52     ` Andre Przywara
2025-08-11 16:31       ` Jernej Škrabec
2025-08-11 23:01       ` Andre Przywara
2025-08-12  4:14   ` Jernej Škrabec
2025-08-01 23:49 ` [PATCH 3/3] sunxi: H616: dram: fix LPDDR3 mode register settings Andre Przywara
2025-08-11 15:49   ` Jernej Škrabec
2025-08-11 16:08     ` Andre Przywara
2025-08-11 16:28       ` Jernej Škrabec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250801234918.19176-3-andre.przywara@arm.com \
    --to=andre.przywara@arm.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=macromorgan@hotmail.com \
    --cc=masterr3c0rd@epochal.quest \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox