diff options
author | Hai Pham <hai.pham.ud@renesas.com> | 2024-01-28 16:52:09 +0100 |
---|---|---|
committer | Marek Vasut <marek.vasut+renesas@mailbox.org> | 2024-02-10 17:08:06 +0100 |
commit | 53066deccbedf02439309b0d4aca9f0be853a8da (patch) | |
tree | 8dbe8be7a1cea273e5bb822ff338508951fb34ff /board | |
parent | 9e9a92e4a316f6604127ec3a8ee02db78e98e165 (diff) | |
download | u-boot-53066deccbedf02439309b0d4aca9f0be853a8da.zip u-boot-53066deccbedf02439309b0d4aca9f0be853a8da.tar.gz u-boot-53066deccbedf02439309b0d4aca9f0be853a8da.tar.bz2 |
ARM: renesas: Add Renesas R8A779H0 V4M Gray Hawk board code
Add board code for the Renesas R8A779H0 V4M Gray Hawk board.
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/renesas/grayhawk/Kconfig | 15 | ||||
-rw-r--r-- | board/renesas/grayhawk/MAINTAINERS | 5 | ||||
-rw-r--r-- | board/renesas/grayhawk/Makefile | 9 | ||||
-rw-r--r-- | board/renesas/grayhawk/grayhawk.c | 66 |
4 files changed, 95 insertions, 0 deletions
diff --git a/board/renesas/grayhawk/Kconfig b/board/renesas/grayhawk/Kconfig new file mode 100644 index 0000000..97621a3 --- /dev/null +++ b/board/renesas/grayhawk/Kconfig @@ -0,0 +1,15 @@ +if TARGET_GRAYHAWK + +config SYS_SOC + default "rmobile" + +config SYS_BOARD + default "grayhawk" + +config SYS_VENDOR + default "renesas" + +config SYS_CONFIG_NAME + default "grayhawk" + +endif diff --git a/board/renesas/grayhawk/MAINTAINERS b/board/renesas/grayhawk/MAINTAINERS new file mode 100644 index 0000000..1d5de58 --- /dev/null +++ b/board/renesas/grayhawk/MAINTAINERS @@ -0,0 +1,5 @@ +GRAYHAWK BOARD +M: Marek Vasut <marek.vasut+renesas@mailbox.org> +S: Maintained +N: grayhawk +N: r8a779h0 diff --git a/board/renesas/grayhawk/Makefile b/board/renesas/grayhawk/Makefile new file mode 100644 index 0000000..9c5b8c9 --- /dev/null +++ b/board/renesas/grayhawk/Makefile @@ -0,0 +1,9 @@ +# +# board/renesas/grayhawk/Makefile +# +# Copyright (C) 2023 Renesas Electronics Corp. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := grayhawk.o ../rcar-common/common.o diff --git a/board/renesas/grayhawk/grayhawk.c b/board/renesas/grayhawk/grayhawk.c new file mode 100644 index 0000000..6f2e73f --- /dev/null +++ b/board/renesas/grayhawk/grayhawk.c @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * board/renesas/grayhawk/grayhawk.c + * This file is Gray Hawk board support. + * + * Copyright (C) 2023 Renesas Electronics Corp. + */ + +#include <asm/arch/rmobile.h> +#include <asm/arch/sys_proto.h> +#include <asm/global_data.h> +#include <asm/io.h> +#include <asm/mach-types.h> +#include <asm/processor.h> +#include <linux/errno.h> +#include <asm/system.h> + +DECLARE_GLOBAL_DATA_PTR; + +static void init_generic_timer(void) +{ + const u32 freq = CONFIG_SYS_CLK_FREQ; + + /* Update memory mapped and register based freqency */ + asm volatile ("msr cntfrq_el0, %0" :: "r" (freq)); + writel(freq, CNTFID0); + + /* Enable counter */ + setbits_le32(CNTCR_BASE, CNTCR_EN); +} + +static void init_gic_v3(void) +{ + /* GIC v3 power on */ + writel(BIT(1), GICR_LPI_PWRR); + + /* Wait till the WAKER_CA_BIT changes to 0 */ + clrbits_le32(GICR_LPI_WAKER, BIT(1)); + while (readl(GICR_LPI_WAKER) & BIT(2)) + ; + + writel(0xffffffff, GICR_SGI_BASE + GICR_IGROUPR0); +} + +void s_init(void) +{ + if (current_el() == 3) + init_generic_timer(); +} + +int board_early_init_f(void) +{ + /* Unlock CPG access */ + writel(0x5A5AFFFF, CPGWPR); + writel(0xA5A50000, CPGWPCR); + + return 0; +} + +int board_init(void) +{ + if (current_el() == 3) + init_gic_v3(); + + return 0; +} |