Skip to contentSkip to conversation

arm: socfpga: Add support for the Terasic DE-0 Atlas board

PATCH Superseded dinguyen at opensource.altera.com 4 participants 9 messages Sep 1, 2015 – Sep 2, 2015

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

PATCH v2 1/1 arm: socfpga: Add support for the Terasic DE-0 Atlas board

From: Dinh Nguyen <[email protected]>

Add support for the Terasic DE0-Nano/Atlas-SoC Kit, which is a CycloneV based board. The board can boot from SD/MMC. Ethernet is also supported.

---
v2: add ethernet support
moved board files to board/terasic/de0-nano-soc/ associate everything with 'de0-nano-soc' or 'de0_nano_soc' based on u-boot-socfpga/wip/boards branch

---
 arch/arm/dts/Makefile                          |   1 +
 arch/arm/dts/socfpga_cyclone5_de0_nano_soc.dts |  61 +++
 arch/arm/mach-socfpga/Kconfig                  |   7 +
 board/terasic/de0-nano-soc/MAINTAINERS         |   5 +
 board/terasic/de0-nano-soc/Makefile            |   9 +
 board/terasic/de0-nano-soc/qts/iocsr_config.h  | 658 +++++++++++++++++++++++++
 board/terasic/de0-nano-soc/qts/pinmux_config.h | 220 +++++++++
 board/terasic/de0-nano-soc/qts/pll_config.h    |  85 ++++
 board/terasic/de0-nano-soc/qts/sdram_config.h  | 342 +++++++++++++
 board/terasic/de0-nano-soc/socfpga.c           |  72 +++
 configs/socfpga_de0_nano_soc_defconfig         |  20 +
 include/configs/socfpga_de0_nano_soc.h         |  87 ++++
 12 files changed, 1567 insertions(+)
 create mode 100644 arch/arm/dts/socfpga_cyclone5_de0_nano_soc.dts
 create mode 100644 board/terasic/de0-nano-soc/MAINTAINERS
 create mode 100644 board/terasic/de0-nano-soc/Makefile
 create mode 100644 board/terasic/de0-nano-soc/qts/iocsr_config.h
 create mode 100644 board/terasic/de0-nano-soc/qts/pinmux_config.h
 create mode 100644 board/terasic/de0-nano-soc/qts/pll_config.h
 create mode 100644 board/terasic/de0-nano-soc/qts/sdram_config.h
 create mode 100644 board/terasic/de0-nano-soc/socfpga.c
 create mode 100644 configs/socfpga_de0_nano_soc_defconfig
 create mode 100644 include/configs/socfpga_de0_nano_soc.h
arch/arm/dts/Makefile +1 -0
index c53f5fd..5b2e3d6 100644
@@ -58,6 +58,7 @@ dtb-$(CONFIG_ARCH_SOCFPGA) +=				\
 	socfpga_arria5_socdk.dtb			\
 	socfpga_cyclone5_mcvevk.dtb			\
 	socfpga_cyclone5_socdk.dtb			\
+	socfpga_cyclone5_de0_nano_soc.dtb			\
 	socfpga_cyclone5_sockit.dtb			\
 	socfpga_cyclone5_socrates.dtb
 dtb-$(CONFIG_TARGET_DRA7XX_EVM) += dra72-evm.dtb
arch/arm/dts/socfpga_cyclone5_de0_nano_soc.dts new file +61 -0

61 lines not on this page · raw message

arch/arm/mach-socfpga/Kconfig +7 -0
index 420f66a..12c8b72 100644
@@ -18,6 +18,10 @@ config TARGET_SOCFPGA_CYCLONE5_SOCDK
 	bool "Altera SOCFPGA SoCDK (Cyclone V)"
 	select TARGET_SOCFPGA_CYCLONE5
 
+config TARGET_SOCFPGA_TERASIC_DE0_NANO
+	bool "Terasic DE0-Nano-Atlas (Cyclone V)"
+	select TARGET_SOCFPGA_CYCLONE5
+
 config TARGET_SOCFPGA_TERASIC_SOCKIT
 	bool "Terasic SoCkit (Cyclone V)"
 	select TARGET_SOCFPGA_CYCLONE5
@@ -31,12 +35,14 @@ endchoice
 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 "sockit" if TARGET_SOCFPGA_TERASIC_SOCKIT
 	default "mcvevk" if TARGET_SOCFPGA_DENX_MCVEVK
 
 config SYS_VENDOR
 	default "altera" if TARGET_SOCFPGA_ARRIA5_SOCDK
 	default "altera" if TARGET_SOCFPGA_CYCLONE5_SOCDK
+	default "terasic" if TARGET_SOCFPGA_TERASIC_DE0_NANO
 	default "terasic" if TARGET_SOCFPGA_TERASIC_SOCKIT
 	default "denx" if TARGET_SOCFPGA_DENX_MCVEVK
 
@@ -46,6 +52,7 @@ config SYS_SOC
 config SYS_CONFIG_NAME
 	default "socfpga_arria5" if TARGET_SOCFPGA_ARRIA5_SOCDK
 	default "socfpga_cyclone5" if TARGET_SOCFPGA_CYCLONE5_SOCDK
+	default "socfpga_de0_nano_soc" if TARGET_SOCFPGA_TERASIC_DE0_NANO
 	default "socfpga_sockit" if TARGET_SOCFPGA_TERASIC_SOCKIT
 	default "socfpga_mcvevk" if TARGET_SOCFPGA_DENX_MCVEVK
 
board/terasic/de0-nano-soc/MAINTAINERS new file +5 -0
new file mode 100644
index 0000000..351c456
@@ -0,0 +1,5 @@
+SOCFPGA ATLAS BOARD
+M:	Dinh Nguyen <[email protected]>
+S:	Maintained
+F:	include/configs/socfpga_de0_nano_soc.h
+F:	configs/socfpga_de0_nano_soc_defconfig
board/terasic/de0-nano-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/de0-nano-soc/qts/iocsr_config.h new file +658 -0

658 lines not on this page · raw message

board/terasic/de0-nano-soc/qts/pinmux_config.h new file +220 -0

220 lines not on this page · raw message

board/terasic/de0-nano-soc/qts/pll_config.h new file +85 -0

85 lines not on this page · raw message

board/terasic/de0-nano-soc/qts/sdram_config.h new file +342 -0

342 lines not on this page · raw message

board/terasic/de0-nano-soc/socfpga.c new file +72 -0

72 lines not on this page · raw message

configs/socfpga_de0_nano_soc_defconfig new file +20 -0
new file mode 100644
index 0000000..2b0d510
@@ -0,0 +1,20 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SOCFPGA=y
+CONFIG_TARGET_SOCFPGA_CYCLONE5=y
+CONFIG_TARGET_SOCFPGA_TERASIC_DE0_NANO=y
+CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_de0_nano_soc"
+CONFIG_SPL=y
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+CONFIG_OF_CONTROL=y
+CONFIG_DM_ETH=y
+CONFIG_NETDEVICES=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_DM_GPIO=y
+CONFIG_DWAPB_GPIO=y
+CONFIG_SPL_DM=y
+CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_SPL_SIMPLE_BUS=y
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_STACK_R_ADDR=0x00800000
+CONFIG_SYS_MALLOC_F_LEN=0x2000
include/configs/socfpga_de0_nano_soc.h new file +87 -0

87 lines not on this page · raw message

Signature · 1 line
2.4.5
#1 lore raw

PATCH v2 1/1 arm: socfpga: Add support for the Terasic DE-0 Atlas board

Quoted 5 lines · dinguyen at opensource.altera.com

From: Dinh Nguyen <[email protected]>

Add support for the Terasic DE0-Nano/Atlas-SoC Kit, which is a CycloneV based board. The board can boot from SD/MMC. Ethernet is also supported.

Quoted 7 lines

---
v2: add ethernet support
moved board files to board/terasic/de0-nano-soc/ associate everything with 'de0-nano-soc' or 'de0_nano_soc' based on u-boot-socfpga/wip/boards branch
---

Applied
#2 lore raw

PATCH v2 1/1 arm: socfpga: Add support for the Terasic DE-0 Atlas board

In reply to dinguyen at opensource.altera.com
Quoted 11 lines · dinguyen at opensource.altera.com

From: Dinh Nguyen <[email protected]>

Add support for the Terasic DE0-Nano/Atlas-SoC Kit, which is a CycloneV based board. The board can boot from SD/MMC. Ethernet is also supported.

---
v2: add ethernet support
moved board files to board/terasic/de0-nano-soc/ associate everything with 'de0-nano-soc' or 'de0_nano_soc' based on u-boot-socfpga/wip/boards branch

Applied to wip/boards, thanks. I shuffled the order in arch/arm/mach- socfpga/Kconfig so that things are sorted properly. Can you please double-check that everything builds for you ?

Best regards,
Marek Vasut

#3 lore raw

PATCH v2 1/1 arm: socfpga: Add support for the Terasic DE-0 Atlas board

Quoted 14 lines · Marek Vasut
Quoted 11 lines · dinguyen at opensource.altera.com

From: Dinh Nguyen <[email protected]>

Add support for the Terasic DE0-Nano/Atlas-SoC Kit, which is a CycloneV based board. The board can boot from SD/MMC. Ethernet is also supported.

---
v2: add ethernet support
moved board files to board/terasic/de0-nano-soc/ associate everything with 'de0-nano-soc' or 'de0_nano_soc' based on u-boot-socfpga/wip/boards branch

Quoted 4 lines

Applied to wip/boards, thanks. I shuffled the order in arch/arm/mach- socfpga/Kconfig so that things are sorted properly. Can you please double-check that everything builds for you ?

Yes, everything builds for me. Thanks!

Dinh

#4 lore raw

PATCH v2 1/1 arm: socfpga: Add support for the Terasic DE-0 Atlas board

Quoted 18 lines · Dinh Nguyen
Quoted 17 lines · Marek Vasut

On Wednesday, September 02, 2015 at 12:41:52 AM,
dinguyen at opensource.altera.com

Quoted 12 lines · wrote:

From: Dinh Nguyen <[email protected]>

Add support for the Terasic DE0-Nano/Atlas-SoC Kit, which is a CycloneV based board. The board can boot from SD/MMC. Ethernet is also supported.

---
v2: add ethernet support

moved board files to board/terasic/de0-nano-soc/ associate everything with 'de0-nano-soc' or 'de0_nano_soc' based on u-boot-socfpga/wip/boards branch

Quoted 5 lines
Quoted 3 lines

Applied to wip/boards, thanks. I shuffled the order in arch/arm/mach- socfpga/Kconfig so that things are sorted properly. Can you please double-check that everything builds for you ?

Yes, everything builds for me. Thanks!

Cool, thanks :)

Best regards,
Marek Vasut

#5 lore raw

PATCH v2 1/1 arm: socfpga: Add support for the Terasic DE-0 Atlas board

In reply to Dinh Nguyen
Quoted 17 lines · Dinh Nguyen
Quoted 14 lines · Marek Vasut
Quoted 11 lines · dinguyen at opensource.altera.com

From: Dinh Nguyen <[email protected]>

Add support for the Terasic DE0-Nano/Atlas-SoC Kit, which is a CycloneV based board. The board can boot from SD/MMC. Ethernet is also supported.

---
v2: add ethernet support
moved board files to board/terasic/de0-nano-soc/ associate everything with 'de0-nano-soc' or 'de0_nano_soc' based on u-boot-socfpga/wip/boards branch

Quoted 6 lines
Quoted 4 lines

Applied to wip/boards, thanks. I shuffled the order in arch/arm/mach- socfpga/Kconfig so that things are sorted properly. Can you please double-check that everything builds for you ?

Yes, everything builds for me. Thanks!

Hi Dinh

FYI, I just pulled from wip/boards and built with
socfpga_de0_nano_soc_defconfig and booted from SD :

U-Boot SPL 2015.10-rc2-00311-g859de28-dirty (Sep 02 2015 - 14:47:55)

drivers/ddr/altera/sequencer.c: Preparing to start memory calibration

drivers/ddr/altera/sequencer.c: CALIBRATION PASSED

drivers/ddr/altera/sequencer.c: Calibration complete

bad magic

spl: mmc: no boot mode left to try

### ERROR ### Please RESET the board ###

Not sure what I have missed.

Regards
Sinan Akman

#6 lore raw

PATCH v2 1/1 arm: socfpga: Add support for the Terasic DE-0 Atlas board

Quoted 39 lines · Sinan Akman
Quoted 19 lines · Dinh Nguyen
Quoted 18 lines · Marek Vasut

On Wednesday, September 02, 2015 at 12:41:52 AM,
dinguyen at opensource.altera.com

Quoted 13 lines · wrote:

From: Dinh Nguyen <[email protected]>

Add support for the Terasic DE0-Nano/Atlas-SoC Kit, which is a CycloneV based board. The board can boot from SD/MMC. Ethernet is also supported.

---
v2: add ethernet support

moved board files to board/terasic/de0-nano-soc/ associate everything with 'de0-nano-soc' or 'de0_nano_soc' based on u-boot-socfpga/wip/boards branch

Quoted 5 lines
Quoted 3 lines

Applied to wip/boards, thanks. I shuffled the order in arch/arm/mach- socfpga/Kconfig so that things are sorted properly. Can you please double-check that everything builds for you ?

Yes, everything builds for me. Thanks!

Hi Dinh

FYI, I just pulled from wip/boards and built with
socfpga_de0_nano_soc_defconfig and booted from SD :

U-Boot SPL 2015.10-rc2-00311-g859de28-dirty (Sep 02 2015 - 14:47:55)

drivers/ddr/altera/sequencer.c: Preparing to start memory calibration

drivers/ddr/altera/sequencer.c: CALIBRATION PASSED

drivers/ddr/altera/sequencer.c: Calibration complete

Quoted 7 lines

bad magic

spl: mmc: no boot mode left to try

### ERROR ### Please RESET the board ###

Not sure what I have missed.

Try the following:

git revert 811c9a20823a55decc5e15af0684d3d29cdf610f

and let me know if this fixes things for you.

Best regards,
Marek Vasut

#7 lore raw

PATCH v2 1/1 arm: socfpga: Add support for the Terasic DE-0 Atlas board

Quoted 47 lines · Marek Vasut
Quoted 46 lines · Sinan Akman
Quoted 19 lines · Dinh Nguyen
Quoted 18 lines · Marek Vasut

On Wednesday, September 02, 2015 at 12:41:52 AM,
dinguyen at opensource.altera.com

Quoted 13 lines · wrote:

From: Dinh Nguyen <[email protected]>

Add support for the Terasic DE0-Nano/Atlas-SoC Kit, which is a CycloneV based board. The board can boot from SD/MMC. Ethernet is also supported.

---
v2: add ethernet support

moved board files to board/terasic/de0-nano-soc/ associate everything with 'de0-nano-soc' or 'de0_nano_soc' based on u-boot-socfpga/wip/boards branch

Quoted 6 lines
Quoted 3 lines

Applied to wip/boards, thanks. I shuffled the order in arch/arm/mach- socfpga/Kconfig so that things are sorted properly. Can you please double-check that everything builds for you ?

Yes, everything builds for me. Thanks!

Hi Dinh

FYI, I just pulled from wip/boards and built with

socfpga_de0_nano_soc_defconfig and booted from SD :

U-Boot SPL 2015.10-rc2-00311-g859de28-dirty (Sep 02 2015 - 14:47:55)

drivers/ddr/altera/sequencer.c: Preparing to start memory calibration

drivers/ddr/altera/sequencer.c: CALIBRATION PASSED

drivers/ddr/altera/sequencer.c: Calibration complete

bad magic

spl: mmc: no boot mode left to try

### ERROR ### Please RESET the board ###

Quoted 7 lines
Quoted 1 line

Not sure what I have missed.

Try the following:

git revert 811c9a20823a55decc5e15af0684d3d29cdf610f

and let me know if this fixes things for you.

If this doesn't help, undo the revert and repartition the SD card such that the preloader partition is located at 2048 sectors from start (that's where U-Boot expects it for now, there's space for improvement) and write the u-boot-with-spl-dtb.sfp to that partition.

$ sudo fdisk  -l /dev/sdg
Disk /dev/sdg: 14.9 GiB, 16003891200 bytes, 31257600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5452574f

Device Boot Start End Sectors Size Id Type
/dev/sdg1 * 2048 4095 2048 1M a2 unknown
/dev/sdg2 6144 104447 98304 48M 83 Linux
/dev/sdg3 106496 108543 2048 1M 83 Linux

Best regards,
Marek Vasut

#8 lore raw

PATCH v2 1/1 arm: socfpga: Add support for the Terasic DE-0 Atlas board

Quoted 66 lines · Marek Vasut
Quoted 43 lines · Marek Vasut
Quoted 42 lines · Sinan Akman
Quoted 15 lines · Dinh Nguyen
Quoted 14 lines · Marek Vasut

On Wednesday, September 02, 2015 at 12:41:52 AM,
dinguyen at opensource.altera.com

Quoted 10 lines · wrote:

From: Dinh Nguyen <[email protected]>

Add support for the Terasic DE0-Nano/Atlas-SoC Kit, which is a CycloneV based board. The board can boot from SD/MMC. Ethernet is also supported.

---
v2: add ethernet support

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

moved board files to board/terasic/de0-nano-soc/ associate everything with 'de0-nano-soc' or 'de0_nano_soc' based on u-boot-socfpga/wip/boards branch

Applied to wip/boards, thanks. I shuffled the order in arch/arm/mach- socfpga/Kconfig so that things are sorted properly. Can you please double-check that everything builds for you ?

Yes, everything builds for me. Thanks!

Hi Dinh

FYI, I just pulled from wip/boards and built with

socfpga_de0_nano_soc_defconfig and booted from SD :

U-Boot SPL 2015.10-rc2-00311-g859de28-dirty (Sep 02 2015 - 14:47:55)

drivers/ddr/altera/sequencer.c: Preparing to start memory calibration

drivers/ddr/altera/sequencer.c: CALIBRATION PASSED

drivers/ddr/altera/sequencer.c: Calibration complete

bad magic

spl: mmc: no boot mode left to try

Quoted 8 lines
Quoted 3 lines

### ERROR ### Please RESET the board ###

Not sure what I have missed.

Try the following:

git revert 811c9a20823a55decc5e15af0684d3d29cdf610f

and let me know if this fixes things for you.

If this doesn't help, undo the revert and repartition the SD card such that the preloader partition is located at 2048 sectors from start (that's where U-Boot expects it for now, there's space for improvement) and write the u-boot-with-spl-dtb.sfp to that partition.

$ sudo fdisk  -l /dev/sdg
Disk /dev/sdg: 14.9 GiB, 16003891200 bytes, 31257600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5452574f
Quoted 4 lines

Device Boot Start End Sectors Size Id Type
/dev/sdg1 * 2048 4095 2048 1M a2 unknown
/dev/sdg2 6144 104447 98304 48M 83 Linux
/dev/sdg3 106496 108543 2048 1M 83 Linux

I repartitioned SD with similar geometry and it boots
fine now.

Thanks
Sinan Akman