[PATCH 11/11] ARM: renesas: Add Renesas R8A779H0 V4M Gray Hawk board code

Marek Vasut marek.vasut+renesas at mailbox.org
Sun Jan 21 18:41:14 CET 2024


From: Hai Pham <hai.pham.ud at renesas.com>

Add board code for the Renesas R8A779H0 V4M Gray Hawk board.

Signed-off-by: Hai Pham <hai.pham.ud at renesas.com>
---
Cc: Paul Barker <paul.barker.ct at bp.renesas.com>
---
 arch/arm/dts/Makefile                      |  3 +-
 arch/arm/dts/r8a779h0-gray-hawk-u-boot.dts | 42 ++++++++++++
 arch/arm/mach-rmobile/Kconfig.rcar4        |  7 ++
 board/renesas/grayhawk/Kconfig             | 15 +++++
 board/renesas/grayhawk/MAINTAINERS         |  7 ++
 board/renesas/grayhawk/Makefile            |  9 +++
 board/renesas/grayhawk/grayhawk.c          | 66 +++++++++++++++++++
 configs/r8a779h0_grayhawk_defconfig        | 75 ++++++++++++++++++++++
 include/configs/grayhawk.h                 | 14 ++++
 9 files changed, 237 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/r8a779h0-gray-hawk-u-boot.dts
 create mode 100644 board/renesas/grayhawk/Kconfig
 create mode 100644 board/renesas/grayhawk/MAINTAINERS
 create mode 100644 board/renesas/grayhawk/Makefile
 create mode 100644 board/renesas/grayhawk/grayhawk.c
 create mode 100644 configs/r8a779h0_grayhawk_defconfig
 create mode 100644 include/configs/grayhawk.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index b5c588c3363..5e26f019436 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1169,7 +1169,8 @@ dtb-$(CONFIG_RCAR_GEN3) += \
 dtb-$(CONFIG_RCAR_GEN4) += \
 	r8a779a0-falcon-u-boot.dtb \
 	r8a779f0-spider-u-boot.dtb \
-	r8a779g0-white-hawk-u-boot.dtb
+	r8a779g0-white-hawk-u-boot.dtb \
+	r8a779h0-gray-hawk-u-boot.dtb
 
 dtb-$(CONFIG_TARGET_RZG2L) += \
 	r9a07g044l2-smarc.dts
diff --git a/arch/arm/dts/r8a779h0-gray-hawk-u-boot.dts b/arch/arm/dts/r8a779h0-gray-hawk-u-boot.dts
new file mode 100644
index 00000000000..935ba9465dc
--- /dev/null
+++ b/arch/arm/dts/r8a779h0-gray-hawk-u-boot.dts
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source extras for U-Boot for the Gray Hawk board
+ *
+ * Copyright (C) 2023 Renesas Electronics Corp.
+ */
+
+#include "r8a779h0-gray-hawk.dts"
+#include "r8a779h0-u-boot.dtsi"
+
+/ {
+	aliases {
+		spi0 = &rpc;
+	};
+};
+
+&pfc {
+	qspi0_pins: qspi0 {
+		groups = "qspi0_ctrl", "qspi0_data4";
+		function = "qspi0";
+	};
+};
+
+&rpc {
+	pinctrl-0 = <&qspi0_pins>;
+	pinctrl-names = "default";
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+	spi-max-frequency = <40000000>;
+	status = "okay";
+
+	flash at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "s25fs512s", "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <40000000>;
+		spi-tx-bus-width = <1>;
+		spi-rx-bus-width = <1>;
+	};
+};
diff --git a/arch/arm/mach-rmobile/Kconfig.rcar4 b/arch/arm/mach-rmobile/Kconfig.rcar4
index 3c8d683974c..e80dce11f54 100644
--- a/arch/arm/mach-rmobile/Kconfig.rcar4
+++ b/arch/arm/mach-rmobile/Kconfig.rcar4
@@ -50,10 +50,17 @@ config TARGET_WHITEHAWK
 	help
 	  Support for Renesas R-Car Gen4 White Hawk platform
 
+config TARGET_GRAYHAWK
+	bool "Gray Hawk board"
+	imply R8A779H0
+	help
+	  Support for Renesas R-Car Gen4 Gray Hawk platform
+
 endchoice
 
 source "board/renesas/falcon/Kconfig"
 source "board/renesas/spider/Kconfig"
 source "board/renesas/whitehawk/Kconfig"
+source "board/renesas/grayhawk/Kconfig"
 
 endif
diff --git a/board/renesas/grayhawk/Kconfig b/board/renesas/grayhawk/Kconfig
new file mode 100644
index 00000000000..97621a30ad0
--- /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 00000000000..b3532141ce7
--- /dev/null
+++ b/board/renesas/grayhawk/MAINTAINERS
@@ -0,0 +1,7 @@
+GRAYHAWK BOARD
+M:	Marek Vasut <marek.vasut+renesas at mailbox.org>
+S:	Maintained
+F:	arch/arm/dts/r8a779h0*
+F:	board/renesas/grayhawk/
+F:	configs/r8a779h0_grayhawk_defconfig
+F:	include/configs/grayhawk.h
diff --git a/board/renesas/grayhawk/Makefile b/board/renesas/grayhawk/Makefile
new file mode 100644
index 00000000000..9c5b8c9a12f
--- /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 00000000000..6f2e73f7d38
--- /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;
+}
diff --git a/configs/r8a779h0_grayhawk_defconfig b/configs/r8a779h0_grayhawk_defconfig
new file mode 100644
index 00000000000..41aa0207086
--- /dev/null
+++ b/configs/r8a779h0_grayhawk_defconfig
@@ -0,0 +1,75 @@
+CONFIG_ARM=y
+CONFIG_ARCH_CPU_INIT=y
+CONFIG_ARCH_RMOBILE=y
+CONFIG_SYS_MALLOC_LEN=0x4000000
+CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0xFFFE0000
+CONFIG_DM_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="r8a779h0-gray-hawk-u-boot"
+CONFIG_RCAR_GEN4=y
+CONFIG_TARGET_GRAYHAWK=y
+CONFIG_SYS_MONITOR_LEN=1048576
+CONFIG_SYS_CLK_FREQ=16666666
+# CONFIG_PSCI_RESET is not set
+CONFIG_SYS_LOAD_ADDR=0x58000000
+CONFIG_SYS_BOOT_GET_CMDLINE=y
+CONFIG_SYS_BARGSIZE=2048
+CONFIG_REMAKE_ELF=y
+CONFIG_FIT=y
+CONFIG_SUPPORT_RAW_INITRD=y
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=192.168.0.1:/export/rfs ip=192.168.0.20"
+CONFIG_USE_BOOTCOMMAND=y
+CONFIG_BOOTCOMMAND="tftp 0x48080000 Image && tftp 0x48000000 Image-r8a779h0-gray-hawk.dtb && booti 0x48080000 - 0x48000000"
+CONFIG_DEFAULT_FDT_FILE="r8a779h0-gray-hawk.dtb"
+CONFIG_SYS_CBSIZE=2048
+CONFIG_SYS_MALLOC_BOOTPARAMS=y
+CONFIG_HUSH_PARSER=y
+CONFIG_SYS_MAXARGS=64
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_SPI=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_OF_CONTROL=y
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_SYS_MMC_ENV_PART=2
+CONFIG_VERSION_VARIABLE=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_CLK=y
+CONFIG_CLK_RENESAS=y
+CONFIG_RCAR_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_RCAR_I2C=y
+CONFIG_MMC_IO_VOLTAGE=y
+CONFIG_MMC_UHS_SUPPORT=y
+CONFIG_MMC_HS200_SUPPORT=y
+CONFIG_RENESAS_SDHI=y
+CONFIG_MTD=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH_SPANSION=y
+# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
+CONFIG_BITBANGMII=y
+CONFIG_BITBANGMII_MULTI=y
+CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ90X1=y
+CONFIG_DM_ETH_PHY=y
+CONFIG_RENESAS_RAVB=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_BAUDRATE=921600
+CONFIG_SCIF_CONSOLE=y
+CONFIG_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_RENESAS_RPC_SPI=y
diff --git a/include/configs/grayhawk.h b/include/configs/grayhawk.h
new file mode 100644
index 00000000000..f1bb84f0a13
--- /dev/null
+++ b/include/configs/grayhawk.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * include/configs/grayhawk.h
+ *     This file is Gray Hawk board configuration.
+ *
+ * Copyright (C) 2023 Renesas Electronics Corp.
+ */
+
+#ifndef __GRAYHAWK_H
+#define __GRAYHAWK_H
+
+#include "rcar-gen4-common.h"
+
+#endif /* __GRAYHAWK_H */
-- 
2.43.0



More information about the U-Boot mailing list