Skip to contentSkip to conversation

ARM: rmobile: Add dedicated R8A77965 SoC support

PATCH New Marek Vasut 1 participant 5 messages Mar 13, 2019

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

PATCH 1/5 ARM: rmobile: Add dedicated R8A77965 SoC support

Add dedicated entry for R8A77965 M3N SoC.

Cc Nobuhiro Iwamatsu <[email protected]>
---
 arch/arm/mach-rmobile/Kconfig.64 | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach-rmobile/Kconfig.64 +7 -0
index e8f16d798b..f6dfc770bb 100644
@@ -12,6 +12,11 @@ config R8A7796
 	imply CLK_R8A7796
 	imply PINCTRL_PFC_R8A7796
 
+config R8A77965
+	bool "Renesas SoC R8A77965"
+	imply CLK_R8A7796
+	imply PINCTRL_PFC_R8A7796
+
 config R8A77970
 	bool "Renesas SoC R8A77970"
 	imply CLK_R8A77970
@@ -55,6 +60,7 @@ config TARGET_SALVATOR_X
 	bool "Salvator-X board"
 	imply R8A7795
 	imply R8A7796
+	imply R8A77965
 	imply SYS_MALLOC_F
 	imply MULTI_DTB_FIT
 	imply MULTI_DTB_FIT_USER_DEFINED_AREA
@@ -65,6 +71,7 @@ config TARGET_ULCB
 	bool "ULCB board"
 	imply R8A7795
 	imply R8A7796
+	imply R8A77965
 	imply SYS_MALLOC_F
 	imply MULTI_DTB_FIT
 	imply MULTI_DTB_FIT_USER_DEFINED_AREA
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/5 clk: renesas: Add R8A77965 clock tables

Add clock tables for R8A77965 from Linux 5.0 , except for the crit, R and Z clock, which are neither used nor supported by the U-Boot clock framework yet.

Cc Nobuhiro Iwamatsu <[email protected]>
---
 arch/arm/mach-rmobile/Kconfig.64        |   2 +-
 drivers/clk/renesas/Kconfig             |   6 +
 drivers/clk/renesas/Makefile            |   1 +
 drivers/clk/renesas/r8a7796-cpg-mssr.c  |  19 --
 drivers/clk/renesas/r8a77965-cpg-mssr.c | 339 ++++++++++++++++++++++++
 5 files changed, 347 insertions(+), 20 deletions(-)
 create mode 100644 drivers/clk/renesas/r8a77965-cpg-mssr.c
arch/arm/mach-rmobile/Kconfig.64 +1 -1
index f6dfc770bb..50ca6b3de9 100644
@@ -14,7 +14,7 @@ config R8A7796
 
 config R8A77965
 	bool "Renesas SoC R8A77965"
-	imply CLK_R8A7796
+	imply CLK_R8A77965
 	imply PINCTRL_PFC_R8A7796
 
 config R8A77970
drivers/clk/renesas/Kconfig +6 -0
index e062eccdae..3862c1b848 100644
@@ -60,6 +60,12 @@ config CLK_R8A7796
 	help
 	  Enable this to support the clocks on Renesas R8A7796 SoC.
 
+config CLK_R8A77965
+	bool "Renesas R8A77965 clock driver"
+	depends on CLK_RCAR_GEN3
+	help
+	  Enable this to support the clocks on Renesas R8A77965 SoC.
+
 config CLK_R8A77970
 	bool "Renesas R8A77970 clock driver"
 	depends on CLK_RCAR_GEN3
drivers/clk/renesas/Makefile +1 -0
index 22a817a919..26b343994c 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_CLK_R8A7794) += r8a7794-cpg-mssr.o
 obj-$(CONFIG_CLK_RCAR_GEN3) += clk-rcar-gen3.o
 obj-$(CONFIG_CLK_R8A7795) += r8a7795-cpg-mssr.o
 obj-$(CONFIG_CLK_R8A7796) += r8a7796-cpg-mssr.o
+obj-$(CONFIG_CLK_R8A77965) += r8a77965-cpg-mssr.o
 obj-$(CONFIG_CLK_R8A77970) += r8a77970-cpg-mssr.o
 obj-$(CONFIG_CLK_R8A77990) += r8a77990-cpg-mssr.o
 obj-$(CONFIG_CLK_R8A77995) += r8a77995-cpg-mssr.o
drivers/clk/renesas/r8a7796-cpg-mssr.c +0 -19
index 8115c65eb9..190a070f7d 100644
@@ -322,30 +322,11 @@ static const struct cpg_mssr_info r8a7796_cpg_mssr_info = {
 	.get_pll_config		= r8a7796_get_pll_config,
 };
 
-static const struct cpg_mssr_info r8a77965_cpg_mssr_info = {
-	.core_clk		= r8a7796_core_clks,
-	.core_clk_size		= ARRAY_SIZE(r8a7796_core_clks),
-	.mod_clk		= r8a7796_mod_clks,
-	.mod_clk_size		= ARRAY_SIZE(r8a7796_mod_clks),
-	.mstp_table		= r8a7796_mstp_table,
-	.mstp_table_size	= ARRAY_SIZE(r8a7796_mstp_table),
-	.reset_node		= "renesas,r8a77965-rst",
-	.extalr_node		= "extalr",
-	.mod_clk_base		= MOD_CLK_BASE,
-	.clk_extal_id		= CLK_EXTAL,
-	.clk_extalr_id		= CLK_EXTALR,
-	.get_pll_config		= r8a7796_get_pll_config,
-};
-
 static const struct udevice_id r8a7796_clk_ids[] = {
 	{
 		.compatible	= "renesas,r8a7796-cpg-mssr",
 		.data		= (ulong)&r8a7796_cpg_mssr_info,
 	},
-	{
-		.compatible	= "renesas,r8a77965-cpg-mssr",
-		.data		= (ulong)&r8a77965_cpg_mssr_info,
-	},
 	{ }
 };
 
drivers/clk/renesas/r8a77965-cpg-mssr.c new file +339 -0

339 lines not on this page · raw message

Signature · 1 line
2.20.1
#2 lore raw

PATCH 3/5 pinctrl: renesas: Add R8A77965 pin control tables

In reply to Marek Vasut

Add pin control tables for R8A77965 from Linux 5.0 .

Cc Nobuhiro Iwamatsu <[email protected]>
---
 arch/arm/mach-rmobile/Kconfig.64       |    2 +-
 drivers/pinctrl/renesas/Kconfig        |   10 +
 drivers/pinctrl/renesas/Makefile       |    1 +
 drivers/pinctrl/renesas/pfc-r8a77965.c | 5952 ++++++++++++++++++++++++
 drivers/pinctrl/renesas/pfc.c          |   12 +-
 drivers/pinctrl/renesas/sh_pfc.h       |   27 +-
 6 files changed, 5992 insertions(+), 12 deletions(-)
 create mode 100644 drivers/pinctrl/renesas/pfc-r8a77965.c
arch/arm/mach-rmobile/Kconfig.64 +1 -1
index 50ca6b3de9..27d29f797f 100644
@@ -15,7 +15,7 @@ config R8A7796
 config R8A77965
 	bool "Renesas SoC R8A77965"
 	imply CLK_R8A77965
-	imply PINCTRL_PFC_R8A7796
+	imply PINCTRL_PFC_R8A77965
 
 config R8A77970
 	bool "Renesas SoC R8A77970"
drivers/pinctrl/renesas/Kconfig +10 -0
index 0cb577037c..152414ce31 100644
@@ -76,6 +76,16 @@ config PINCTRL_PFC_R8A7796
 	  the GPIO definitions and pin control functions for each available
 	  multiplex function.
 
+config PINCTRL_PFC_R8A77965
+	bool "Renesas RCar Gen3 R8A77965 pin control driver"
+	depends on PINCTRL_PFC
+	help
+	  Support pin multiplexing control on Renesas RCar Gen3 R8A77965 SoCs.
+
+	  The driver is controlled by a device tree node which contains both
+	  the GPIO definitions and pin control functions for each available
+	  multiplex function.
+
 config PINCTRL_PFC_R8A77970
 	bool "Renesas RCar Gen3 R8A77970 pin control driver"
 	depends on PINCTRL_PFC
drivers/pinctrl/renesas/Makefile +1 -0
index 62bc40b8c1..596b0023a3 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_PINCTRL_PFC_R8A7793) += pfc-r8a7791.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7794) += pfc-r8a7794.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7795) += pfc-r8a7795.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7796) += pfc-r8a7796.o
+obj-$(CONFIG_PINCTRL_PFC_R8A77965) += pfc-r8a77965.o
 obj-$(CONFIG_PINCTRL_PFC_R8A77970) += pfc-r8a77970.o
 obj-$(CONFIG_PINCTRL_PFC_R8A77990) += pfc-r8a77990.o
 obj-$(CONFIG_PINCTRL_PFC_R8A77995) += pfc-r8a77995.o
drivers/pinctrl/renesas/pfc-r8a77965.c new file +5952 -0

2,969 lines not on this page · raw message

drivers/pinctrl/renesas/pfc.c +10 -2
index b3a4ff9049..06359501b7 100644

Lines of this file are not shown. View the raw message.

drivers/pinctrl/renesas/sh_pfc.h +18 -9
index b98c2f185d..13d9b99935 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.20.1

Part of the diff is not shown here. View the raw message.

#3 lore raw

PATCH 4/5 ARM: dts: rmobile: Import R8A77965 M3NULCB DTs

In reply to Marek Vasut

Import R8A77965 M3N ULCB device trees from Linux 5.0 , commit 1c163f4c7b3f621efff9b28a47abb36f7378d783 .

Cc Nobuhiro Iwamatsu <[email protected]>
---
 arch/arm/dts/Makefile                    |  1 +
 arch/arm/dts/r8a77965-m3nulcb-u-boot.dts | 43 ++++++++++++++++++++++++
 arch/arm/dts/r8a77965-m3nulcb.dts        | 33 ++++++++++++++++++
 3 files changed, 77 insertions(+)
 create mode 100644 arch/arm/dts/r8a77965-m3nulcb-u-boot.dts
 create mode 100644 arch/arm/dts/r8a77965-m3nulcb.dts
arch/arm/dts/Makefile +1 -0
index 2a040b20a5..069c8d58f5 100644
@@ -495,6 +495,7 @@ dtb-$(CONFIG_RCAR_GEN3) += \
 	r8a7795-salvator-x-u-boot.dtb \
 	r8a7796-m3ulcb-u-boot.dtb \
 	r8a7796-salvator-x-u-boot.dtb \
+	r8a77965-m3nulcb-u-boot.dtb \
 	r8a77965-salvator-x-u-boot.dtb \
 	r8a77970-eagle-u-boot.dtb \
 	r8a77990-ebisu-u-boot.dtb \
arch/arm/dts/r8a77965-m3nulcb-u-boot.dts new file +43 -0

43 lines not on this page · raw message

arch/arm/dts/r8a77965-m3nulcb.dts new file +33 -0
new file mode 100644
index 0000000000..964078b6cc
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for the M3NULCB (R-Car Starter Kit Pro) board
+ *
+ * Copyright (C) 2018 Renesas Electronics Corp.
+ * Copyright (C) 2018 Cogent Embedded, Inc.
+ */
+
+/dts-v1/;
+#include "r8a77965.dtsi"
+#include "ulcb.dtsi"
+
+/ {
+	model = "Renesas M3NULCB board based on r8a77965";
+	compatible = "renesas,m3nulcb", "renesas,r8a77965";
+
+	memory at 48000000 {
+		device_type = "memory";
+		/* first 128MB is reserved for secure area. */
+		reg = <0x0 0x48000000 0x0 0x78000000>;
+	};
+};
+
+&du {
+	clocks = <&cpg CPG_MOD 724>,
+		 <&cpg CPG_MOD 723>,
+		 <&cpg CPG_MOD 721>,
+		 <&versaclock5 1>,
+		 <&versaclock5 3>,
+		 <&versaclock5 2>;
+	clock-names = "du.0", "du.1", "du.3",
+		      "dclkin.0", "dclkin.1", "dclkin.3";
+};
Signature · 1 line
2.20.1
#4 lore raw

PATCH 5/5 ARM: rmobile: Add R8A77965 M3NULCB support

In reply to Marek Vasut

Add defconfig and board specific adjustments for the R8A77965 M3N ULCB.

Cc Nobuhiro Iwamatsu <[email protected]>
---
 board/renesas/ulcb/MAINTAINERS  |  1 +
 board/renesas/ulcb/ulcb.c       |  4 ++
 configs/r8a7795_ulcb_defconfig  |  2 +-
 configs/r8a77965_ulcb_defconfig | 67 +++++++++++++++++++++++++++++++++
 configs/r8a7796_ulcb_defconfig  |  2 +-
 doc/README.rmobile              |  1 +
 6 files changed, 75 insertions(+), 2 deletions(-)
 create mode 100644 configs/r8a77965_ulcb_defconfig
board/renesas/ulcb/MAINTAINERS +1 -0
index e7cdc5217f..8549f543f4 100644
@@ -5,3 +5,4 @@ F:	board/renesas/ulcb/
 F:	include/configs/ulcb.h
 F:	configs/r8a7795_ulcb_defconfig
 F:	configs/r8a7796_ulcb_defconfig
+F:	configs/r8a77965_ulcb_defconfig
board/renesas/ulcb/ulcb.c +4 -0
index 3ed7bfaa88..faf19c3580 100644
@@ -117,6 +117,10 @@ int board_fit_config_name_match(const char *name)
 	    !strcmp(name, "r8a7796-m3ulcb-u-boot"))
 		return 0;
 
+	if ((cpu_type == RMOBILE_CPU_TYPE_R8A77965) &&
+	    !strcmp(name, "r8a77965-m3nulcb-u-boot"))
+		return 0;
+
 	return -1;
 }
 #endif
configs/r8a7795_ulcb_defconfig +1 -1
index 5383e8bc26..8dc0c3fda9 100644
@@ -28,7 +28,7 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="r8a7795-h3ulcb-u-boot"
-CONFIG_OF_LIST="r8a7795-h3ulcb-u-boot r8a7796-m3ulcb-u-boot"
+CONFIG_OF_LIST="r8a7795-h3ulcb-u-boot r8a7796-m3ulcb-u-boot r8a77965-m3nulcb-u-boot"
 CONFIG_MULTI_DTB_FIT_LZO=y
 CONFIG_MULTI_DTB_FIT_USER_DEFINED_AREA=y
 CONFIG_ENV_IS_IN_MMC=y
configs/r8a77965_ulcb_defconfig new file +67 -0

67 lines not on this page · raw message

configs/r8a7796_ulcb_defconfig +1 -1
index 6315fefddf..ab395d5858 100644
@@ -28,7 +28,7 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="r8a7796-m3ulcb-u-boot"
-CONFIG_OF_LIST="r8a7795-h3ulcb-u-boot r8a7796-m3ulcb-u-boot"
+CONFIG_OF_LIST="r8a7795-h3ulcb-u-boot r8a7796-m3ulcb-u-boot r8a77965-m3nulcb-u-boot"
 CONFIG_MULTI_DTB_FIT_LZO=y
 CONFIG_MULTI_DTB_FIT_USER_DEFINED_AREA=y
 CONFIG_ENV_IS_IN_MMC=y
doc/README.rmobile +1 -0
index f1bca54520..ea170a25a6 100644
@@ -32,6 +32,7 @@ Currently the following boards are supported:
 | R8A7796  M3-W | Renesas Electronics ULCB               | r8a7796_ulcb
 |---------------+----------------------------------------+-------------------
 | R8A77965 M3-N | Renesas Electronics Salvator-XS        | r8a77965_salvator-x_defconfig
+| R8A77965 M3-N | Renesas Electronics ULCB               | r8a77965_ulcb
 |---------------+----------------------------------------+-------------------
 | R8A77970 V3M  | Renesas Electronics Eagle              | r8a77970_eagle_defconfig
 |---------------+----------------------------------------+-------------------
Signature · 1 line
2.20.1