Skip to contentSkip to conversation

arm: socfpga: Add the terasic de10-standard board

PATCH Superseded Humberto Naves 2 participants 7 messages May 22, 2022 – May 25, 2022

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

PATCH 1/1 arm: socfpga: Add the terasic de10-standard board

Used the de10-nano files as templates for the de10-standard board. Changed the iocsr_config.h and pinmux_config.h based on the handoff files generated by quartus. Finally, the pll_config.h was copied from the altera cyclone5-socdk board.

---
 .../dts/socfpga_cyclone5_de10_standard.dts    |  86 +++
 arch/arm/mach-socfpga/Kconfig                 |   7 +
 board/terasic/de10-standard/MAINTAINERS       |   5 +
 board/terasic/de10-standard/Makefile          |   6 +
 .../terasic/de10-standard/qts/iocsr_config.h  | 659 ++++++++++++++++++
 .../terasic/de10-standard/qts/pinmux_config.h | 218 ++++++
 board/terasic/de10-standard/qts/pll_config.h  |  84 +++
 .../terasic/de10-standard/qts/sdram_config.h  | 343 +++++++++
 board/terasic/de10-standard/socfpga.c         |   5 +
 configs/socfpga_de10_standard_defconfig       |  66 ++
 include/configs/socfpga_de10_standard.h       |  16 +
 11 files changed, 1495 insertions(+)
 create mode 100644 arch/arm/dts/socfpga_cyclone5_de10_standard.dts
 create mode 100644 board/terasic/de10-standard/MAINTAINERS
 create mode 100644 board/terasic/de10-standard/Makefile
 create mode 100644 board/terasic/de10-standard/qts/iocsr_config.h
 create mode 100644 board/terasic/de10-standard/qts/pinmux_config.h
 create mode 100644 board/terasic/de10-standard/qts/pll_config.h
 create mode 100644 board/terasic/de10-standard/qts/sdram_config.h
 create mode 100644 board/terasic/de10-standard/socfpga.c
 create mode 100644 configs/socfpga_de10_standard_defconfig
 create mode 100644 include/configs/socfpga_de10_standard.h
arch/arm/dts/socfpga_cyclone5_de10_standard.dts new file +86 -0
new file mode 100644
index 0000000000..ccd1413184
@@ -0,0 +1,86 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2017, Intel Corporation
+ *
+ * based on socfpga_cyclone5_de10_nano.dts
+ */
+
+#include "socfpga_cyclone5.dtsi"
+#include "socfpga-common-u-boot.dtsi"
+
+/ {
+	model = "Terasic DE10-Standard";
+	compatible = "altr,socfpga-cyclone5", "altr,socfpga";
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+		stdout-path = "serial0:115200n8";
+	};
+
+	aliases {
+		ethernet0 = &gmac1;
+		udc0 = &usb1;
+	};
+
+	memory {
+		name = "memory";
+		device_type = "memory";
+		reg = <0x0 0x40000000>; /* 1GB */
+	};
+};
+
+&gmac1 {
+	status = "okay";
+	phy-mode = "rgmii";
+
+	rxd0-skew-ps = <420>;
+	rxd1-skew-ps = <420>;
+	rxd2-skew-ps = <420>;
+	rxd3-skew-ps = <420>;
+	txen-skew-ps = <0>;
+	txc-skew-ps = <1860>;
+	rxdv-skew-ps = <420>;
+	rxc-skew-ps = <1680>;
+};
+
+&gpio0 {
+	status = "okay";
+};
+
+&gpio1 {
+	status = "okay";
+};
+
+&gpio2 {
+	status = "okay";
+};
+
+&porta {
+	bank-name = "porta";
+};
+
+&portb {
+	bank-name = "portb";
+};
+
+&portc {
+	bank-name = "portc";
+};
+
+&mmc0 {
+	status = "okay";
+	u-boot,dm-pre-reloc;
+};
+
+&usb1 {
+	status = "okay";
+};
+
+&uart0 {
+	clock-frequency = <100000000>;
+	u-boot,dm-pre-reloc;
+};
+
+&watchdog0 {
+	status = "disabled";
+};
arch/arm/mach-socfpga/Kconfig +7 -0
index 78a7549a41..547e47ed9d 100644
@@ -180,6 +180,10 @@ config TARGET_SOCFPGA_TERASIC_DE10_NANO
 	bool "Terasic DE10-Nano (Cyclone V)"
 	select TARGET_SOCFPGA_CYCLONE5
 
+config TARGET_SOCFPGA_TERASIC_DE10_STANDARD
+	bool "Terasic DE10-Standard (Cyclone V)"
+	select TARGET_SOCFPGA_CYCLONE5
+
 config TARGET_SOCFPGA_TERASIC_DE1_SOC
 	bool "Terasic DE1-SoC (Cyclone V)"
 	select TARGET_SOCFPGA_CYCLONE5
@@ -199,6 +203,7 @@ config SYS_BOARD
 	default "de0-nano-soc" if TARGET_SOCFPGA_TERASIC_DE0_NANO
 	default "de1-soc" if TARGET_SOCFPGA_TERASIC_DE1_SOC
 	default "de10-nano" if TARGET_SOCFPGA_TERASIC_DE10_NANO
+	default "de10-standard" if TARGET_SOCFPGA_TERASIC_DE10_STANDARD
 	default "is1" if TARGET_SOCFPGA_IS1
 	default "mcvevk" if TARGET_SOCFPGA_ARIES_MCVEVK
 	default "n5x-socdk" if TARGET_SOCFPGA_N5X_SOCDK
@@ -224,6 +229,7 @@ config SYS_VENDOR
 	default "terasic" if TARGET_SOCFPGA_TERASIC_DE0_NANO
 	default "terasic" if TARGET_SOCFPGA_TERASIC_DE1_SOC
 	default "terasic" if TARGET_SOCFPGA_TERASIC_DE10_NANO
+	default "terasic" if TARGET_SOCFPGA_TERASIC_DE10_STANDARD
 	default "terasic" if TARGET_SOCFPGA_TERASIC_SOCKIT
 
 config SYS_SOC
@@ -239,6 +245,7 @@ config SYS_CONFIG_NAME
 	default "socfpga_de0_nano_soc" if TARGET_SOCFPGA_TERASIC_DE0_NANO
 	default "socfpga_de1_soc" if TARGET_SOCFPGA_TERASIC_DE1_SOC
 	default "socfpga_de10_nano" if TARGET_SOCFPGA_TERASIC_DE10_NANO
+	default "socfpga_de10_standard" if TARGET_SOCFPGA_TERASIC_DE10_STANDARD
 	default "socfpga_is1" if TARGET_SOCFPGA_IS1
 	default "socfpga_mcvevk" if TARGET_SOCFPGA_ARIES_MCVEVK
 	default "socfpga_n5x_socdk" if TARGET_SOCFPGA_N5X_SOCDK
board/terasic/de10-standard/MAINTAINERS new file +5 -0
new file mode 100644
index 0000000000..94bf1e03ee
@@ -0,0 +1,5 @@
+DE10-STANDARD BOARD
+M:	Humberto Naves <[email protected]>
+S:	Maintained
+F:	include/configs/socfpga_de10_standard.h
+F:	configs/socfpga_de10_standard_defconfig
board/terasic/de10-standard/Makefile new file +6 -0
new file mode 100644
index 0000000000..2cf9240846
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright (C) 2017, Intel Corporation
+#
+#
+
+obj-y	:= socfpga.o
board/terasic/de10-standard/qts/iocsr_config.h new file +659 -0

659 lines not on this page · raw message

board/terasic/de10-standard/qts/pinmux_config.h new file +218 -0

218 lines not on this page · raw message

board/terasic/de10-standard/qts/pll_config.h new file +84 -0

84 lines not on this page · raw message

board/terasic/de10-standard/qts/sdram_config.h new file +343 -0

343 lines not on this page · raw message

board/terasic/de10-standard/socfpga.c new file +5 -0
new file mode 100644
index 0000000000..f9173f1921
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2017, Intel Corporation
+ */
+#include <common.h>
configs/socfpga_de10_standard_defconfig new file +66 -0

66 lines not on this page · raw message

include/configs/socfpga_de10_standard.h new file +16 -0
new file mode 100644
index 0000000000..4d6719eb52
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2017, Intel Corporation
+ */
+#ifndef __CONFIG_TERASIC_DE10_STANDARD_H__
+#define __CONFIG_TERASIC_DE10_STANDARD_H__
+
+#include <asm/arch/base_addr_ac5.h>
+
+/* Memory configurations */
+#define PHYS_SDRAM_1_SIZE		0x40000000	/* 1GiB */
+
+/* The rest of the configuration is shared */
+#include <configs/socfpga_common.h>
+
+#endif	/* __CONFIG_TERASIC_DE10_STANDARD_H__ */
Signature · 1 line
2.36.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Humberto Naves

Used the de10-nano files as templates for the de10-standard board. Changed the iocsr_config.h and pinmux_config.h based on the handoff files generated by quartus. Finally, the pll_config.h was copied from the altera cyclone5-socdk board.

Doesn't the PLL config also come from quartus ? It should all come from it. See doc/README.socfpga

Quoted 2 lines

I think a lot of those board/config-specific copyright messages could use an update, I think they should be assigned to you. Please do a quick V2 with that change. Besides that:

#2 lore raw

Hi Marek,

Thanks for the quick review!

Quoted 2 lines

Doesn't the PLL config also come from quartus ? It should all come from it. See doc/README.socfpga

My mistake, I will update the patch using all the files created by the bsp-create-settings.

Quoted 3 lines

I think a lot of those board/config-specific copyright messages could use an update, I think they should be assigned to you. Please do a quick V2 with that change. Besides that:

Please advise what I should do there. For this particular board I adapted the code from the de10-nano board, which already had these copyright messages.

Best regards,

Quoted 18 lines · Marek Vasut
Quoted 4 lines · Humberto Naves

Used the de10-nano files as templates for the de10-standard board. Changed the iocsr_config.h and pinmux_config.h based on the handoff files generated by quartus. Finally, the pll_config.h was copied from the altera cyclone5-socdk board.

Doesn't the PLL config also come from quartus ? It should all come from it. See doc/README.socfpga

Quoted 2 lines

I think a lot of those board/config-specific copyright messages could use an update, I think they should be assigned to you. Please do a quick V2 with that change. Besides that:

#3 lore raw
Quoted 1 line · Humberto Naves

Hi Marek,

Hi,

Quoted 7 lines

Thanks for the quick review!

Quoted 2 lines

Doesn't the PLL config also come from quartus ? It should all come from it. See doc/README.socfpga

My mistake, I will update the patch using all the files created by the bsp-create-settings.

Thanks

Quoted 7 lines
Quoted 3 lines

I think a lot of those board/config-specific copyright messages could use an update, I think they should be assigned to you. Please do a quick V2 with that change. Besides that:

Please advise what I should do there. For this particular board I adapted the code from the de10-nano board, which already had these copyright messages.

I'm not a lawyer. Maybe the most safe approach is to keep the original copyright and add your own in addition to it ?

#4 lore raw

PATCH v2 1/1 arm: socfpga: Add the terasic de10-standard board

Use the de10-nano files as templates for the de10-standard board. The files in qts directory are generated by quartus from the GHRD design.

---
Changes for v2:
- Also use generated sdram_config.h from bsp-create-settings
- Update the copyright messages (for substantial changes)

---
 .../dts/socfpga_cyclone5_de10_standard.dts    |  86 +++
 arch/arm/mach-socfpga/Kconfig                 |   7 +
 board/terasic/de10-standard/MAINTAINERS       |   5 +
 board/terasic/de10-standard/Makefile          |   6 +
 .../terasic/de10-standard/qts/iocsr_config.h  | 659 ++++++++++++++++++
 .../terasic/de10-standard/qts/pinmux_config.h | 218 ++++++
 board/terasic/de10-standard/qts/pll_config.h  |  84 +++
 .../terasic/de10-standard/qts/sdram_config.h  | 344 +++++++++
 board/terasic/de10-standard/socfpga.c         |   5 +
 configs/socfpga_de10_standard_defconfig       |  66 ++
 include/configs/socfpga_de10_standard.h       |  18 +
 11 files changed, 1498 insertions(+)
 create mode 100644 arch/arm/dts/socfpga_cyclone5_de10_standard.dts
 create mode 100644 board/terasic/de10-standard/MAINTAINERS
 create mode 100644 board/terasic/de10-standard/Makefile
 create mode 100644 board/terasic/de10-standard/qts/iocsr_config.h
 create mode 100644 board/terasic/de10-standard/qts/pinmux_config.h
 create mode 100644 board/terasic/de10-standard/qts/pll_config.h
 create mode 100644 board/terasic/de10-standard/qts/sdram_config.h
 create mode 100644 board/terasic/de10-standard/socfpga.c
 create mode 100644 configs/socfpga_de10_standard_defconfig
 create mode 100644 include/configs/socfpga_de10_standard.h
arch/arm/dts/socfpga_cyclone5_de10_standard.dts new file +86 -0
new file mode 100644
index 0000000000..39bce3b2ac
@@ -0,0 +1,86 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2017, Intel Corporation
+ *
+ * Adapted from socfpga_cyclone5_de10_nano.dts
+ */
+
+#include "socfpga_cyclone5.dtsi"
+#include "socfpga-common-u-boot.dtsi"
+
+/ {
+	model = "Terasic DE10-Standard";
+	compatible = "altr,socfpga-cyclone5", "altr,socfpga";
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+		stdout-path = "serial0:115200n8";
+	};
+
+	aliases {
+		ethernet0 = &gmac1;
+		udc0 = &usb1;
+	};
+
+	memory {
+		name = "memory";
+		device_type = "memory";
+		reg = <0x0 0x40000000>; /* 1GB */
+	};
+};
+
+&gmac1 {
+	status = "okay";
+	phy-mode = "rgmii";
+
+	rxd0-skew-ps = <420>;
+	rxd1-skew-ps = <420>;
+	rxd2-skew-ps = <420>;
+	rxd3-skew-ps = <420>;
+	txen-skew-ps = <0>;
+	txc-skew-ps = <1860>;
+	rxdv-skew-ps = <420>;
+	rxc-skew-ps = <1680>;
+};
+
+&gpio0 {
+	status = "okay";
+};
+
+&gpio1 {
+	status = "okay";
+};
+
+&gpio2 {
+	status = "okay";
+};
+
+&porta {
+	bank-name = "porta";
+};
+
+&portb {
+	bank-name = "portb";
+};
+
+&portc {
+	bank-name = "portc";
+};
+
+&mmc0 {
+	status = "okay";
+	u-boot,dm-pre-reloc;
+};
+
+&usb1 {
+	status = "okay";
+};
+
+&uart0 {
+	clock-frequency = <100000000>;
+	u-boot,dm-pre-reloc;
+};
+
+&watchdog0 {
+	status = "disabled";
+};
arch/arm/mach-socfpga/Kconfig +7 -0
index 78a7549a41..547e47ed9d 100644
@@ -180,6 +180,10 @@ config TARGET_SOCFPGA_TERASIC_DE10_NANO
 	bool "Terasic DE10-Nano (Cyclone V)"
 	select TARGET_SOCFPGA_CYCLONE5
 
+config TARGET_SOCFPGA_TERASIC_DE10_STANDARD
+	bool "Terasic DE10-Standard (Cyclone V)"
+	select TARGET_SOCFPGA_CYCLONE5
+
 config TARGET_SOCFPGA_TERASIC_DE1_SOC
 	bool "Terasic DE1-SoC (Cyclone V)"
 	select TARGET_SOCFPGA_CYCLONE5
@@ -199,6 +203,7 @@ config SYS_BOARD
 	default "de0-nano-soc" if TARGET_SOCFPGA_TERASIC_DE0_NANO
 	default "de1-soc" if TARGET_SOCFPGA_TERASIC_DE1_SOC
 	default "de10-nano" if TARGET_SOCFPGA_TERASIC_DE10_NANO
+	default "de10-standard" if TARGET_SOCFPGA_TERASIC_DE10_STANDARD
 	default "is1" if TARGET_SOCFPGA_IS1
 	default "mcvevk" if TARGET_SOCFPGA_ARIES_MCVEVK
 	default "n5x-socdk" if TARGET_SOCFPGA_N5X_SOCDK
@@ -224,6 +229,7 @@ config SYS_VENDOR
 	default "terasic" if TARGET_SOCFPGA_TERASIC_DE0_NANO
 	default "terasic" if TARGET_SOCFPGA_TERASIC_DE1_SOC
 	default "terasic" if TARGET_SOCFPGA_TERASIC_DE10_NANO
+	default "terasic" if TARGET_SOCFPGA_TERASIC_DE10_STANDARD
 	default "terasic" if TARGET_SOCFPGA_TERASIC_SOCKIT
 
 config SYS_SOC
@@ -239,6 +245,7 @@ config SYS_CONFIG_NAME
 	default "socfpga_de0_nano_soc" if TARGET_SOCFPGA_TERASIC_DE0_NANO
 	default "socfpga_de1_soc" if TARGET_SOCFPGA_TERASIC_DE1_SOC
 	default "socfpga_de10_nano" if TARGET_SOCFPGA_TERASIC_DE10_NANO
+	default "socfpga_de10_standard" if TARGET_SOCFPGA_TERASIC_DE10_STANDARD
 	default "socfpga_is1" if TARGET_SOCFPGA_IS1
 	default "socfpga_mcvevk" if TARGET_SOCFPGA_ARIES_MCVEVK
 	default "socfpga_n5x_socdk" if TARGET_SOCFPGA_N5X_SOCDK
board/terasic/de10-standard/MAINTAINERS new file +5 -0
new file mode 100644
index 0000000000..94bf1e03ee
@@ -0,0 +1,5 @@
+DE10-STANDARD BOARD
+M:	Humberto Naves <[email protected]>
+S:	Maintained
+F:	include/configs/socfpga_de10_standard.h
+F:	configs/socfpga_de10_standard_defconfig
board/terasic/de10-standard/Makefile new file +6 -0
new file mode 100644
index 0000000000..2cf9240846
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright (C) 2017, Intel Corporation
+#
+#
+
+obj-y	:= socfpga.o
board/terasic/de10-standard/qts/iocsr_config.h new file +659 -0

659 lines not on this page · raw message

board/terasic/de10-standard/qts/pinmux_config.h new file +218 -0

218 lines not on this page · raw message

board/terasic/de10-standard/qts/pll_config.h new file +84 -0

84 lines not on this page · raw message

board/terasic/de10-standard/qts/sdram_config.h new file +344 -0

344 lines not on this page · raw message

board/terasic/de10-standard/socfpga.c new file +5 -0
new file mode 100644
index 0000000000..f9173f1921
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2017, Intel Corporation
+ */
+#include <common.h>
configs/socfpga_de10_standard_defconfig new file +66 -0

66 lines not on this page · raw message

include/configs/socfpga_de10_standard.h new file +18 -0
new file mode 100644
index 0000000000..b68b6e99dc
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2022, Humberto Naves <[email protected]>
+ *
+ * Adapted from socfpga_de0_nano_soc.h
+ */
+#ifndef __CONFIG_TERASIC_DE10_STANDARD_H__
+#define __CONFIG_TERASIC_DE10_STANDARD_H__
+
+#include <asm/arch/base_addr_ac5.h>
+
+/* Memory configurations */
+#define PHYS_SDRAM_1_SIZE		0x40000000	/* 1GiB */
+
+/* The rest of the configuration is shared */
+#include <configs/socfpga_common.h>
+
+#endif	/* __CONFIG_TERASIC_DE10_STANDARD_H__ */
Signature · 1 line
2.36.1
Applied
#5 lore raw
Quoted 3 lines · Humberto Naves

Use the de10-nano files as templates for the de10-standard board. The files in qts directory are generated by quartus from the GHRD design.

Applied, thanks.

#6 lore raw

Thank you!

Quoted 7 lines · Marek Vasut
Quoted 3 lines · Humberto Naves

Use the de10-nano files as templates for the de10-standard board. The files in qts directory are generated by quartus from the GHRD design.

Applied, thanks.