Skip to contentSkip to conversation

ARM: at91: common: guard ATMEL_PIT code by ifdef

PATCH New Eugen Hristev 1 participant 2 messages Aug 20, 2020 – Sep 8, 2020

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

PATCH 1/1 ARM: at91: common: guard ATMEL_PIT code by ifdef

Atmel PIT timer is not available for next products that have another timer hardware block.
To be able to use the common at91 code, guard the code that uses PIT by ifdefs.

---
 arch/arm/mach-at91/armv7/cpu.c | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-at91/armv7/cpu.c +2 -0
index a8f4356ce9..8b7355042b 100644
@@ -29,6 +29,7 @@ int arch_cpu_init(void)
 
 void arch_preboot_os(void)
 {
+#if (IS_ENABLED(CONFIG_ATMEL_PIT_TIMER))
 	ulong cpiv;
 	at91_pit_t *pit = (at91_pit_t *)ATMEL_BASE_PIT;
 
@@ -40,6 +41,7 @@ void arch_preboot_os(void)
 	 * without waiting for wrapping back to 0
 	 */
 	writel(cpiv + 0x1000, &pit->mr);
+#endif
 }
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 ARM: at91: common: guard ATMEL_PIT code by ifdef

Quoted 7 lines · Eugen Hristev

Atmel PIT timer is not available for next products that have another timer hardware block.
To be able to use the common at91 code, guard the code that uses PIT by ifdefs.

---

Applied to u-boot-atmel/next