Skip to contentSkip to conversation

socfpga: add support for Terasic DE1-SoC board

PATCH New Anatolij Gustschin 2 participants 4 messages Nov 14, 2016

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

PATCH 1/1 socfpga: add support for Terasic DE1-SoC board

Add CycloneV based Terasic DE1-SoC board. The board boots from SD/MMC. Ethernet and USB host is supported.

---
 arch/arm/dts/Makefile                     |   1 +
 arch/arm/dts/socfpga_cyclone5_de1_soc.dts |  66 +++
 arch/arm/mach-socfpga/Kconfig             |   7 +
 board/terasic/de1-soc/MAINTAINERS         |   5 +
 board/terasic/de1-soc/Makefile            |   9 +
 board/terasic/de1-soc/qts/iocsr_config.h  | 660 ++++++++++++++++++++++++++++++
 board/terasic/de1-soc/qts/pinmux_config.h | 219 ++++++++++
 board/terasic/de1-soc/qts/pll_config.h    |  91 ++++
 board/terasic/de1-soc/qts/sdram_config.h  | 344 ++++++++++++++++
 board/terasic/de1-soc/socfpga.c           |  19 +
 configs/socfpga_de1_soc_defconfig         |  50 +++
 include/configs/socfpga_de1_soc.h         |  60 +++
 12 files changed, 1531 insertions(+)
 create mode 100644 arch/arm/dts/socfpga_cyclone5_de1_soc.dts
 create mode 100644 board/terasic/de1-soc/MAINTAINERS
 create mode 100644 board/terasic/de1-soc/Makefile
 create mode 100644 board/terasic/de1-soc/qts/iocsr_config.h
 create mode 100644 board/terasic/de1-soc/qts/pinmux_config.h
 create mode 100644 board/terasic/de1-soc/qts/pll_config.h
 create mode 100644 board/terasic/de1-soc/qts/sdram_config.h
 create mode 100644 board/terasic/de1-soc/socfpga.c
 create mode 100644 configs/socfpga_de1_soc_defconfig
 create mode 100644 include/configs/socfpga_de1_soc.h
arch/arm/dts/Makefile +1 -0
index 836a8c4..36bda16 100644
@@ -128,6 +128,7 @@ dtb-$(CONFIG_ARCH_SOCFPGA) +=				\
 	socfpga_cyclone5_mcvevk.dtb			\
 	socfpga_cyclone5_socdk.dtb			\
 	socfpga_cyclone5_de0_nano_soc.dtb			\
+	socfpga_cyclone5_de1_soc.dtb			\
 	socfpga_cyclone5_sockit.dtb			\
 	socfpga_cyclone5_socrates.dtb			\
 	socfpga_cyclone5_sr1500.dtb			\
arch/arm/dts/socfpga_cyclone5_de1_soc.dts new file +66 -0

66 lines not on this page · raw message

arch/arm/mach-socfpga/Kconfig +7 -0
index d91b8bb..6991af8 100644
@@ -74,6 +74,10 @@ config TARGET_SOCFPGA_TERASIC_DE0_NANO
 	bool "Terasic DE0-Nano-Atlas (Cyclone V)"
 	select TARGET_SOCFPGA_CYCLONE5
 
+config TARGET_SOCFPGA_TERASIC_DE1_SOC
+	bool "Terasic DE1-SoC (Cyclone V)"
+	select TARGET_SOCFPGA_CYCLONE5
+
 config TARGET_SOCFPGA_TERASIC_SOCKIT
 	bool "Terasic SoCkit (Cyclone V)"
 	select TARGET_SOCFPGA_CYCLONE5
@@ -84,6 +88,7 @@ config SYS_BOARD
 	default "arria5-socdk" if TARGET_SOCFPGA_ARRIA5_SOCDK
 	default "cyclone5-socdk" if TARGET_SOCFPGA_CYCLONE5_SOCDK
 	default "de0-nano-soc" if TARGET_SOCFPGA_TERASIC_DE0_NANO
+	default "de1-soc" if TARGET_SOCFPGA_TERASIC_DE1_SOC
 	default "is1" if TARGET_SOCFPGA_IS1
 	default "mcvevk" if TARGET_SOCFPGA_DENX_MCVEVK
 	default "sockit" if TARGET_SOCFPGA_TERASIC_SOCKIT
@@ -98,6 +103,7 @@ config SYS_VENDOR
 	default "ebv" if TARGET_SOCFPGA_EBV_SOCRATES
 	default "samtec" if TARGET_SOCFPGA_SAMTEC_VINING_FPGA
 	default "terasic" if TARGET_SOCFPGA_TERASIC_DE0_NANO
+	default "terasic" if TARGET_SOCFPGA_TERASIC_DE1_SOC
 	default "terasic" if TARGET_SOCFPGA_TERASIC_SOCKIT
 
 config SYS_SOC
@@ -107,6 +113,7 @@ config SYS_CONFIG_NAME
 	default "socfpga_arria5_socdk" if TARGET_SOCFPGA_ARRIA5_SOCDK
 	default "socfpga_cyclone5_socdk" if TARGET_SOCFPGA_CYCLONE5_SOCDK
 	default "socfpga_de0_nano_soc" if TARGET_SOCFPGA_TERASIC_DE0_NANO
+	default "socfpga_de1_soc" if TARGET_SOCFPGA_TERASIC_DE1_SOC
 	default "socfpga_is1" if TARGET_SOCFPGA_IS1
 	default "socfpga_mcvevk" if TARGET_SOCFPGA_DENX_MCVEVK
 	default "socfpga_sockit" if TARGET_SOCFPGA_TERASIC_SOCKIT
board/terasic/de1-soc/MAINTAINERS new file +5 -0
new file mode 100644
index 0000000..bd7a8d5
@@ -0,0 +1,5 @@
+DE1-SoC BOARD
+M:	Anatolij Gustschin <[email protected]>
+S:	Maintained
+F:	include/configs/socfpga_de1_soc.h
+F:	configs/socfpga_de1_soc_defconfig
board/terasic/de1-soc/Makefile new file +9 -0
new file mode 100644
index 0000000..86f9b78
@@ -0,0 +1,9 @@
+#
+# (C) Copyright 2001-2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+# (C) Copyright 2010, Thomas Chou <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= socfpga.o
board/terasic/de1-soc/qts/iocsr_config.h new file +660 -0

660 lines not on this page · raw message

board/terasic/de1-soc/qts/pinmux_config.h new file +219 -0

219 lines not on this page · raw message

board/terasic/de1-soc/qts/pll_config.h new file +91 -0

91 lines not on this page · raw message

board/terasic/de1-soc/qts/sdram_config.h new file +344 -0

344 lines not on this page · raw message

board/terasic/de1-soc/socfpga.c new file +19 -0
new file mode 100644
index 0000000..0d29e44
@@ -0,0 +1,19 @@
+/*
+ *  Copyright (C) 2012 Altera Corporation <www.altera.com>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+#include <common.h>
+#include <spl.h>
+
+void board_boot_order(u32 *spl_boot_list)
+{
+	spl_boot_list[0] = spl_boot_device();
+
+	switch (spl_boot_list[0]) {
+	case BOOT_DEVICE_MMC1:
+		spl_boot_list[0] = BOOT_DEVICE_MMC1;
+		spl_boot_list[1] = BOOT_DEVICE_UART;
+		break;
+	}
+}
configs/socfpga_de1_soc_defconfig new file +50 -0

50 lines not on this page · raw message

include/configs/socfpga_de1_soc.h new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 socfpga: add support for Terasic DE1-SoC board

Quoted 5 lines · Anatolij Gustschin

Add CycloneV based Terasic DE1-SoC board. The board boots from SD/MMC. Ethernet and USB host is supported.

[...]

Quoted 52 lines
include/configs/socfpga_de1_soc.h new file +46 -0
new file mode 100644
index 0000000..9514b27
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2016 Marek Vasut <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+#ifndef __CONFIG_TERASIC_DE1_SOC_H__
+#define __CONFIG_TERASIC_DE1_SOC_H__
+
+#include <asm/arch/base_addr_ac5.h>
+
+/* U-Boot Commands */
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_DOS_PARTITION
+#define CONFIG_FAT_WRITE
+#define CONFIG_HW_WATCHDOG
+
+/* Memory configurations */
+#define PHYS_SDRAM_1_SIZE		0x40000000	/* 1GiB */
+
+/* Booting Linux */
+#define CONFIG_BOOTFILE		"fitImage"
+#define CONFIG_BOOTARGS		"console=ttyS0," __stringify(CONFIG_BAUDRATE)
+#define CONFIG_BOOTCOMMAND	"run mmcload; run mmcboot"
+#define CONFIG_LOADADDR		0x01000000
+#define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
+
+/* Ethernet on SoC (EMAC) */
+#if defined(CONFIG_CMD_NET)
+#define CONFIG_PHY_MICREL
+#define CONFIG_PHY_MICREL_KSZ9021
+#endif
+
+#define CONFIG_ENV_IS_IN_MMC
+
+/* Extra Environment */
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+	"ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \
+		"bootm ${loadaddr} - ${fdtaddr}\0" \
+	"bootimage=zImage\0" \
+	"fdtaddr=100\0" \
+	"fdtimage=socfpga.dtb\0" \
+	"bootm ${loadaddr} - ${fdtaddr}\0" \
+	"mmcroot=/dev/mmcblk0p2\0" \
+	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
+		" root=${mmcroot} rw rootwait;" \

include/configs/socfpga_de1_soc.h line 56

Quoted 10 lines
include/configs/socfpga_de1_soc.h new file +10 -0
+		"bootz ${loadaddr} - ${fdtaddr}\0" \
+	"mmcload=mmc rescan;" \
+		"load mmc 0:1 ${loadaddr} ${bootimage};" \
+		"load mmc 0:1 ${fdtaddr} ${fdtimage}\0" \
+
+/* The rest of the configuration is shared */
+#include <configs/socfpga_common.h>
+
+#undef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION	2

Why is this needed ? Just start U-Boot from partition 1 as all the other SoCFPGAs do , esp. since this is a devkit, please keep it consistent.

Looks great otherwise :)

Quoted 4 lines
include/configs/socfpga_de1_soc.h new file +3 -0
+#define CONFIG_SPL_ABORT_ON_RAW_IMAGE
+
+#endif	/* __CONFIG_TERASIC_DE1_SOC_H__ */
Signature · 2 lines
Best regards,
Marek Vasut
#2 lore raw

PATCH 1/1 socfpga: add support for Terasic DE1-SoC board

Hi,

On Mon, 14 Nov 2016 15:07:31 +0100
Marek Vasut marex at denx.de wrote:
...

Quoted 5 lines

include/configs/socfpga_de1_soc.h line 56

Quoted 2 lines
include/configs/socfpga_de1_soc.h new file +2 -0
+#undef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION	2  

Why is this needed ? Just start U-Boot from partition 1 as all the other SoCFPGAs do , esp. since this is a devkit, please keep it consistent.

It is not really needed. I used the original Terasic SD-Card, its raw partition is 2. OK, will remove it.

Quoted 1 line

Looks great otherwise :)

Thanks for review!

--
Anatolij

#3 lore raw

PATCH 1/1 socfpga: add support for Terasic DE1-SoC board

Quoted 5 lines · Anatolij Gustschin

Hi,

On Mon, 14 Nov 2016 15:07:31 +0100
Marek Vasut marex at denx.de wrote:
...

Quoted 8 lines
Quoted 5 lines

include/configs/socfpga_de1_soc.h line 56

Quoted 2 lines
include/configs/socfpga_de1_soc.h new file +2 -0
+#undef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION	2  

Why is this needed ? Just start U-Boot from partition 1 as all the other SoCFPGAs do , esp. since this is a devkit, please keep it consistent.

It is not really needed. I used the original Terasic SD-Card, its raw partition is 2. OK, will remove it.

Thanks!

Quoted 3 lines
Quoted 1 line

Looks great otherwise :)

Thanks for review!

I'll pick V2 for the next release then. Thanks!

Signature · 2 lines
Best regards,
Marek Vasut