1 // SPDX-License-Identifier: GPL-2.0+
3 * board/renesas/whitehawk/whitehawk.c
4 * This file is White Hawk board support.
6 * Copyright (C) 2021 Renesas Electronics Corp.
10 #include <asm/arch/rmobile.h>
11 #include <asm/arch/sys_proto.h>
12 #include <asm/global_data.h>
14 #include <asm/mach-types.h>
15 #include <asm/processor.h>
16 #include <linux/errno.h>
17 #include <asm/system.h>
19 DECLARE_GLOBAL_DATA_PTR;
21 static void init_generic_timer(void)
23 const u32 freq = CONFIG_SYS_CLK_FREQ;
25 /* Update memory mapped and register based freqency */
26 asm volatile ("msr cntfrq_el0, %0" :: "r" (freq));
27 writel(freq, CNTFID0);
30 setbits_le32(CNTCR_BASE, CNTCR_EN);
33 static void init_gic_v3(void)
36 writel(BIT(1), GICR_LPI_PWRR);
38 /* Wait till the WAKER_CA_BIT changes to 0 */
39 clrbits_le32(GICR_LPI_WAKER, BIT(1));
40 while (readl(GICR_LPI_WAKER) & BIT(2))
43 writel(0xffffffff, GICR_SGI_BASE + GICR_IGROUPR0);
48 if (current_el() == 3)
52 int board_early_init_f(void)
54 /* Unlock CPG access */
55 writel(0x5A5AFFFF, CPGWPR);
56 writel(0xA5A50000, CPGWPCR);
63 if (current_el() == 3)
71 writel(RST_SPRES, RST_SRESCR0);