SW Development For Altera SoC Devices Workshop
SW Development For Altera SoC Devices Workshop
Devices Workshop
Altera SW SoC Workshop Series
2
Welcome. Here’s What You Can Expect Today
Informational Resources
Overview of SoC Features
Software Development flow
Supported OS
Linux support overview
SD Card manipulation
System console.
LAB overview
4
Information Resources
5
Essential Altera Training
http://www.altera.com/training
2 for 1 Training Special for Today’s Class
7
Essential SoC Software Tools Online Videos
8
Essential SoC Hardware Documentation Resources
9
Essential SoC Software Documentation Resources
10
SoC Device Overview
11
Altera Investment in Embedded Technologies
12
Altera SoC Product Portfolio
LOW END SoCs MID RANGE SoCs HIGH END SoCs
(Lowest Power, Form Factor & Cost) (High Performance with Low Power, Form Factor & Cost) (Highest Performance & System Bandwidth)
HIGH PERFORMANCE
DEVICE AVAILABILITY
SoC devices available across entire product portfolio …
13
ARM Public Processor Offering
Cortex-A57
Stratix 10
Cortex-A53
CORTEX-A Cortex-A17
Cortex-A15
Application Processor
Cortex-A12
Cortex-A9 Cyclone V, Arria V, Arria 10
Cortex-A8
Cortex-A5
CORTEX-R
Cortex-R7
Cortex-R5 Real-time control
Cortex-R4
CORTEX-M
Cortex-M4
Cortex-M3
Cortex-M1 Microcontroller
Cortex-M0+
Cortex-M0
SECURCORE SC000
SC100 Secure
SC300
28nm SoC System Architecture
Processor
Dual-core ARM® Cortex™-A9 MPCore™ processor
Up to 5,250 MIPS (1050 MHz per core maximum)
NEON coprocessor with double-precision FPU
32-KB/32-KB L1 caches per core
512-KB shared L2 cache
Multiport SDRAM controller
DDR3, DDR3L, DDR2, LPDDR2
Integrated ECC support
High-bandwidth on-chip interfaces
> 125-Gbps HPS-to-FPGA interface
> 125-Gbps FPGA-to-SDRAM interface
Cost- and power-optimized FPGA fabric
Lowest power transceivers
Up to 1,600 GMACS, 300 GFLOPS
Up to 25Mb on-chip RAM
More hard intellectual property (IP): PCIe® and
memory controllers
15
Arria 10 HPS Block Diagram
ARM CORTEX™ – A9 MP QSPI FLASH SD / SDIO/ NAND Flash
ARM CoreSight ™ Multicore Debug/ Trace CNTRL MMC (1) (1) (2)
SECURITY
CORE 1 CORE 2
ARM Cortex – A9 ARM Cortex – A9 16550 UART SPI
I2C (X5)
MP Core MP Core (x2) (x2)
NEON SIMD FPU NEON SIMD FPU
EMAC with 8 Channel
32 KB I$/D$ w/ Parity 32 KB I$/D$ w/ Parity USB OTG (x2)
DMA (x3) DMA
POWER
MANAGEMENT 512 KB L2 CACHE (SHARED)
256 KB DEDICATED GP TIMERS
w/ ECC GPIO (17)
SCRATCH RAM (x7)
Accelerator Coherency
USER IO
Snoop Control Unit
Port
(Network SECURITY
Watch Dog
64-bit AXI Coherent Bus Interface L3 INTERCONNECT On Chip) ON CHIP
Timer (x4) MANAGER ROM
SDRAM (3)
HARD L3 INTERCONNECT (NETWORK ON CHIP)
INTERCONNECT
MEMORY
CONTROLLER FPGA to HPS SDRAM LW HPS TO CORE HPS to FPGA FPGA to HPS FPGA CONFIG
BRIDGE BRIDGE BRIDGE BRIDGE MANAGER
2 32/64/128 Port
AXI 32 AXI 32/64/128 AXI 32/64/128
1 32/64 bit Port
FPGA LOGIC
CONFIGURAT- PCIe Gen 3 X 8 Controller Hard IP
ION
PCS & FEC (Interlaaken PCS, 10G KR-FEC)
PHY
Notes:
(1) Integrated direct memory access (DMA)
(2) Integrated ECC
16
(3) DDR3/4 & LP DDR3 SDRAM Support fo HPS Memory
High-Level Block Diagram
FPGA
HPS to FPGA Configuration
FPGA to HPS Control FPGA to SDRAM
EMAC FPGA
ARM Cortex-A9MPCore
...
HPS
(2) Config CPU0 CPU1
ARM Cortex-A9 ARM Cortex-A9
NEON/FPU NEON/FPU
USB 32 KB I$ 32 KB I$
OTG 32 KB D$ 32 KB D$
(2)
ACP
SCU
Flash
Control Multi-port
L2 Cache DDR
(512 KB) SDRAM
DMA
Interconnect Boot Controller
ROM
TMC On-chip
(Trace) RAM
64 KB
Debug
Port
17
A Comparison: Cyclone V SoC, Arria V SoC, & Arria 10 SoC
Metric Cyclone V SoC Arria V SoC Arria 10 SoC
18
Learn more about the HPS hardware
Overview
http://www.altera.com/devices/processor/soc-fpga/overview/proc-soc-
fpga.html
SoC handbooks
http://www.altera.com/devices/processor/soc-fpga/overview/soc-overview-
doc.html
19
Boot Process
Altera SoC FPGA Boot & Configuration Options
SOC Device
Configuration Sources
FPGA HPS
Configuration Sources
QSPI
Boot Sources
PCIe
/SPI
Passive Config
Parallel Controller
Boot On-chip
ROM RAM
Boot User Specified I/F AXI
Source
21
Boot Stages – Cyclone V & Arria V
OS or
Bare Metal
FPGA or
FLASH
22
Boot Stages – Cyclone V & Arria V
DDR
1.Reset/boot SoC FPGA
Boot ROM
On-Chip
Pre-loader
RAM
HPS
System
OS &
Applications
User Bootloader
Pre-loader
Flash
23
Boot Stages – Cyclone V & Arria V
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM, Boot ROM
3.Set up boot source (BSEL pins)
On-Chip
Pre-loader
RAM
HPS
System
OS &
Applications
User Bootloader
Pre-loader
Flash
24
Boot Stages – Cyclone V & Arria V
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM, Boot ROM
3.Set up boot source
4.Copy Pre-loader to On-Chip
Pre-loader
Pre-loader
5.On-chip RAM RAM
HPS
System
OS &
Applications
User Bootloader
Pre-loader
Flash
25
Boot Stages – Cyclone V & Arria V
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM: Boot ROM
3.Set up boot source
4.Copy Pre-loader to On-Chip
Pre-loader
Pre-loader
5.On-chip RAM RAM
6.Run Pre-loader:
7.Set up HPS I/O and DDR HPS
System
OS &
Applications
User Bootloader
Pre-loader
Flash
26
Boot Stages – Cyclone V & Arria V
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM: Boot ROM
3.Set up boot source
4.Copy Pre-loader to On-Chip
Pre-loader
Pre-loader FPGA
5.On-chip RAM RAM
Config-
6.Run Pre-loader:
uration
7.Set up HPS I/O and DDR HPS
8.Configure FPGA (optional) System
OS &
Applications
User Bootloader
Pre-loader
Flash
27
Boot Stages – Cyclone V & Arria V
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM: Boot ROM
3.Set up boot source
4.Copy Pre-loader to On-Chip
Pre-loader
Pre-loader FPGA
5.On-chip RAM RAM
Config-
6.Run Pre-loader:
uration
7.Set up HPS I/O and DDR HPS
8.Configure FPGA (optional) System
9.Copy User Bootloader (i.e User Bootloader*
Uboot) or BM Application to
DDR Safe FPGA Image
OS &
Applications
User Bootloader
Pre-loader
Flash
28
Boot Stages – Cyclone V & Arria V
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM: Boot ROM
3.Set up boot source
4.Copy Pre-loader to On-Chip
Pre-loader FPGA
5.On-chip RAM RAM
Config-
6.Run Pre-loader:
uration
7.Set up HPS I/O and DDR HPS
8.Configure FPGA (optional) System
9.Copy User Bootloader to User Bootloader*
DDR
10.Run UserBootloader,
Safe FPGA Image
11.Configure FPGA (optional)
OS &
Applications
User Bootloader
Pre-loader
Flash
29
Boot Stages – Cyclone V & Arria V
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM: Boot ROM
3.Set up boot source
4.Copy Pre-loader to On-Chip
Pre-loader FPGA
5.On-chip RAM RAM
Config-
6.Run Pre-loader:
OS & uration
7.Set up HPS I/O and DDR Applications HPS
8.Configure FPGA (optional) System
9.Copy User Bootloader to User Bootloader*
DDR
10.Run UserBootloader,
Safe FPGA Image
11.Configure FPGA (optional)
12.Copy OS to DDR User FPGA Image
OS &
Applications
User Bootloader
Pre-loader
Flash
30
Boot Stages – Cyclone V & Arria V
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM: Dynamic Boot ROM
3.Set up boot source Memory
4.Copy Pre-loader to On-Chip
Pre-loader FPGA
5.On-chip RAM RAM
Config-
6.Run Pre-loader:
OS & uration
7.Set up HPS I/O and DDR Applications HPS
8.Configure FPGA (optional) System
9.Copy User Bootloader to User Bootloader*
DDR
10.Run UserBootloader,
Safe FPGA Image
11.Configure FPGA
(optional) User FPGA Image
12.Copy OS to DDR
13.Run OS OS &
14.Run applications Applications
User Bootloader
Pre-loader
Flash
31
Boot Stages – Cyclone V & Arria V
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM: Dynamic Boot ROM
3.Set up boot source Memory
4.Copy Pre-loader to On-Chip
Pre-loader FPGA
5.On-chip RAM RAM
Config-
6.Run Pre-loader:
OS & uration
7.Set up HPS I/O and DDR Applications HPS
8.Configure FPGA (optional) System
9.Copy User Bootloader to User Bootloader*
DDR
10.Run UserBootloader,
Safe FPGA Image
11.Configure FPGA
(optional) User FPGA Image
12.Copy OS to DDR
13.Run OS OS & *User Bootloader is
14.Run applications Applications optional. Steps 9-12
15.Configure FPGA User Bootloader optional
(optional)
Pre-loader
Flash
32
Boot Stages – Cyclone V & Arria V
Preloader
Reset BootROM SPL or Bootloader OS
MPL
OS or
Bare Metal
FPGA or
FLASH
33
Non-Secure Boot Stages – Arria 10
Bootloader
OS or
Reset BootROM U-Boot or
Bare Metal
UEFI
FPGA or
FLASH
34
Non-Secure Boot Stages – Arria 10
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM, Boot ROM
3.Set up boot source (BSEL pins)
On-Chip
Pre-loader
RAM
HPS
System
OS &
Applications
Bootloader
U-Boot or UEFI
Flash
35
Non-Secure Boot Stages – Arria 10
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM, Boot ROM
3.Set up boot source
4.Copy Bootloader to On-Chip
Pre-loader
Bootloader
5.On-chip RAM RAM
HPS
System
OS &
Applications
Bootloader
U-Boot or UEFI
Flash
36
Non-Secure Boot Stages – Arria 10
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM: Boot ROM
3.Set up boot source
4.Copy Bootloader to On-Chip
Pre-loader
Bootloader
5.On-chip RAM RAM
6.Run Bootloader:
7.Set up HPS I/O and DDR HPS
System
OS &
Applications
Bootloader
U-Boot or UEFI
Flash
37
Non-Secure Boot Stages – Arria 10
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM: Boot ROM
3.Set up boot source
4.Copy Bootloader to On-Chip
Pre-loader
Bootloader FPGA
5.On-chip RAM RAM
Config-
6.Run Bootloader:
uration
7.Set up HPS I/O and DDR HPS
8.Configure FPGA (optional) System
OS &
Applications
Bootloader
U-Boot or UEFI
Flash
38
Non-Secure Boot Stages – Arria 10
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM: Boot ROM
3.Set up boot source
4.Copy Bootloader to On-Chip
Pre-loader
Pre-loader FPGA
5.On-chip RAM RAM
Config-
6.Run Bootloader:
OS & uration
7.Set up HPS I/O and DDR Applications HPS
8.Configure FPGA (optional) System
9.Copy OS to DDR
OS &
Applications
Bootloader
U-Boot or UEFI
Flash
39
Non-Secure Boot Stages – Arria 10
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM: Dynamic Boot ROM
3.Set up boot source Memory
4.Copy Bootloader to On-Chip
Pre-loader FPGA
5.On-chip RAM RAM
Config-
6.Run Bootloader:
OS & uration
7.Set up HPS I/O and DDR Applications HPS
8.Configure FPGA (optional) System
9.Copy OS to DDR
10.Run OS
11.Run applications
Safe FPGA Image
OS &
Applications
Bootloader
U-Boot or UEFI
Flash
40
Non-Secure Boot Stages – Arria 10
DDR
1.Reset/boot SoC FPGA
2.Boot from ROM: Dynamic Boot ROM
3.Set up boot source Memory
4.Copy Bootloader to On-Chip
Pre-loader FPGA
5.On-chip RAM RAM
Config-
6.Run Bootloader:
OS & uration
7.Set up HPS I/O and DDR Applications HPS
8.Configure FPGA (optional) System
9.Copy OS to DDR
10.Run OS
11.Run applications
Safe FPGA Image
12.Configure FPGA
(optional) User FPGA Image
OS &
Applications
Bootloader
U-Boot or UEFI
Flash
41
Learn more about boot and configuration process
42
Development Flow & Tools
Traditional System Development Flow
FPGA Design Flow Software Design Flow
Hardware Software
Development Development
44
So… what exactly is Qsys?
High-Performance Interconnect
Avalon® Interfaces
Real-Time System Debug
®
AMBA AXI, APB, AHB
®
48
Learn more Qsys and HPS configuration
49
Software
Traditional System Development Flow
FPGA Design Flow Software Design Flow
Hardware Software
Development Development
51
Altera SoC Embedded Design Suite
Design examples
52
Software Design Flow
53
Hardware-to-Software Handoff
Qsys system info, SDRAM calibration files,
ID / timestamp, HPS IOCSR data
Hardware
system.iswinfo system.sopcinfo
board info
.c & .h
Linux
Software source files
Device Tree
(u-boot spl)
54
Linux HW/SW Handoff – Arria 10 SoC
Device Tree
Generator:
sopc2dts
Board Info
Linux
DT Blob
Quartus II
Bootloader
Generator:
bsp-editor
DTC
Bootloader Bootloader
DT Source DT Blob
Board Info
mkpimage
Regenerate only when user options U-Boot
(boot source, etc.) change Image
Provided by Altera
Input File
Make
Intermediate File
U-Boot U-Boot
Output File Src Code Binary
DS-5 Altera Edition
ARM DS-5 Altera Edition Overview
57
DS-5 Altera Edition- One Tool, Three Usages
1
• JTAG-Based Debugging
• Board Bring-up
• OS porting, Drivers Dev,
2 • Kernel Debug
58
One Device, Two Debugging Tools?
JTAG
DSTREAM™
59
Industry First: FPGA-Adaptive Debugging
Altera
USB-Blaster™II
Connection
60
Visualization of SoC Peripherals
CMSIS
Peripheral register
descriptions
61
FPGA-Adaptive, Unified Debugging
FPGA connected to debug and trace buses for non-
intrusive capture and visualization of signal events
Simultaneous debug
and trace connection to CPU cores
and compatible IP
Correlate
FPGA signal
events with
software events
and CPU
instruction
trace using
triggers and
timestamps
62
Cross-Domain Debug 1
SOFTWARE TRIGGER
HARDWARE TRIGGER!
63
Cross-Domain Debug 2
64
Correlate HW and SW Events
SignalTap™ II Logic
Analyzer
or
DS-5 debugger
Timestamp Correlated
Captured trace can
then be analyzed using SignalTap II Logic Analyzer
timestamp-correlated
events
65
DS-5 Editions Summary
Web Subscription 30-Day
Component Key Feature
Edition Edition Evaluation
Hardware/Software
Preloader Image Generator x x x
Handoff Tools
Flash Image Creator x x x
Device Tree Generator (Linux) x x x
ARM DS-5 Altera
Eclipse IDE x x x
Edition
Debugging over Ethernet (Linux) x x x
Debugging over USB-Blaster II JTAG x x
Automatic FPGA Register Views x x
Hardware Cross-triggering x x
CPU/FPGA Event Correlation x x
Compiler Tool Chains Linaro Tool Chain (Linux) x x x
GCC EABI (Bare-metal) X x x
ARM Pro Compiler x
Hardware Libraries Bare-metal programming Support x x x
SoC Programming
Golden System Reference Design x x x
Examples
ARM
http://ds.arm.com
Altera Edition
http://www.altera.com/devices/processor/arm/cortex-a9/software/proc-arm-
development-suite-5.html
SOCEDS
http://www.altera.com/literature/ug/ug_soc_eds.pdf
67
SoC Physical Address Map
68
Cyclone V & Arria V SoC HPS Physical Memory Map
L3 MPU FPGA
(Default) to SDRAM
4 GB
HPS Slaves H2F_LW HPS Slaves
0xFF20_0000 Slaves
0xC000_0000 3 GB
ACP Window
0x8000_0000 SDRAM 2 GB
SDRAM SDRAM
Region Region
1 GB
Boot Region
RAM/SDRAM RAM/ROM/SDRAM
0x0000_0000 0 GB
69
Arria 10 SoC HPS Physical Memory Map
L3 MPU FPGA
(Default) to SDRAM
4 GB
HPS Slaves H2F_LW HPS Slaves
0xFF20_0000 Slaves
0xC000_0000 3 GB
0x8000_0000 SDRAM 2 GB
SDRAM SDRAM
Region Region
1 GB
Boot Region
RAM/SDRAM RAM/ROM/SDRAM
0x0000_0000 0 GB
Remaps as
RAM & ROM or SDRAM
70
Arria 10 SoC HPS Physical Memory Map
0xC000_0000 3 GB
0x8000_0000 SDRAM 2 GB
ACP Window
SDRAM SDRAM
or
Region
SDRAM direct Region
1 GB
Boot Region
Boot Region RAM/ROM/SDRAM
0x0000_0000 0 GB
ACP/SDRAM selected
by AxCACHE
71
Physical Address Mapping
72
Physical Address Mapping
1 GB
0 GB
73
Physical Address Mapping
3 GB
2 GB
SDRAM
Region
1 GB
0 GB
74
Physical Address Mapping
75
Physical Address Mapping
F2H bandwidth to
SDRAM limited vs. ACP Window
FPGA to SDRAM bridge
SDRAM
Region
76
Cyclone V SoC Dev. Kit Memory Map Example
LED PIO
77
Golden Hardware Reference Design (GHRD)
3 GB
Undecoded 2 GB
Undecoded
1 GB
SDRAM SDRAM
Region SDRAM
Region
0 GB
79
Memory Map through Qsys
80
Memory Map through Qsys
It is connected to 3 Masters
81
Memory Map through Qsys
82
Altera SoC
Bare-Metal Software Development
Software For Bare-Metal Programming
Bare-Metal Compilers
Altera GCC EABI Compiler
ARM Pro compiler (also included as of SoC EDS 14.0.2)
84
Hardware Libs Usage
85
SoCAL Overview
86
Hardware Manager (HWMgr) Overview
87
APIs in HWLIBs HWMgr
88
Software Delivery
89
HWLIB Examples
Hello World
UART/Interrupt processing
FPGA Programming
Error Correction Code (ECC)
Web Server/Ethernet LWIP (through codetime.com)
Minimal Preloader (MPL) – Non-GPL Preloader
Many more examples available to download
http://www.altera.com/support/examples/soc/soc.html
90
HWLIB Examples – Minimal Preloader (MPL)
91
Learn More
SOCEDS
http://www.altera.com/literature/ug/ug_soc_eds.pdf
Bare metal compilers
Hardware libraries
http://www.altera.com/devices/processor/soc-fpga/overview/soc-overview-
sw.html
HWLIBS
https://www.altera.com/download/soc-eds/rtos-tools.jsp
HWLIBS examples
http://www.altera.com/support/examples/soc/soc.html
92
Altera SoC Linux Overview
Linux for Altera SoCs
Community Enablement
94
Altera SOC Linux Provides Customers Kernel Choices
95
Industry-leading Linux support
96
Altera SoC Linux Support Model
Rocketboards.org
SoC & Nios II Linux documentation
SoC & Nios II SoC Linux reference & example designs
97
Linux Resources
98
Linux Documentation Resources
GIT
Distributed revision control system to enable distributed collaboration
On-line documentation & training:
http://git-scm.com/doc
https://training.github.com
Free-Electrons:
Complete training materials posted free
http://free-electrons.com/docs/
99
Linux Documentation Resources
Yocto Project
https://www.yoctoproject.org/documentation
Angstrom Distribution
http://www.angstrom-distribution.org/
Open Embedded
http://www.openembedded.org/wiki/Main_Page
100
The Two Best Sources for Linux Development Information
101
The Two Best Sources for Linux Development Information
102
RocketBoards.org – Altera SoC Linux Community Portal
103
Learn More about SoCFPGA Linux
104
Altera SoC
Operating System Support
Embedded OS Availability
Development
Vendor OS/RTOS Available From
Tools
Open Source Linux (current and 3.10 LTSI) Linaro compiler rocketboards.org
Wind River Systems VxWorks 6.9.3 and 7.0 Wind River Workbench Wind River
Micriµm µC/OS-II, µC/OS-III GNU compiler Micriµm
Enea OSE 5.5.3 Optima 2.6 ENEA
Express Logic ThreadX G5.5.5.0 GNU compiler Express Logic
Wind River Systems Wind River Linux 5 and 7 Workbench/GNU Wind River
QNX QNX/Neutrino 6.5.3 and 6.6 Momentics QNX
Fujisoft Android GNU compiler Fujisoft
Green Hills INTEGRITY Multi/Green Hills Green Hills
DDC-I Deos DDC-I DDC-I
Code Time Multicore Abassi ARMCC/GCC Code Time
Mentor Nucleus GCC Mentor
eCosCentric ECOSPRO (eCos) GCC eCosCentric
106
Embedded OS Availability (page 2)
Development
Vendor OS/RTOS Available From
Tools
MRA Digital Android GCC MRA Digital
FreeRTOS RTE ARM DS-5 and GCC Freertos.org
Monta Vista CGE7 Linux Monta Vista/GCC Monta Vista
AUTOSAR AUTOSAR 4.0.3 MCAL Elektrobit Tresos Studio Altera
Microsoft Windows Embedded 7 Microsoft/Studio Coming
Quadros RTXC GCC Coming
rtems.org RTEMS GCC Coming
107
Embedded SW Operating System Ecosystem (Japan)
Development
Vendor OS/RTOS Availability
Tools
eSOL eT-Kernel (uITRON4.0) eBinder eSOL
eForce uC3 (uITRON 4.0) ARMCC/SoCEDS eForce
Toppers Toppers (uITRON extended) EDS/Toppers Toppers
Mispro NORTi(uITRON 4.0 standard) ARMCC Mispro
108
Broad JTAG Debugging Tools Support
Company Debugger
Altera USB Blaster II
Lauterbach Trace32
ARM DSTREAM
Wind River ICE II, Probe
Green Hills Probe
Yokogawa Digital Computer AdviceLUNA
Kyoto Microcomputer Partner-Jet
Computex PALMiCE3
Segger J-Link
iSystem Coming Soon
Ronetix PEEDI
109
OS support
List
http://www.altera.com/devices/processor/dev-tools/support/os-support.html
110
Preloader Generation
112
Generating the preloader
113
Bsp-editor - Choose Soc System
Select OK
114
Bsp-editor - Choose Next Boot location
115
Preloader - Advanced settings
Select Generate
Then at the embedded
prompt cd to the
directory and type
“make”
116
Build Preloader from the command line
bsp-create-settings \
--bsp-dir "./qspi_preloader" \
--preloader-settings-dir "$(SOCEDS_ROOT)/examples/hardware/cv_soc_devkit_ghrd/hps_isw_handoff/soc_system_hps_0" \
--settings "./qspi_preloader/settings.bsp" \
--type spl \
--set spl.CROSS_COMPILE arm-altera-eabi- \
--set spl.PRELOADER_TGZ "$(SOCEDS_ROOT)/host_tools/altera/preloader/uboot-socfpga.tar.gz" \
--set spl.boot.BOOTROM_HANDSHAKE_CFGIO 1 \
--set spl.boot.BOOT_FROM_QSPI 10\
--set spl.boot.BOOT_FROM_RAM 0 \
--set spl.boot.BOOT_FROM_SDMMC 1 \
--set spl.boot.CHECKSUM_NEXT_IMAGE 1 \
--set spl.boot.EXE_ON_FPGA 0 \
--set spl.boot.FPGA_DATA_BASE 0xffff0000 \
--set spl.boot.FPGA_DATA_MAX_SIZE 0x10000 \
--set spl.boot.FPGA_MAX_SIZE 0x10000 \
--set spl.boot.QSPI_NEXT_BOOT_IMAGE 0x60000 \
--set spl.boot.SDMMC_NEXT_BOOT_IMAGE 0x40000 \
--set spl.boot.STATE_REG_ENABLE 1 \
--set spl.boot.WARMRST_SKIP_CFGIO 1 \
--set spl.boot.WATCHDOG_ENABLE 0 \
--set spl.debug.DEBUG_MEMORY_ADDR 0xfffffd00 \
--set spl.debug.DEBUG_MEMORY_SIZE 0x200 \
--set spl.debug.DEBUG_MEMORY_WRITE 0 \
--set spl.debug.HARDWARE_DIAGNOSTIC 0 \
--set spl.debug.SEMIHOSTING 0 \
--set spl.debug.SKIP_SDRAM 0 \
--set spl.performance.SERIAL_SUPPORT 1 \
--set spl.reset_assert.DMA 0 \
--set spl.reset_assert.GPIO0 0 \
--set spl.reset_assert.GPIO1 0 \
--set spl.reset_assert.GPIO2 0 \
--set spl.reset_assert.L4WD1 0 \
--set spl.reset_assert.OSC1TIMER1 0 \
--set spl.reset_assert.SDR 0 \
--set spl.reset_assert.SPTIMER0 0 \
--set spl.reset_assert.SPTIMER1 0 \
--set spl.warm_reset_handshake.ETR 1 \
--set spl.warm_reset_handshake.FPGA 1 \
--set spl.warm_reset_handshake.SDRAM 0 \
--set spl.boot.SDRAM_SCRUBBING 1 \
--set spl.boot.SDRAM_SCRUB_BOOT_REGION_START 0x1000000 \
--set spl.boot.SDRAM_SCRUB_BOOT_REGION_END 0x3000000 \
--set spl.boot.SDRAM_SCRUB_REMAIN_REGION 1
make -C $(PRELOADER_DIR)
117
Preloader more info
Rocketboards
http://www.rocketboards.org/foswiki/Documentation/PreloaderUbootCusto
mization131
http://www.rocketboards.org/foswiki/Documentation/GSRD141Preloader
118
Uboot Generation
u-boot
Linux workshop
Altera SOC 2 day training.
u-boot can be downloaded from GitHub.org…
https://github.com/altera-opensource
http://www.rocketboards.org/foswiki/Documentation/GitGettingSTarted
120
Working With SD cards
Creating an SD card from GSRD Linux
122
Creating an SD card from GSRD Windows
123
http://www.rocketboards.org/foswiki/Documentation/GSRD
141SdCard Location File Name Description
Device Tree Blob
socfpga.dtb
file
FPGA
soc_system.rbf
configuration file
U-boot script for
Partition 1
u-boot.scr configuring
FPGA
Compressed
zImage Linux kernel
image file
Linux root
Partition 2 various
filesystem
n/a Preloader image
Partition 3
n/a U-boot image
124
Updating an SD Card Linux
The following table presents how each item can be updated individually:Replace in
the above command "sdx" with the device name of the SD card on your host system.
You can find out the device name by running $ cat /proc/partitions before and after
plugging in the card reader into the host.
File Update Procedure
zImage Mount /dev/sdx1 (FAT) on the host
soc_system.rbf machine and update files accordingly:
$ sudo mkdir sdcard
soc_system.dtb $ sudo mount /dev/sdx1 sdcard/
u-boot.scr $ sudo cp <file_name> sdcard/
$ sudo umount sdcard
preloader-mkpimage.bin $ sudo dd if=preloader-mkpimage.bin
of=/dev/sdx3 bs=64k seek=0
u-boot-socfpga_cyclone5.img $ sudo dd if=u-boot-
socfpga_cyclone5.img of=/dev/sdx3
bs=64k seek=4
root filesystem Mount /dev/sdx2 (ext3 FS) on the host
machine and updatefiles accordingly
125
Updating an SD Card Windows
126
System Console
System Console
Provides direct system access at
runtime from TCL command line
interface
No processor code to write
Access via Nios® II processor, JTAG bridge,
JTAG UART or custom Agent
Supports an Avalon-MM or Avalon-ST Master
Use for board bring-up, debug, diagnostics,
system profiling and configuration
FPGA
QSys Builder System
IP IP Nios II OCI System
USB Blaster Nios II IDE
Sys. Interconnect Console
SLD
IP Bridge JTAG
Hub
What is System Console?
System-level debug
Board bring-up and interface testing
System clock, reset and JTAG chain validity testing
Qsys component functionality testing
Loopback testing of Avalon Streaming interfaces
Provide test vectors, return responses
Poke and Peek at the address map.
System Console Interfaces
Avalon-MM Avalon-ST
Qsys Slave Source or Sink
Interconnect
User Component User Component
Usage Flow – Summary
GHRD has
multiple JTAG
Masters
To HPS
FPGA slaves
To SDRAM
(optional)
133
System Console Resources
134
Creating FPGA specific header
files
Creating FPGA-Specific Header Files
sopc-create-header-files <project>.sopcinfo
Creates a header file for each master in the qsys system.
Use in your software to keep everything up to date.
Call from an embedded command shell or in your own
make file.
136
Labs Overview
LABs Overview
*If you recompile the hardware in quartus you will need a full Quartus license or 60 day
eval license.
138
FFT Component is Composed of two items
The FFTmega core
An adapter to make it look standard Avalon-ST
139
FFT Flow
HPS
1- Processor Writes LW Bridge
wave form to Onchip
Memory Onchip Memory
SGDMA to FFT
FFT
HPS
1- Processor Writes LW Bridge
wave form to Onchip
Memory Onchip Memory
2- Processor Writes
Descriptor to SGDMAs
to start data flowing
SGDMA to FFT
FFT
HPS
1- Processor Writes LW Bridge
wave form to Onchip
Memory Onchip Memory
2- Processor Writes
Descriptor to SGDMAs
to start data flowing
3-SGDMAs move data SGDMA to FFT
through the FFT.
FFT
HPS
JTAG Master also has LW Bridge
access to all theses
peripherals so System Onchip Memory
Console can run the
FFT
SGDMA to FFT
FFT
HPS
1- Processor Writes LW Bridge
wave form to Onchip
Memory Onchip Memory
2- Processor Writes
Descriptor to SGDMAs
to start data flowing
3-SGDMAs move data SGDMA to FFT
through the FFT.
4-Processor reads the
FFT data back.
FFT
145
Lab 1 - preloader
146
Lab 2 - System Console FFT test
147
3- BareMetal FFT
Review code
Use the alt_read_word, alt_write_word to insure the code
does not get stuck in caches.
Compile in a embedded_command window
Paths to the hwlibs/socal and compilers
148
Lab 4- Linux FFT App
149
Lab 5 - Web Server FFT Background
150
Lab 4 – Web Server
152