DE10-Nano

From DaqWiki
Jump to navigation Jump to search

DE10-Nano

Links

Additional info

Board revisions

Per https://daq00.triumf.ca/nextcloud/index.php/s/trpnsXK5xKZdjYG#pdfviewer

  • revision A: -A0, EPCQ128
  • revision B: -B0, EPCQ128
  • revision B2: -B0, "17040025-XXXX”, EPCQ64
  • revision C: -C0, EPCQ64

Serial console

DE10-Nano has a built-in USB-serial adapter connected to the ARM CPU console.

Baud rate: 115200 (set in uboot env and in the linux kernel command line)

  • connect a mini-USB (*not* Micto-USB!) cable from mini-USB port on the side of the ethernet connection to a PC
  • "lsusb" will find a usb-serial adapter:
$ lsusb
...
Bus 001 Device 009: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
...
  • linux will create a ttyUSB device (see system messages if it did not happen)
$ ls -l /dev/ttyUSB*
crw-rw-rw- 1 root dialout 188, 0 Aug  8 17:12 /dev/ttyUSB0
minicom -D /dev/ttyUSB0 -b 115200

JTAG

DE10-Nano has a built-in USB blaster.

  • connect Mini-USB (*not* Micro-USB!) on the side of HDMI and power connectors to a PC
  • lsusb will show an altera usb-blaster device:
$ lsusb 
...
Bus 001 Device 008: ID 09fb:6010 Altera 
...
  • jtagconfig will find a usb-blaster and detect it is connected to a Cyclone5 SoC:
$ /daq/daqshare/olchansk/altera/17.1/quartus/bin/jtagconfig
1) DE-SoC [1-1.1]
  4BA00477   SOCVHPS
  02D020DD   5CSEBA6(.|ES)/5CSEMA6/..
  • open quartus, connect to this usb blaster, work it as usual.

JTAG load sof file

quartus_pgm -m JTAG -o "p;output_files/DE10_NANO_SoC_GHRD.sof@2"

Initial flash card

  • 8GB SD flash
  • Partitions
root@daq01:~/de10-nano# fdisk -l /dev/sdb
Disk /dev/sdb: 7.4 GiB, 7901020160 bytes, 15431680 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: 0x443b5867

Device     Boot  Start     End Sectors  Size Id Type
/dev/sdb1  *      6144  210943  204800  100M  c W95 FAT32 (LBA)
/dev/sdb2       210944 4700159 4489216  2.1G 83 Linux
/dev/sdb3         2048    6143    4096    2M a2 unknown

de10_nano_linux_console.img

partitions

root@daq01:~/de10-nano# fdisk -l /dev/sdb
Disk /dev/sdb: 7.4 GiB, 7901020160 bytes, 15431680 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: 0x55f3145b

Device     Boot   Start     End Sectors   Size Id Type
/dev/sdb1       2121728 3799447 1677720 819.2M  b W95 FAT32
/dev/sdb2         14336 2111487 2097152     1G 83 Linux
/dev/sdb3          2048    4095    2048     1M a2 unknown

boot messages

Welcome to minicom 2.7

OPTIONS: I18n 
Compiled on Feb  7 2016, 13:37:27.
Port /dev/ttyUSB0, 13:52:11

Press CTRL-A Z for help on special keys


U-Boot SPL 2013.01.01 (Oct 12 2016 - 10:38:03)
BOARD : Altera SOCFPGA Cyclone V Board
CLOCK: EOSC1 clock 25000 KHz
CLOCK: EOSC2 clock 25000 KHz
CLOCK: F2S_SDR_REF clock 0 KHz
CLOCK: F2S_PER_REF clock 0 KHz
CLOCK: MPU clock 925 MHz
CLOCK: DDR clock 400 MHz
CLOCK: UART clock 100000 KHz
CLOCK: MMC clock 50000 KHz
CLOCK: QSPI clock 3613 KHz
RESET: COLD
INFO : Watchdog enabled
SDRAM: Initializing MMR registers
SDRAM: Calibrating PHY
SEQ.C: Preparing to start memory calibration
SEQ.C: CALIBRATION PASSED
SDRAM: 1024 MiB
ALTERA DWMMC: 0


U-Boot 2013.01.01 (Oct 12 2016 - 10:40:34)

CPU   : Altera SOCFPGA Platform
BOARD : Altera SOCFPGA Cyclone V Board
I2C:   ready
DRAM:  1 GiB
MMC:   ALTERA DWMMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Skipped ethaddr assignment due to invalid EMAC address in EEPROM
Net:   mii0
Warning: failed to set MAC address

Hit any key to stop autoboot:  0 
reading u-boot.scr
200 bytes read in 4 ms (48.8 KiB/s)
## Executing script at 02000000
reading soc_system.rbf
** Unable to read file soc_system.rbf **
altera_load: Failed with error code -4
## Starting application at 0x3FF795A4 ...
## Application terminated, rc = 0x0
reading zImage
4686600 bytes read in 226 ms (19.8 MiB/s)
reading socfpga.dtb
25012 bytes read in 6 ms (4 MiB/s)
## Flattened Device Tree blob at 00000100
   Booting using the fdt blob at 0x00000100
   Loading Device Tree to 03ff6000, end 03fff1b3 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.5.0-00198-g6b20a29-dirty (terasic@ubuntu) (gcc version 5.2.1 20151005 (Linaro GCC7
[    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Terasic DE10 NANO
[    0.000000] Truncating RAM at 0x00000000-0x40000000 to -0x30000000
[    0.000000] Consider using a HIGHMEM enabled kernel.
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] PERCPU: Embedded 13 pages/cpu @ef9ca000 s21824 r8192 d23232 u53248
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 195072
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 769012K/786432K available (7339K kernel code, 487K rwdata, 1724K rodata, 520K init, 149K )
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc08e1ea8   (9064 kB)
[    0.000000]       .init : 0xc08e2000 - 0xc0964000   ( 520 kB)
[    0.000000]       .data : 0xc0964000 - 0xc09ddfc4   ( 488 kB)
[    0.000000]        .bss : 0xc09ddfc4 - 0xc0a037a8   ( 150 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] L2C: platform modifies aux control register: 0x02060000 -> 0x32460000
[    0.000000] L2C: platform provided aux values permit register corruption.
[    0.000000] L2C: DT/platform modifies aux control register: 0x02060000 -> 0x32460000
[    0.000000] L2C-310 erratum 769419 enabled
[    0.000000] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB
[    0.000000] L2C-310: CACHE_ID 0x410030c9, AUX_CTRL 0x46460001
[    0.000000] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604467 ns
[    0.000006] sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 21474836475ns
[    0.000017] Switching to timer-based delay loop, resolution 10ns
[    0.000387] Console: colour dummy device 80x30
[    0.000405] Calibrating delay loop (skipped), value calculated using timer frequency.. 200.00 BogoMIPS (lpj=1)
[    0.000418] pid_max: default: 32768 minimum: 301
[    0.000506] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000517] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.001030] CPU: Testing write buffer coherency: ok
[    0.001056] ftrace: allocating 22895 entries in 68 pages
[    0.036156] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.036408] Setting up static identity map for 0x8280 - 0x82d8
[    0.037772] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.037839] Brought up 2 CPUs
[    0.037852] SMP: Total of 2 processors activated (400.00 BogoMIPS).
[    0.037859] CPU: All CPU(s) started in SVC mode.
[    0.038534] devtmpfs: initialized
[    0.043676] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[    0.043937] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.044889] NET: Registered protocol family 16
[    0.045630] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.052486] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[    0.052498] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.081967] SCSI subsystem initialized
[    0.082231] usbcore: registered new interface driver usbfs
[    0.082295] usbcore: registered new interface driver hub
[    0.082350] usbcore: registered new device driver usb
[    0.082496] sopc@0:usbphy@0 supply vcc not found, using dummy regulator
[    0.083382] pps_core: LinuxPPS API ver. 1 registered
[    0.083392] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.083421] PTP clock support registered
[    0.083567] FPGA manager framework
[    0.084131] Bluetooth: Core ver 2.21
[    0.084187] NET: Registered protocol family 31
[    0.084195] Bluetooth: HCI device and connection manager initialized
[    0.084209] Bluetooth: HCI socket layer initialized
[    0.084219] Bluetooth: L2CAP socket layer initialized
[    0.084243] Bluetooth: SCO socket layer initialized
[    0.084850] clocksource: Switched to clocksource timer
[    0.122985] NET: Registered protocol family 2
[    0.123499] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.123569] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[    0.123675] TCP: Hash tables configured (established 8192 bind 8192)
[    0.123751] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.123795] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.123980] NET: Registered protocol family 1
[    0.124362] RPC: Registered named UNIX socket transport module.
[    0.124372] RPC: Registered udp transport module.
[    0.124378] RPC: Registered tcp transport module.
[    0.124384] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.124923] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
[    0.125760] futex hash table entries: 512 (order: 3, 32768 bytes)
[    0.134741] NFS: Registering the id_resolver key type
[    0.134851] Key type id_resolver registered
[    0.134860] Key type id_legacy registered
[    0.134917] ntfs: driver 2.1.32 [Flags: R/W].
[    0.135225] jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
[    0.138763] io scheduler noop registered (default)
[    0.143457] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.144433] console [ttyS0] disabled
[    0.144470] ffc02000.serial: ttyS0 at MMIO 0xffc02000 (irq = 28, base_baud = 6250000) is a 16550A
[    0.731555] console [ttyS0] enabled
[    0.736743] brd: module loaded
[    0.741896] CAN device driver interface
[    0.746124] socfpga-dwmac ff702000.ethernet: snps,phy-addr property is deprecated
[    0.753714] stmmac - user ID: 0x10, Synopsys ID: 0x37
[    0.758759]  Ring mode enabled
[    0.761800]  DMA HW capability register supported
[    0.766318]  Enhanced/Alternate descriptors
[    0.770665]  Enabled extended descriptors
[    0.774654]  RX Checksum Offload Engine supported (type 2)
[    0.780120]  TX Checksum insertion supported
[    0.784370]  Enable RX Mitigation via HW Watchdog Timer
[    0.790090] socfpga-dwmac ff702000.ethernet eth0: No MDIO subnode found
[    0.802194] libphy: stmmac: probed
[    0.805602] eth0: PHY ID 00221622 at 1 IRQ POLL (stmmac-0:01) active
[    0.812394] ffb40000.usb supply vusb_d not found, using dummy regulator
[    0.819041] ffb40000.usb supply vusb_a not found, using dummy regulator
[    1.104815] dwc2 ffb40000.usb: EPs: 16, dedicated fifos, 8064 entries in SPRAM
[    1.204898] dwc2 ffb40000.usb: DWC OTG Controller
[    1.209605] dwc2 ffb40000.usb: new USB bus registered, assigned bus number 1
[    1.216660] dwc2 ffb40000.usb: irq 40, io mem 0x00000000
[    1.222106] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.228880] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.236081] usb usb1: Product: DWC OTG Controller
[    1.240765] usb usb1: Manufacturer: Linux 4.5.0-00198-g6b20a29-dirty dwc2_hsotg
[    1.248050] usb usb1: SerialNumber: ffb40000.usb
[    1.253141] hub 1-0:1.0: USB hub found
[    1.256923] hub 1-0:1.0: 1 port detected
[    1.261481] usbcore: registered new interface driver usb-storage
[    1.267811] mousedev: PS/2 mouse device common for all mice
[    1.273628] i2c /dev entries driver
[    1.278013] usbcore: registered new interface driver bfusb
[    1.283541] usbcore: registered new interface driver btusb
[    1.289068] Synopsys Designware Multimedia Card Interface Driver
[    1.295224] dw_mmc ff704000.flash: supports-highspeed property is deprecated.
[    1.302401] dw_mmc ff704000.flash: IDMAC supports 32-bit address mode.
[    1.308944] dw_mmc ff704000.flash: Using internal DMA controller.
[    1.315026] dw_mmc ff704000.flash: Version ID is 240a
[    1.320091] dw_mmc ff704000.flash: DW MMC controller at irq 39,32 bit host data width,1024 deep fifo
[    1.329341] dw_mmc ff704000.flash: Got CD GPIO
[    1.364830] dw_mmc ff704000.flash: 1 slots initialized
[    1.370417] ledtrig-cpu: registered to indicate activity on CPUs
[    1.376593] usbcore: registered new interface driver usbhid
[    1.382140] usbhid: USB HID core driver
[    1.386211] fpga_manager fpga0: Altera SOCFPGA FPGA Manager registered
[    1.393264] altera_hps2fpga_bridge sopc@0:fpgabridge@0: fpga bridge [hps2fpga] registered
[    1.401633] altera_hps2fpga_bridge sopc@0:fpgabridge@1: fpga bridge [lwhps2fpga] registered
[    1.410163] altera_hps2fpga_bridge sopc@0:fpgabridge@2: fpga bridge [fpga2hps] registered
[    1.418669] altera_fpga2sdram_bridge sopc@0:fpgabridge@3: fpga bridge [fpga2sdram] registered
[    1.427171] altera_fpga2sdram_bridge sopc@0:fpgabridge@3: driver initialized with handoff 00000000
[    1.436522] oprofile: using arm/armv7-ca9
[    1.441576] NET: Registered protocol family 10
[    1.446710] sit: IPv6 over IPv4 tunneling driver
[    1.451897] NET: Registered protocol family 17
[    1.456373] NET: Registered protocol family 15
[    1.460801] can: controller area network core (rev 20120528 abi 9)
[    1.467012] NET: Registered protocol family 29
[    1.471443] can: raw protocol (rev 20120528)
[    1.475711] can: broadcast manager protocol (rev 20120528 t)
[    1.481353] can: netlink gateway (rev 20130117) max_hops=1
[    1.487085] Bluetooth: RFCOMM TTY layer initialized
[    1.491963] Bluetooth: RFCOMM socket layer initialized
[    1.497111] Bluetooth: RFCOMM ver 1.11
[    1.500856] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    1.506161] Bluetooth: BNEP filters: protocol multicast
[    1.511370] Bluetooth: BNEP socket layer initialized
[    1.516326] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    1.522223] Bluetooth: HIDP socket layer initialized
[    1.527223] 8021q: 802.1Q VLAN Support v1.8
[    1.531420] lib80211: common routines for IEEE802.11 drivers
[    1.537132] Key type dns_resolver registered
[    1.541470] ThumbEE CPU extension supported.
[    1.545747] Registering SWP/SWPB emulation handler
[    1.552065] of_cfs_init
[    1.554574] of_cfs_init: OK
[    1.559702] ttyS0 - failed to request DMA
[    1.563765] Waiting for root device /dev/mmcblk0p2...
[    1.593518] mmc_host mmc0: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
[    1.603275] mmc0: new high speed SDHC card at address 59b4
[    1.609161] mmcblk0: mmc0:59b4 SD    7.36 GiB 
[    1.614500]  mmcblk0: p1 p2 p3
[    1.675735] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[    1.699295] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.707410] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    1.721690] devtmpfs: mounted
[    1.725069] Freeing unused kernel memory: 520K (c08e2000 - c0964000)
[    1.939763] systemd[1]: Failed to insert module 'autofs4': Function not implemented
[    1.948482] systemd[1]: Failed to insert module 'ip_tables': Function not implemented
[    1.968051] random: systemd urandom read with 8 bits of entropy available
[    1.977552] systemd[1]: systemd 226 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSV)
[    1.995853] systemd[1]: Detected architecture arm.

Welcome to The �Ångstr�öm Distribution v2014.12!

[    2.015564] systemd[1]: Set hostname to <socfpga>.
[    2.302710] systemd[1]: bal_car.service: Cannot add dependency job, ignoring: Unit bal_car.service failed to .
[    2.318119] systemd[1]: Listening on networkd rtnetlink socket.
[  OK  ] Listening on networkd rtnetlink socket.
[    2.345118] systemd[1]: Listening on Journal Socket.
[  OK  ] Listening on Journal Socket.
[    2.365016] systemd[1]: Listening on udev Kernel Socket.
[  OK  ] Listening on udev Kernel Socket.
[    2.385100] systemd[1]: Created slice System Slice.
[  OK  ] Created slice System Slice.
[    2.435111] systemd[1]: Starting (null)...
         Starting (null)...
[    2.456404] systemd[1]: Mounting Debug File System...
         Mounting Debug File System...
[    2.486449] systemd[1]: Starting Remount Root and Kernel File Systems...
         Starting Remount Root and Kernel File Systems...
[    2.514859] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[    2.535758] systemd[1]: Created slice User and Session Slice.
[  OK  ] Created slice User and Session Slice.
[    2.555249] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[  OK  ] Started Dispatch Password Requests to Console Directory Watch.
[    2.575159] systemd[1]: Created slice system-serial\x2dgetty.slice.
[  OK  ] Created slice system-serial\x2dgetty.slice.
[    2.603891] systemd[1]: Reached target Swap.
[  OK  ] Reached target Swap.
[    2.625080] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
[    2.645112] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[  OK  ] Started Forward Password Requests to Wall Directory Watch.
[    2.665003] systemd[1]: Listening on Syslog Socket.
[  OK  ] Listening on Syslog Socket.
[    2.684923] systemd[1]: Reached target Paths.
[  OK  ] Reached target Paths.
[    2.704992] systemd[1]: Listening on Journal Socket (/dev/log).
[  OK  ] Listening on Journal Socket (/dev/log).
[    2.755246] systemd[1]: Starting Journal Service...
         Starting Journal Service...
[    2.776328] systemd[1]: Starting Setup Virtual Console...
         Starting Setup Virtual Console...
[    2.795374] systemd[1]: Created slice system-getty.slice.
[  OK  ] Created slice system-getty.slice.
[    2.816472] systemd[1]: Starting Apply Kernel Variables...
         Starting Apply Kernel Variables...
[    2.836659] systemd[1]: Mounting Configuration File System...
         Mounting Configuration File System...
[    2.855402] systemd[1]: Listening on udev Control Socket.
[  OK  ] Listening on udev Control Socket.
[    2.875004] systemd[1]: Reached target Slices.
[  OK  ] Reached target Slices.
[    2.887644] systemd-journald[707]: File /var/log/journal/15c23ce33f2948b3a0b09409f18dc8a2/system.journal corr.
[    2.904311] systemd[1]: Mounted Debug File System.
[  OK  ] Mounted Debug File System.
[    2.925263] systemd[1]: Mounted Configuration File System.
[  OK  ] Mounted Configuration File System.
[    2.945429] systemd[1]: Started Journal Service.
[  OK  ] Started Journal Service.
[  OK  ] Started (null).
[  OK  ] Started Remount Root and Kernel File Systems.
[  OK  ] Started Setup Virtual Console.
[  OK  ] Started Apply Kernel Variables.
         Starting udev Coldplug all Devices...
         Starting Load/Save Random Seed...
         Starting Create Static Device Nodes in /dev...
         Starting Flush Journal to Persistent Storage...
[  OK  ] Started Load/Save Random Seed.
[  OK  ] Started Create Static Device Nodes in /dev.
[    3.311780] systemd-journald[707]: Received request to flush runtime journal from PID 1
[  OK  ] Reached target Local File Systems (Pre).
[    3.404507] random: nonblocking pool is initialized
         Mounting /tmp...
         Starting udev Kernel Device Manager...
[  OK  ] Mounted /tmp.
[  OK  ] Started Flush Journal to Persistent Storage.
[  OK  ] Started udev Coldplug all Devices.
[  OK  ] Started udev Kernel Device Manager.
[  OK  ] Found device /dev/ttyS0.
[  OK  ] Reached target Local File Systems.
         Starting Create Volatile Files and Directories...
[  OK  ] Started Create Volatile Files and Directories.
         Starting Update UTMP about System Boot/Shutdown...
         Starting Network Time Synchronization...
[  OK  ] Started Update UTMP about System Boot/Shutdown.
[  OK  ] Started Network Time Synchronization.
[  OK  ] Reached target System Time Synchronized.
[  OK  ] Reached target System Initialization.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Reached target Timers.
[  OK  ] Listening on RPCbind Server Activation Socket.
         Starting sshd.socket.
         Starting Restore Sound Card State...
[  OK  ] Listening on Avahi mDNS/DNS-SD Stack Activation Socket.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Listening on sshd.socket.
[  OK  ] Started Restore Sound Card State.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
         Starting Connection service...
         Starting Login Service...
         Starting Avahi mDNS/DNS-SD Stack...
[  OK  ] Started System Logging Service.
[  OK  ] Started Kernel Logging Service.
[  OK  ] Started D-Bus System Message Bus.
[  OK  ] Started Avahi mDNS/DNS-SD Stack.
         Starting Network Service...
[  OK  ] Started Timestamping service.
         Starting Network Time Service (one-shot ntpdate mode)...
[  OK  ] Started Login Service.
[  OK  ] Started Network Service.
[  OK  ] Started Network Time Service (one-shot ntpdate mode).
[  OK  ] Reached target Network.
         Starting Target Communication Framework agent...
         Starting Network Name Resolution...
[  OK  ] Started Connection service.
[  OK  ] Reached target Remote File Systems.
         Starting Permit User Sessions...
[  OK  ] Started Network Name Resolution.
[  OK  ] Started Target Communication Framework agent.
[    5.037457] eth0: device MAC address ee:c0:c8:04:88:52
[  OK  ] Started Permit User Sessions.
         Starting WPA supplicant...
[    5.128624] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[  OK  ] Started Serial Getty on ttyS0.
[  OK  ] Started Getty on tty1.
[  OK  ] Reached target Login Prompts.
[  OK  ] Reached target Multi-User System.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Started WPA supplicant.
[  OK  ] Started Update UTMP about System Runlevel Changes.

.---O---.                                           
|       |                  .-.           o o        
|   |   |-----.-----.-----.| |   .----..-----.-----.
|       |     | __  |  ---'| '--.|  .-'|     |     |
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'
                -'  |
                '---'

The Angstrom Distribution socfpga ttyS0

uname -a

root@socfpga:~# uname -a
Linux socfpga 4.5.0-00198-g6b20a29-dirty #8 SMP Thu Apr 27 23:46:29 PDT 2017 armv7l GNU/Linux

/proc/cpuinfo

root@socfpga:~# cat /proc/cpuinfo 
processor       : 0
model name      : ARMv7 Processor rev 0 (v7l)
BogoMIPS        : 200.00
Features        : half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc09
CPU revision    : 0

processor       : 1
model name      : ARMv7 Processor rev 0 (v7l)
BogoMIPS        : 200.00
Features        : half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpd32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc09
CPU revision    : 0

Hardware        : Altera SOCFPGA
Revision        : 0000
Serial          : 0000000000000000
root@socfpga:~# 

benchmarks

memcpy

root@socfpga:~# g++ -O2 -Wall -Wuninitialized memcpy.cc -o memcpy
root@socfpga:~# ./memcpy 
memcpy       1 KiBytes:    999 MB/sec
memcpy       2 KiBytes:   1569 MB/sec
memcpy       4 KiBytes:   2172 MB/sec
memcpy       8 KiBytes:   2728 MB/sec
memcpy      16 KiBytes:   3118 MB/sec
memcpy      32 KiBytes:   2237 MB/sec
memcpy      64 KiBytes:   1503 MB/sec
memcpy     128 KiBytes:   1290 MB/sec
memcpy     256 KiBytes:    740 MB/sec
memcpy     512 KiBytes:    392 MB/sec
memcpy    1024 KiBytes:    355 MB/sec
memcpy    2048 KiBytes:    331 MB/sec
memcpy    4096 KiBytes:    312 MB/sec
memcpy    8192 KiBytes:    299 MB/sec
memcpy   16384 KiBytes:    298 MB/sec
memcpy   32768 KiBytes:    298 MB/sec
memcpy   65536 KiBytes:    297 MB/sec
memcpy  131072 KiBytes:    297 MB/sec
root@socfpga:~# 

ttcp

  • receive 100 Mbytes/sec
root@socfpga:~# ./ttcp -r -s
ttcp-r: buflen=8192, nbuf=2048, align=16384/0, port=5001  tcp
ttcp-r: socket
ttcp-r: accept from 192.168.1.1
ttcp-r: 819200000 bytes in 7.05 real seconds = 113525.45 KB/sec +++
ttcp-r: 106692 I/O calls, msec/call = 0.07, calls/sec = 15140.32
ttcp-r: 0.0user 3.2sys 0:07real 46% 0i+0d 718maxrss 0+2pf 18009+19csw
root@socfpga:~# 
  • transmit 95 Mbytes/sec
root@socfpga:~# ./ttcp -t -s 192.168.1.1 -n 100000
ttcp-t: buflen=8192, nbuf=100000, align=16384/0, port=5001  tcp  -> 192.168.1.1
ttcp-t: socket
ttcp-t: connect
ttcp-t: 819200000 bytes in 8.47 real seconds = 94484.25 KB/sec +++
ttcp-t: 100000 I/O calls, msec/call = 0.09, calls/sec = 11810.53
ttcp-t: 0.0user 1.7sys 0:08real 21% 0i+0d 718maxrss 0+2pf 1346+15csw
root@socfpga:~# 

example projects

Download DE10-Nano_v.1.3.1_HWrevC_SystemCD.zip, unzip, go into Demonstrations/SoC_FPGA, copy DE10_NANO_SoC_GHRD and HPS_FPGA_LED.

Together, they demonstrate how to flash the LEDs from the ARM CPU through the AXI bridge into the FPGA, into the qsys fabric into the PIO controller into the LEDs.

DE10_NANO_SoC_GHRD

  • go to the DE10_NANO_SoC_GHRD
  • go to output_files
  • copy fpga firmware to the ARM machine: scp DE10_NANO_SoC_GHRD.sof soc_system.rbf root@192.168.1.227:
  • this no longer works:
#!/bin/sh
echo 0 > /sys/class/fpga-bridge/hps2fpga/enable
echo 0 > /sys/class/fpga-bridge/fpga2hps/enable
echo 0 > /sys/class/fpga-bridge/lwhps2fpga/enable
dd if=/home/root/DE1_SoC_Computer.rbf of=/dev/fpga0 bs=1M
echo 1 > /sys/class/fpga-bridge/hps2fpga/enable
echo 1 > /sys/class/fpga-bridge/fpga2hps/enable
echo 1 > /sys/class/fpga-bridge/lwhps2fpga/enable
  • THIS DOES NOT WORK - now we have to do this:
   46  mkdir /config
   47  mount -t configfs configfs /config
   48  mkdir /config/device-tree/overlays/test
dtc -O dtb -o load_rbf.dtbo -b0 -I dts < load_rbf.dts
cp load_rbf.dtbo /lib/firmware
cp soc_system.rbf /lib/firmware/de10_soc.rbf
echo load_rbf.dtbo > /config/device-tree/overlays/test/path
root@socfpga:~# cat load_rbf.dts
/dts-v1/;
/plugin/;
/ {
fragment@0 {
target-path = "/soc/base-fpga-region";
#address-cells = <1>;
#size-cells = <1>;
overlay {
firmware-name = "de10_soc.rbf";
#address-cells = <1>;
#size-cells = <1>;
};
};
};
root@socfpga:~# 
daq01:~$ LD_LIBRARY_PATH=/daq/daqshare/olchansk/altera/17.1-EDS/qprogrammer/linux64 /daq/daqshare/olchansk/altera/17.1-EDS/qprogrammer/linux64/jtagconfig 
1) DE-SoC [1-2]
  4BA00477   SOCVHPS
  02D020DD   5CSEBA6(.|ES)/5CSEMA6/..
    • run jtag programmer
LD_LIBRARY_PATH=/daq/daqshare/olchansk/altera/17.1-EDS/qprogrammer/linux64 /daq/daqshare/olchansk/altera/17.1-EDS/qprogrammer/linux64/quartus_pgm -c 1 -m JTAG -o "p;DE10_NANO_SoC_GHRD.sof@2"
  • if sof file loaded correctly, all LEDs will turn on, one LED will flash.

HPS_FPGA_LED

  • Download SoCEDSSetup-17.1.0.590-linux.run
  • Run it, select installation into /daq/daqshare/olchansk/altera/17.1-EDS
  • cd 17.1-EDS/embedded/ds-5_installer, run install.sh
  • Run it, select installation into /daq/daqshare/olchansk/altera/DS-5_v5.27.1
  • (select "skip steps that require root permissions").
  • go to the HPS_FPGA_LED project
  • /daq/daqshare/olchansk/altera/DS-5_v5.27.1/bin/suite_exec sh
  • make SOCEDS_ROOT=/daq/daqshare/olchansk/altera/17.1-EDS/embedded
  • HPS_FPGA_LED will be created
  • copy it to the ARM machine: scp HPS_FPGA_LED root@192.168.1.240:
  • go to the ARM machine, run it. (ARM machine will freeze, no ping)
  • if sof file is loaded, the program will run and flash the LEDs

booting FPGA from EPCS64

Per table 3-2, change the SW10 MSEL pins:

Board orientation is:

  • power connector on the left, eth connector on the right
  • switch position is "up" is "on"; "down" is "off"
on-off-on-off-on-on -> default -> configure from HPS
on-on-on-on-on-on -> configure from HPS
on-off-on-on-off-on -> configure from EPCS64

boot Linux from SD flash

  • take a new 32 GB flash card
  • create 3 partitions: fpga boot partition (contains u-boot), u-boot partition (contains the linux kernel) and the linux userland partition
fdisk -l /dev/sdb
[root@armdaq07 ~]# fdisk -l

Disk /dev/mmcblk0: 31.9 GB, 31914983424 bytes, 62333952 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
Disk label type: dos
Disk identifier: 0xddcde1b7

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            2048        4095        1024   a2  Unknown
/dev/mmcblk0p2            4096     1681816      838860+   b  W95 FAT32
/dev/mmcblk0p3         1683456    62333951    30325248   83  Linux
[root@armdaq07 ~]# 
  • copy the images:
# ls -l /daq/daqstore/olchansk/daq/DE10-Nano/*.img
-rw-r--r-- 1 olchansk users 1945317376 Jun 26  2017 /daq/daqshare/olchansk/DE10-Nano/de10_nano_linux_console.img
-rw-r--r-- 1 olchansk users    1048576 Aug  8 17:30 /daq/daqshare/olchansk/DE10-Nano/image-1-fpga.img
-rw-r--r-- 1 olchansk users  858992640 Aug  8 17:30 /daq/daqshare/olchansk/DE10-Nano/image-2-uboot.img
# dd if=/daq/daqstore/olchansk/daq/DE10-Nano/image-1-fpga.img of=/dev/sdX1  bs=1024k
# dd if=/daq/daqstore/olchansk/daq/DE10-Nano/image-2-uboot.img of=/dev/sdX2  bs=1024k
  • move sdflash card from PC to DE10-Nano
  • start the serial console (see above)
  • cycle the power or reset the DE10-Nano to boot from sd flash
  • on the serial console, you will get the u-boot prompt
  • run "saveenv"
SOCFPGA_CYCLONE5 # saveenv
Saving Environment to MMC...
Writing to MMC(0)... done
SOCFPGA_CYCLONE5 # 
  • change boot partitions:
SOCFPGA_CYCLONE5 # setenv mmcloadpart 2
SOCFPGA_CYCLONE5 # setenv mmcroot /dev/mmcblk0p3
SOCFPGA_CYCLONE5 # setenv callscript 'if fatload mmc 0:2 $fpgadata $scriptfile;then source $fpgadata; else echo Optional boot script not found. Continuing to boot normally; fi;'
SOCFPGA_CYCLONE5 # saveenv
  • set MAC address (the DE10-Nano board has no MAC address chip, so MAC address has to be assigned manually. Use addresses that start with "02:x:x:x:x:x", see "Locally Administered Address Ranges"
SOCFPGA_CYCLONE5 # setenv ethaddr 02:aa:bb:cc:dd:ee
SOCFPGA_CYCLONE5 # saveenv
  • examine result, save and reboot
SOCFPGA_CYCLONE5 # printenv            
...
SOCFPGA_CYCLONE5 # saveenv
Saving Environment to MMC...
Writing to MMC(0)... done
SOCFPGA_CYCLONE5 # 
SOCFPGA_CYCLONE5 # reset
resetting ...
  • the linux kernel should boot, fail to find the root filesystem ("VFS: Unable to mount root fs")
  • move the SD flash card back to the PC
  • create the linux root filesystem
mke2fs -t ext4 -O ^huge_file /dev/sdb3
mount /dev/sdb3 /mnt/tmp
#rsync -av /ladd/data0/backup.os/armdaq05/ /mnt/tmp/
rsync -av /daq/daqshare/olchansk/DE10-Nano/image-3-chronobox/ /mnt/tmp/
sync
  • set the IP address
cd /mnt/tmp/etc/sysconfig/network-scripts
emacs -nw ifcfg-eth0

to read this: (change IPADDR=x.x.x.x as required)

TYPE=Ethernet
BOOTPROTO=none
DNS1=142.90.100.19
DOMAIN=triumf.ca
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
#NAME=static
#UUID=fba7e7fa-0403-4fd6-965e-778e7af0dd99
ONBOOT=yes
#IPADDR=142.90.111.143
IPADDR=142.90.121.107
PREFIX=19
GATEWAY=142.90.100.18
  • eject SD flash card, move it to the DE10-Nano
cd /
umount /dev/sdb3
eject /dev/sdb
  • try to boot

boot Linux from network

uboot version: U-Boot 2013.01.01

  • fw_printenv
  • remember old bootcmd: bootcmd=run callscript; run mmcload; run mmcboot
  • remember old bootargs: bootargs=console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait
  • fw_setenv bootcmd 'run bridge_enable_handoff; run netboot'
  • fw_setenv ramboot bootz \${loadaddr} - \${fdtaddr}
  • remember to set the MAC address, there is no MAC eeprom!
  • fw_setenv ethaddr 02:aa:bb:cc:dd:01 ### see chronobox page about chronobox MAC assignements
  • fw_setenv bootargs console=ttyS0,115200 ip=dhcp root=/dev/nfs rw nfsroot=192.168.1.1:/zssd/nfsroot/%s,vers=3 panic=15

an even older old bootargs:

  • setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p3 rw rootwait panic=15

update april 2022

root@cb03:~# /home/agdaq/packages/libubootenv/build/src/fw_printenv  | grep ^ethaddr
ethaddr=02:aa:bb:cc:cb:03
root@cb03:~# /home/agdaq/packages/libubootenv/build/src/fw_printenv  | grep ^bootcmd
bootcmd=run bridge_enable_handoff; run netboot
root@cb03:~# /home/agdaq/packages/libubootenv/build/src/fw_printenv  | grep ^netboot
netboot=dhcp ${bootimage} ; tftp ${fdtaddr} ${fdtimage} ; run ramboot
root@cb03:~# /home/agdaq/packages/libubootenv/build/src/fw_printenv  | grep ^ramboot
ramboot=bootz ${loadaddr} - ${fdtaddr}

u-boot environment access from linux

use fw_printenv from above

/dev/mmcblk0		0x200		0x1000
  • fw_printenv should work (it should NOT print "Warning: Bad CRC, using default environment" as the very first line)

Example: set MAC address from Linux:

fw_setenv ethaddr 02:aa:bb:cc:dd:01
fw_printenv | grep ethaddr=
ethaddr=02:aa:bb:cc:dd:01

Install busybox

For reasons unclear the "devmem" command (part of busybox) is missing from the centos7 userland image. To install it, do this:

wget https://busybox.net/downloads/binaries/1.28.1-defconfig-multiarch/busybox-armv7r
file busybox-armv7r 
chmod a+x ./busybox-armv7r 
./busybox-armv7r 
./busybox-armv7r devmem

FPGA bridge access magic

special magic may be needed to enabled /dev/mem access to the FPGA bridge, per https://lists.rocketboards.org/pipermail/rfi/2015-August/003259.html

HI,

By default the bridges will only allow privileged accesses in Arria 10.  At
this time i am not aware of any way to adjust this from linux space, but it
is entirely configurable from a uboot prompt.

In:    serial
Out:   serial
Err:   serial
Model: SOCFPGA Arria10 Dev Kit
Net:   dwmac.ff800000
Hit any key to stop autoboot:  0
SOCFPGA_ARRIA10 #
SOCFPGA_ARRIA10 #
SOCFPGA_ARRIA10 # mw.l 0xFFD13500 0x1
SOCFPGA_ARRIA10 # mw.l 0xFFD13504 0x1
SOCFPGA_ARRIA10 # mw.l 0xFFD11004 0xffffffff
SOCFPGA_ARRIA10 # md.l 0xFFD0502C 1
ffd0502c: 0000003f                               ?...
SOCFPGA_ARRIA10 # mw.l 0xFFD0502C 0x3C
SOCFPGA_ARRIA10 # md.l 0xFFD0502C 1
ffd0502c: 0000003c                               <...
SOCFPGA_ARRIA10 # md.l 0xc0000000 10
c0000000: 00000000 00000000 00000000 00000000    ................
c0000010: 00000000 00000000 00000000 00000000    ................
c0000020: 00000000 00000000 00000000 00000000    ................
c0000030: 00000000 00000000 00000000 00000000    ................
SOCFPGA_ARRIA10 #

the above could easily be added to a uboot script and run automatically at
boot.

In linux, you can then


root at arria10:~# devmem --help
BusyBox v1.22.1 (2015-05-31 18:07:25 UTC) multi-call binary.

Usage: devmem ADDRESS [WIDTH [VALUE]]

Read/write from physical address

        ADDRESS Address to act upon
        WIDTH   Width (8/16/...)
        VALUE   Data to be written

root at arria10:~# devmem 0xc0000000 32 0xdeadbeef
root at arria10:~# devmem 0xc0000000 32
0xDEADBEEF
root at arria10:~#

to test unprivileged accesses.

--dalon

Load FPGA from Linux

THIS DOES NOT WORK.

from here: https://forum.rocketboards.org/t/load-fpga-rbf-from-device-tree-overlay-example/999/16

Finally, I found a working solution:

load_rbf.dts:

/dts-v1/;
/plugin/;
/ {
fragment@0 {
target-path = "/soc/base-fpga-region";
#address-cells = <1>;
#size-cells = <1>;
overlay {
firmware-name = "de10_soc.rbf";
#address-cells = <1>;
#size-cells = <1>;
};
};
};

dtc -O dtb -o load_rbf.dtbo -b 0 -@ load_rbf.dts

Copy load_rbf.dtbo and de10_soc.rbf to /lib/firmware

mount -t configfs configfs /config
rmdir /config/device-tree/overlays/test
mkdir /config/device-tree/overlays/test
echo load_rbf.dtbo > /config/device-tree/overlays/test/path

The magic command is:
devmem 0xff800000 32 0x00000019

I really don’t know what this does. However, by looking at how the bridge is enabled in u-boot:

#bridge_enable_handoff=mw $fpgaintf ${fpgaintf_handoff}; go $fpga2sdram_apply; mw $fpga2sdram ${fpga2sdram_handoff}; mw $axibridge ${axibridge_handoff}; mw $l3remap ${l3remap_handoff}

#mw $fpgaintf ${fpgaintf_handoff};
#fpgaintf=ffd08028
#fpgaintf_handoff=0x00000000
->devmem 0xffd08028 32 0x00000000

#go $fpga2sdram_apply;
->??

#mw $fpga2sdram ${fpga2sdram_handoff};
#fpga2sdram=ffc25080
#fpga2sdram_handoff=0x00000000
->devmem 0xffc25080 32 0x00000000

#mw $axibridge ${axibridge_handoff};
#axibridge=ffd0501c
#axibridge_handoff=0x00000000
->devmem 0xffd0501c 32 0x00000000

#mw $l3remap ${l3remap_handoff}
#l3remap=ff800000
#l3remap_handoff=0x00000019
->devmem 0xff800000 32 0x00000019

I found that this register needs to be written to 0x19 and then there is no bus error any more.



How to load RBF file from Linux kernel 4.1 on DE10-Nano SoC
2

THE ABOVE DOES NOT WORK: echo load_rbf.dtbo > /config/device-tree/overlays/test/path BOMBS.

from here: https://forum.rocketboards.org/t/rbf-with-overlay/1800

Hi, this issue is resolved by adding following change in
arch/arm/boot/dts/socfpga.dtsi

base_fpga_region: base-fpga-region {
compatible = “fpga-region”;
fpga-mgr = <&fpgamgr0>;
fpga-bridges = <&fpga_bridge0>;

                    #address-cells = <0x1>;
                    #size-cells = <0x1>;
            };
modifying

Build Linux kernel

zzz