Skip to contentSkip to conversation

ARM: shmobile: r8a7790 Lager arch timer fixes

PATCH New Magnus Damm 4 participants 10 messages Apr 8, 2013 – Apr 9, 2013

Subsystems (4)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

cover ARM: shmobile: r8a7790 Lager arch timer fixes

ARM: shmobile: r8a7790 Lager arch timer fixes

[PATCH 01/02] ARM: shmobile: force enable of r8a7790 arch timer [PATCH 02/02] ARM: shmobile: use r8a7790 timer setup code on Lager

This mini-series contains fixes to start the arch timer on r8a7790 and the Lager board regardless of boot loader setting.

---

Written against renesas-next-20130405v2 in renesas.git

 arch/arm/mach-shmobile/board-lager.c          |    2 +-
 arch/arm/mach-shmobile/include/mach/r8a7790.h |    1 +
 arch/arm/mach-shmobile/setup-r8a7790.c        |   14 +++++++++++++-
 3 files changed, 15 insertions(+), 2 deletions(-)
author maintainer
#1 lore raw

PATCH 1/2 ARM: shmobile: force enable of r8a7790 arch timer

From: Magnus Damm <[email protected]>

Implement a SoC-specific timer init function for
r8a7790 that makes sure the architected timer
is started regardless of boot loader setting.

---

 arch/arm/mach-shmobile/include/mach/r8a7790.h |    1 +
 arch/arm/mach-shmobile/setup-r8a7790.c        |   14 +++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/include/mach/r8a7790.h +1 -0
@@ -4,5 +4,6 @@
 void r8a7790_add_standard_devices(void);
 void r8a7790_clock_init(void);
 void r8a7790_pinmux_init(void);
+void r8a7790_timer_init(void);
 
 #endif /* __ASM_R8A7790_H__ */
arch/arm/mach-shmobile/setup-r8a7790.c +13 -1
@@ -117,6 +117,18 @@ void __init r8a7790_add_standard_devices
 	r8a7790_register_irqc(0);
 }
 
+void __init r8a7790_timer_init(void)
+{
+	void __iomem *cntcr;
+
+	/* make sure arch timer is started by setting bit 0 of CNTCT */
+	cntcr = ioremap(0xe6080000, PAGE_SIZE);
+	iowrite32(1, cntcr);
+	iounmap(cntcr);
+
+	shmobile_timer_init();
+}
+
 #ifdef CONFIG_USE_OF
 void __init r8a7790_add_standard_devices_dt(void)
 {
@@ -131,7 +143,7 @@ static const char *r8a7790_boards_compat
 DT_MACHINE_START(R8A7790_DT, "Generic R8A7790 (Flattened Device Tree)")
 	.init_irq	= irqchip_init,
 	.init_machine	= r8a7790_add_standard_devices_dt,
-	.init_time	= shmobile_timer_init,
+	.init_time	= r8a7790_timer_init,
 	.dt_compat	= r8a7790_boards_compat_dt,
 MACHINE_END
 #endif /* CONFIG_USE_OF */
author maintainer
#3 lore raw

PATCH 2/2 ARM: shmobile: use r8a7790 timer setup code on Lager

In reply to Magnus Damm

From: Magnus Damm <[email protected]>

Use the r8a7790 timer init function on Lager
to make sure the architected timer is started
regardless of boot loader setting.

---

 arch/arm/mach-shmobile/board-lager.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-shmobile/board-lager.c +1 -1
@@ -40,7 +40,7 @@ static const char *lager_boards_compat_d
 
 DT_MACHINE_START(LAGER_DT, "lager")
 	.init_irq	= irqchip_init,
-	.init_time	= shmobile_timer_init,
+	.init_time	= r8a7790_timer_init,
 	.init_machine	= lager_add_standard_devices,
 	.dt_compat	= lager_boards_compat_dt,
 MACHINE_END
#4 lore raw

cover ARM: shmobile: r8a7790 Lager arch timer fixes

In reply to Magnus Damm

Hi

Quoted 10 lines

ARM: shmobile: r8a7790 Lager arch timer fixes

[PATCH 01/02] ARM: shmobile: force enable of r8a7790 arch timer [PATCH 02/02] ARM: shmobile: use r8a7790 timer setup code on Lager

This mini-series contains fixes to start the arch timer on r8a7790 and the Lager board regardless of boot loader setting.

---

I guess shmobile_timer_init() will be conflict (or compile error) on next (?) merge window thought...
but, for current code/branch

Best regards
---
Kuninori Morimoto

#9 lore raw

cover ARM: shmobile: r8a7790 Lager arch timer fixes

In reply to Magnus Damm
Quoted 5 lines · Magnus Damm

ARM: shmobile: r8a7790 Lager arch timer fixes

[PATCH 01/02] ARM: shmobile: force enable of r8a7790 arch timer [PATCH 02/02] ARM: shmobile: use r8a7790 timer setup code on Lager

Quoted 7 lines

This mini-series contains fixes to start the arch timer on r8a7790 and the Lager board regardless of boot loader setting.

---

Written against renesas-next-20130405v2 in renesas.git

Hi Magnus,

I have tested that these patches allow the lager board to boot. Should I queue them up?

#5 lore raw

cover ARM: shmobile: r8a7790 Lager arch timer fixes

In reply to Kuninori Morimoto
Quoted 11 lines · Kuninori Morimoto

Hi

Quoted 8 lines

ARM: shmobile: r8a7790 Lager arch timer fixes

[PATCH 01/02] ARM: shmobile: force enable of r8a7790 arch timer [PATCH 02/02] ARM: shmobile: use r8a7790 timer setup code on Lager

This mini-series contains fixes to start the arch timer on r8a7790 and the Lager board regardless of boot loader setting.

Quoted 6 lines
Quoted 2 lines

---

I guess shmobile_timer_init() will be conflict (or compile error) on next (?) merge window thought...
but, for current code/branch

I guess that the solution is to ensure that patch 1 is applied before patch 2. Am I missing something?

Quoted 1 line
#6 lore raw

cover ARM: shmobile: r8a7790 Lager arch timer fixes

Hi Simon

Quoted 6 lines
Quoted 3 lines

I guess shmobile_timer_init() will be conflict (or compile error) on next (?) merge window thought...
but, for current code/branch

I guess that the solution is to ensure that patch 1 is applied before patch 2. Am I missing something?

Sorry for my confusion
I meant shmobile_timer_init() will be removed from ARM SoC side. But I'm not sure for detail

Best regards
---
Kuninori Morimoto

#7 lore raw

cover ARM: shmobile: r8a7790 Lager arch timer fixes

Quoted 7 lines · Kuninori Morimoto

Hi Simon

Quoted 4 lines
Quoted 3 lines

I guess shmobile_timer_init() will be conflict (or compile error) on next (?) merge window thought...
but, for current code/branch

Quoted 6 lines
Quoted 2 lines

I guess that the solution is to ensure that patch 1 is applied before patch 2. Am I missing something?

Sorry for my confusion
I meant shmobile_timer_init() will be removed from ARM SoC side. But I'm not sure for detail

Ah yes.

That already causes multiple breakages in renesas-next. I have responded to the thread on removing shmobile_timer_init() accordingly.

#2 lore raw

PATCH 1/2 ARM: shmobile: force enable of r8a7790 arch timer

In reply to Magnus Damm

Adding Stephen Boyd and Marc Zyngier to Cc as they're both familiar with the architected timer.

Quoted 25 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Implement a SoC-specific timer init function for
r8a7790 that makes sure the architected timer
is started regardless of boot loader setting.

---

 arch/arm/mach-shmobile/include/mach/r8a7790.h |    1 +
 arch/arm/mach-shmobile/setup-r8a7790.c        |   14 +++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/include/mach/r8a7790.h +1 -0
@@ -4,5 +4,6 @@
 void r8a7790_add_standard_devices(void);
 void r8a7790_clock_init(void);
 void r8a7790_pinmux_init(void);
+void r8a7790_timer_init(void);
 
 #endif /* __ASM_R8A7790_H__ */

arch/arm/mach-shmobile/setup-r8a7790.c void __init r8a7790_add_standard_devices · line 124

Quoted 8 lines
arch/arm/mach-shmobile/setup-r8a7790.c +5 -0
@@ -117,6 +117,18 @@ void __init r8a7790_add_standard_devices
 	r8a7790_register_irqc(0);
 }
 
+void __init r8a7790_timer_init(void)
+{
+	void __iomem *cntcr;
+
+	/* make sure arch timer is started by setting bit 0 of CNTCT */

Typo: CNTCT should be CNTCR above.

arch/arm/mach-shmobile/setup-r8a7790.c void __init r8a7790_add_standard_devices · line 130

Quoted 6 lines
arch/arm/mach-shmobile/setup-r8a7790.c +6 -0
+	cntcr = ioremap(0xe6080000, PAGE_SIZE);
+	iowrite32(1, cntcr);
+	iounmap(cntcr);
+
+	shmobile_timer_init();
+}

Does this mean you have memory-mapped timers and CP15 timers linked together?

Why do your firmware and bootloader not set this up?

Mark.

#8 lore raw

cover ARM: shmobile: r8a7790 Lager arch timer fixes

In reply to Kuninori Morimoto
Quoted 11 lines · Kuninori Morimoto

Hi

Quoted 8 lines

ARM: shmobile: r8a7790 Lager arch timer fixes

[PATCH 01/02] ARM: shmobile: force enable of r8a7790 arch timer [PATCH 02/02] ARM: shmobile: use r8a7790 timer setup code on Lager

This mini-series contains fixes to start the arch timer on r8a7790 and the Lager board regardless of boot loader setting.

Quoted 6 lines
Quoted 2 lines

---

I guess shmobile_timer_init() will be conflict (or compile error) on next (?) merge window thought...
but, for current code/branch

[ discussed in another sub-thread ]

Quoted 1 line

Thanks.

01/02 queued up in the soc-r8a7790 branch
02/02 queue up in the boards-lager branch,
which is a merge of renesas-boards3-for-v3.10 and soc-r8a7790