Wednesday, March 6, 2024

Buildroot for the ARC HS Development Kit (Part2)

Based on Buildroot 2023.02.1, the build process is quite smooth.

[ ]$ wget --no-check-certificate https://buildroot.org/downloads/buildroot-2023.02.1.tar.gz
[ ]$ tar zxvf buildroot-2023.02.1.tar.gz
[ ]$ cd buildroot-2023.02.1
[ ]$ make snps_archs38_hsdk_defconfig
[ ]$ make menuconfig
[ ]$ make

Result of the build

[ ]$ tree output/images/
output/images/
├── boot.vfat
├── rootfs.ext2
├── rootfs.ext4 -> rootfs.ext2
├── sdcard.img
├── u-boot
├── u-boot.bin
├── uboot-env.bin
└── uImage

Boot message in Minicom Console

Linux version 5.16.0 (shu@e560p) (arc-buildroot-linux-gnu-gcc.br_real (Buildroot 2023.02.1) 10.2.0, GNU ld (GNU Binutils) 2.34.50.20200611) #1 SM4
Memory @ 80000000 [1024M]
OF: fdt: Machine model: snps,hsdk
earlycon: uart8250 at MMIO32 0xf0005000 (options '115200n8')
printk: bootconsole [uart8250] enabled
Failed to get possible-cpus from dtb, pretending all 4 cpus exist
archs-intc : 2 priority levels (default 1) FIRQ (not used)

IDENTITY : ARCVER [0x52] ARCNUM [0x0] CHIPID [ 0x0]
processor [0] : HS38 R2.1 (ARCv2 ISA)
Timers : Timer0 Timer1 RTC [UP 64-bit] GFRC [SMP 64-bit]
ISA Extn : atomic ll64 unalign mpy[opt 9] div_rem
BPU : full match, cache:2048, Predict Table:16384 Return stk: 8
MMU [v4] : 8k PAGE, 2M Super Page (not used) , swalk 2 lvl, JTLB 1024 (256x4), uDTLB 8, uITLB 4, PAE40 (not used)
I-Cache : 64K, 4way/set, 64B Line, VIPT aliasing
D-Cache : 64K, 2way/set, 64B Line, PIPT
SLC : 512K, 128B Line
Peripherals : 0xf0000000, IO-Coherency (per-device)
Vector Table : 0x90000000
FPU : SP DP
DEBUG : smaRT RTT ActionPoint 8/min
Extn [SMP] : ARConnect (v2): 4 cores with IPI IDU DEBUG GFRC
Zone ranges:
Normal [mem 0x0000000080000000-0x00000000bfffffff]
Movable zone start for each node
Early memory node ranges
node 0: [mem 0x0000000080000000-0x00000000bfffffff]
Initmem setup node 0 [mem 0x0000000080000000-0x00000000bfffffff]
percpu: Embedded 6 pages/cpu s15360 r8192 d25600 u49152
pcpu-alloc: s15360 r8192 d25600 u49152 alloc=6*8192
pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
Built 1 zonelists, mobility grouping on. Total pages: 130496
Kernel command line: earlycon=uart8250,mmio32,0xf0005000,115200n8 console=ttyS0,115200n8 debug print-fatal-signals=1 root=/dev/mmcblk0p2 rootwait
Dentry cache hash table entries: 131072 (order: 6, 524288 bytes, linear)
Inode-cache hash table entries: 65536 (order: 5, 262144 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 1033520K/1048576K available (5549K kernel code, 636K rwdata, 1384K rodata, 152K init, 272K bss, 15056K reserved, 0K cma-reserved)
rcu: Preemptible hierarchical RCU implementation.
rcu: RCU event tracing is enabled.
Trampoline variant of Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
NR_IRQS: 512
MCIP: IDU supports 64 common irqs
sched_clock: 64 bits at 999MHz, resolution 1ns, wraps every 4398046511103ns
clocksource: ARConnect GFRC: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
Console: colour dummy device 80x25
Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 0, 8192 bytes, linear)
Mountpoint-cache hash table entries: 2048 (order: 0, 8192 bytes, linear)
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
Idle Task [1] (ptrval)
Trying to bring up CPU1 ...
archs-intc : 2 priority levels (default 1) FIRQ (not used)

IDENTITY : ARCVER [0x52] ARCNUM [0x1] CHIPID [ 0x0]
processor [1] : HS38 R2.1 (ARCv2 ISA)
Timers : Timer0 Timer1 RTC [UP 64-bit]
ISA Extn : atomic ll64 unalign mpy[opt 9] div_rem
BPU : full match, cache:2048, Predict Table:16384 Return stk: 8
MMU [v4] : 8k PAGE, 2M Super Page (not used) , swalk 2 lvl, JTLB 1024 (256x4), uDTLB 8, uITLB 4, PAE40 (not used)
I-Cache : 64K, 4way/set, 64B Line, VIPT aliasing
D-Cache : 64K, 2way/set, 64B Line, PIPT
SLC : 512K, 128B Line
Peripherals : 0xf0000000, IO-Coherency (per-device)
Vector Table : 0x90000000
FPU : SP DP
DEBUG : smaRT RTT ActionPoint 8/min
Extn [CCM] : DCCM @ 60000000, 256 KB / ICCM: @ 60000000, 256 KB
Extn [SMP] : ARConnect (v2): 4 cores with IPI IDU DEBUG GFRC
## CPU1 LIVE ##: Executing Code...
Idle Task [2] (ptrval)
Trying to bring up CPU2 ...
archs-intc : 2 priority levels (default 1) FIRQ (not used)

IDENTITY : ARCVER [0x52] ARCNUM [0x2] CHIPID [ 0x0]
processor [2] : HS38 R2.1 (ARCv2 ISA)
Timers : Timer0 Timer1 RTC [UP 64-bit]
ISA Extn : atomic ll64 unalign mpy[opt 9] div_rem
BPU : full match, cache:2048, Predict Table:16384 Return stk: 8
MMU [v4] : 8k PAGE, 2M Super Page (not used) , swalk 2 lvl, JTLB 1024 (256x4), uDTLB 8, uITLB 4, PAE40 (not used)
I-Cache : 64K, 4way/set, 64B Line, VIPT aliasing
D-Cache : 64K, 2way/set, 64B Line, PIPT
SLC : 512K, 128B Line
Peripherals : 0xf0000000, IO-Coherency (per-device)
Vector Table : 0x90000000
FPU : SP DP
DEBUG : smaRT RTT ActionPoint 8/min
Extn [SMP] : ARConnect (v2): 4 cores with IPI IDU DEBUG GFRC
## CPU2 LIVE ##: Executing Code...
Idle Task [3] (ptrval)
Trying to bring up CPU3 ...
archs-intc : 2 priority levels (default 1) FIRQ (not used)

IDENTITY : ARCVER [0x52] ARCNUM [0x3] CHIPID [ 0x0]
processor [3] : HS38 R2.1 (ARCv2 ISA)
Timers : Timer0 Timer1 RTC [UP 64-bit]
ISA Extn : atomic ll64 unalign mpy[opt 9] div_rem
BPU : full match, cache:2048, Predict Table:16384 Return stk: 8
MMU [v4] : 8k PAGE, 2M Super Page (not used) , swalk 2 lvl, JTLB 1024 (256x4), uDTLB 8, uITLB 4, PAE40 (not used)
I-Cache : 64K, 4way/set, 64B Line, VIPT aliasing
D-Cache : 64K, 2way/set, 64B Line, PIPT
SLC : 512K, 128B Line
Peripherals : 0xf0000000, IO-Coherency (per-device)
Vector Table : 0x90000000
FPU : SP DP
DEBUG : smaRT RTT ActionPoint 8/min
Extn [CCM] : DCCM @ 60000000, 256 KB / ICCM: @ 60000000, 256 KB
Extn [SMP] : ARConnect (v2): 4 cores with IPI IDU DEBUG GFRC
## CPU3 LIVE ##: Executing Code...
smp: Brought up 1 node, 4 CPUs
devtmpfs: initialized
random: get_random_u32 called from rhashtable_init+0xbc/0x288 with crng_init=0
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 1024 (order: 4, 131072 bytes, linear)
NET: Registered PF_NETLINK/PF_ROUTE protocol family
DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
thermal_sys: Registered thermal governor 'step_wise'
reg-fixed-voltage regulator-5v0: use noncoherent DMA ops
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
clocksource: Switched to clocksource ARConnect GFRC
NET: Registered PF_INET protocol family
IP idents hash table entries: 16384 (order: 4, 131072 bytes, linear)
tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 12288 bytes, linear)
TCP established hash table entries: 8192 (order: 2, 32768 bytes, linear)
TCP bind hash table entries: 8192 (order: 3, 65536 bytes, linear)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 1, 16384 bytes, linear)
UDP-Lite hash table entries: 512 (order: 1, 16384 bytes, linear)
NET: Registered PF_UNIX/PF_LOCAL protocol family
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
arc-pct pct: use noncoherent DMA ops
ARC perf : 8 counters (48 bits), 113 conditions
workingset: timestamp_bits=30 max_order=17 bucket_order=0
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
io scheduler mq-deadline registered
io scheduler kyber registered
simple-pm-bus soc: use noncoherent DMA ops
random: fast init done
snps-creg-gpio f00014b0.gpio: use noncoherent DMA ops
snps-creg-gpio f00014b0.gpio: GPIO controller with 2 gpios probed
gpio-dwapb f0003000.gpio: use noncoherent DMA ops
gpio-dwapb f0003000.gpio: no IRQ for port0
dw_axi_dmac_platform f0080000.dmac: use noncoherent DMA ops
dw_axi_dmac_platform f0080000.dmac: DesignWare AXI DMA Controller, 4 channels
hsdk-reset f00008a0.reset-controller: use noncoherent DMA ops
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
dw-apb-uart f0005000.serial: use noncoherent DMA ops
printk: console [ttyS0] disabled
f0005000.serial: ttyS0 at MMIO 0xf0005000 (irq = 6, base_baud = 2083125) is a 16550A
printk: console [ttyS0] enabled
printk: console [ttyS0] enabled
printk: bootconsole [uart8250] disabled
printk: bootconsole [uart8250] disabled
usbcore: registered new interface driver udl
etnaviv-gpu f0090000.gpu: use noncoherent DMA ops
(null): use noncoherent DMA ops
etnaviv etnaviv: bound f0090000.gpu (ops 0x905cd900)
etnaviv-gpu f0090000.gpu: model: GC880, revision: 5124
[drm] Initialized etnaviv 1.3.0 20151214 for etnaviv on minor 0
brd: module loaded
dw_spi_mmio f0020000.spi: use noncoherent DMA ops
spi-nor spi0.0: sst26wf016b (2048 Kbytes)
libphy: Fixed MDIO Bus: probed
stmmaceth f0008000.ethernet: use coherent DMA ops
stmmaceth f0008000.ethernet: IRQ eth_wake_irq not found
stmmaceth f0008000.ethernet: IRQ eth_lpi not found
stmmaceth f0008000.ethernet: PTP uses main clock
stmmaceth f0008000.ethernet: User ID: 0x10, Synopsys ID: 0x37
stmmaceth f0008000.ethernet: DWMAC1000
stmmaceth f0008000.ethernet: DMA HW capability register supported
stmmaceth f0008000.ethernet: RX Checksum Offload Engine supported
stmmaceth f0008000.ethernet: COE Type 2
stmmaceth f0008000.ethernet: TX Checksum insertion supported
stmmaceth f0008000.ethernet: Normal descriptors
stmmaceth f0008000.ethernet: Ring mode enabled
stmmaceth f0008000.ethernet: Enable RX Mitigation via HW Watchdog Timer
stmmaceth f0008000.ethernet: device MAC address 0e:ba:db:6c:95:56
libphy: stmmac: probed
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-platform: EHCI generic platform driver
ehci-platform f0040000.ehci: use coherent DMA ops
ehci-platform f0040000.ehci: EHCI Host Controller
ehci-platform f0040000.ehci: new USB bus registered, assigned bus number 1
ehci-platform f0040000.ehci: irq 15, io mem 0xf0040000
ehci-platform f0040000.ehci: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-platform: OHCI generic platform driver
ohci-platform f0060000.ohci: use coherent DMA ops
ohci-platform f0060000.ohci: Generic Platform OHCI controller
ohci-platform f0060000.ohci: new USB bus registered, assigned bus number 2
ohci-platform f0060000.ohci: irq 15, io mem 0xf0060000
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
usbcore: registered new interface driver usb-storage
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
Synopsys Designware Multimedia Card Interface Driver
dw_mmc f000a000.mmc: use coherent DMA ops
sdhci-pltfm: SDHCI platform and OF driver helper
dw_mmc f000a000.mmc: IDMAC supports 32-bit address mode.
usbcore: registered new interface driver usbhid
dw_mmc f000a000.mmc: Using internal DMA controller.
usbhid: USB HID core driver
dw_mmc f000a000.mmc: Version ID is 290a
NET: Registered PF_INET6 protocol family
dw_mmc f000a000.mmc: DW MMC controller at irq 12,32 bit host data width,16 deep fifo
Segment Routing with IPv6
In-situ OAM (IOAM) with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered PF_PACKET protocol family
mmc_host mmc0: Bus speed (slot 0) = 50000000Hz (slot req 400000Hz, actual 396825HZ div = 63)
dw-apb-uart f0005000.serial: forbid DMA for kernel console
Waiting for root device /dev/mmcblk0p2...
mmc_host mmc0: Bus speed (slot 0) = 50000000Hz (slot req 25000000Hz, actual 25000000HZ div = 1)
mmc0: new SDHC card at address 0007
blk_queue_max_segment_size: set to minimum 8192
mmcblk0: mmc0:0007 SD4GB 3.68 GiB
mmcblk0: p1 p2
usb 1-1: new high-speed USB device number 2 using ehci-platform
EXT4-fs (mmcblk0p2): recovery complete
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: disabled.
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel image (initmem) memory: 152K
This architecture does not have kernel memory protection.
Run /sbin/init as init process
with arguments:
/sbin/init
with environment:
HOME=/
TERM=linux
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 2 ports detected
EXT4-fs (mmcblk0p2): re-mounted. Opts: (null). Quota mode: disabled.
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Saving 2048 bits of non-creditable seed for next boot
Starting network: stmmaceth f0008000.ethernet eth0: PHY [stmmac-0:00] driver [Micrel KSZ9031 Gigabit PHY] (irq=POLL)
stmmaceth f0008000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
stmmaceth f0008000.ethernet eth0: No Safety Features support found
stmmaceth f0008000.ethernet eth0: PTP not supported by HW
stmmaceth f0008000.ethernet eth0: configuring for phy/rgmii-id link mode
udhcpc: started, v1.36.0
udhcpc: broadcasting discover
stmmaceth f0008000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
udhcpc: no lease, forking to background
OK

Welcome to the HSDK Platform
hsdk login: root
# ifconfig
eth0 Link encap:Ethernet HWaddr 0E:BA:DB:6C:95:56
inet addr:192.168.7.120 Bcast:192.168.7.255 Mask:255.255.255.0
inet6 addr: fe80::cba:dbff:fe6c:9556/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:84 errors:0 dropped:4 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8561 (8.3 KiB) TX bytes:1270 (1.2 KiB)
Interrupt:10 Base address:0x8000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

# ping 168.95.1.1
PING 168.95.1.1 (168.95.1.1): 56 data bytes
64 bytes from 168.95.1.1: seq=0 ttl=55 time=6.020 ms
64 bytes from 168.95.1.1: seq=1 ttl=55 time=19.687 ms
^C
--- 168.95.1.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 6.020/12.853/19.687 ms
#

Buildroot for the ARC HS Development Kit

Linux distribution for the ARC HS Development Kit (HSDK) Here

[ ]$ wget --no-check-certificate https://github.com/foss-for-synopsys-dwc-arc-processors/buildroot/archive/arc-2017.11-hsdk-release.tar.gz

[ ]$ tar zxvf arc-2017.11-hsdk-release.tar.gz

[ ]$ cd buildroot-arc-2017.11-hsdk-release

Select the default configuration for the target:

[ ]$ make snps_hsdk_defconfig

Optional: modify the configuration:

[ ]$ make menuconfig

PS. Deselect perf option under Kernel/Linux Kernel Tools (Compilation issue)

Build: 

[ ]$ make

PS. During the build process, all downloaded source tarballs are saved in the dl directory.

After fixing a few issues ... Result of the build

[ ]$ tree output/images/
output/images/
├── boot.vfat
├── hsdk.dtb
├── rootfs.ext2
├── rootfs.ext4 -> rootfs.ext2
├── sdcard.img
├── sdcard.img.gz
├── u-boot
├── u-boot.bin
├── uboot.env
├── u-boot.head
└── uImage

Copy the image file to the SD Card

[ ]$ dd if=output/images/sdcard.img of=/dev/mmcblk0 bs=1M status=progress oflag=direct

Boot Message in Minicom Console

U-Boot 2017.11 (Jan 29 2018 - 17:01:45 +0300)

DRAM:  1 GiB
Relocation Offset is: 3ef67000
MMC:   Synopsys Mobile storage: 0
reading uboot.env
In:    serial0@f0005000
Out:   serial0@f0005000
Err:   serial0@f0005000
Clock values are saved to environment
Net:
Warning: ethernet@f0008000 (eth0) using random MAC address - 6a:ae:81:c6:de:95
eth0: ethernet@f0008000
Hit any key to stop autoboot:  0
reading uImage
3783300 bytes read in 166 ms (21.7 MiB/s)
reading hsdk.dtb
3491 bytes read in 4 ms (851.6 KiB/s)
## Booting kernel from Legacy Image at 82000000 ...
   Image Name:   Linux-4.14.7
   Image Type:   ARC Linux Kernel Image (gzip compressed)
   Data Size:    3783236 Bytes = 3.6 MiB
   Load Address: 90000000
   Entry Point:  90004000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 81000000
   Booting using the fdt blob at 0x81000000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to bfd5d000, end bfd60da2 ... OK
CPU start mask is 0xf

Starting kernel ...

Linux version 4.14.7 (shu@e560p) (gcc version 7.1.1 20170710 (Buildroot 2017.11)) #1 SMP PREEMPT Wed Mar 6 13:58:01 CST 2024
Memory @ 80000000 [1024M]
OF: fdt: Machine model: snps,hsdk
archs-intc      : 2 priority levels (default 1) FIRQ (not used)

IDENTITY        : ARCVER [0x52] ARCNUM [0x0] CHIPID [ 0x0]
processor [0]   : ARC HS38 R2.1 (ARCv2 ISA)
Timers          : Timer0 Timer1 RTC [UP 64-bit] GFRC [SMP 64-bit]
ISA Extn        : atomic ll64 unalign (not used)
                : mpy[opt 9] div_rem norm barrel-shift swap minmax swape
BPU             : full match, cache:2048, Predict Table:16384
MMU [v4]        : 8k PAGE, 2M Super Page (not used) JTLB 1024 (256x4), uDTLB 8, uITLB 4, PAE40 (not used)
I-Cache         : 64K, 4way/set, 64B Line, VIPT aliasing
D-Cache         : 64K, 2way/set, 64B Line, PIPT
SLC             : 512K, 128B Line
Peripherals     : 0xf0000000, IO-Coherency
Vector Table    : 0x90000000
FPU             : SP DP
DEBUG           : ActionPoint smaRT RTT
OS ABI [v4]     : 64-bit data any register aligned
Extn [SMP]      : ARConnect (v2): 4 cores with IPI IDU DEBUG GFRC
Enable CONFIG_ARC_HAS_ACCL_REGS for working apps
percpu: Embedded 7 pages/cpu @bff9e000 s25088 r8192 d24064 u57344
Built 1 zonelists, mobility grouping on.  Total pages: 130496
Kernel command line: console=ttyS0,115200n8 root=/dev/mmcblk0p2 rootwait
PID hash table entries: 4096 (order: 1, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 6, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 5, 262144 bytes)
Memory: 773256K/1048576K available (5014K kernel code, 270K rwdata, 920K rodata, 152K init, 286K bss, 275320K reserved, 0K cma-reserved)
Preemptible hierarchical RCU implementation.
        Tasks RCU enabled.
NR_IRQS: 512
MCIP: IDU supports 64 common irqs
clocksource: ARConnect GFRC: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
Console: colour dummy device 80x25
Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 0, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 0, 8192 bytes)
Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
Idle Task [1] bf04ba80
Trying to bring up CPU1 ...
archs-intc      : 2 priority levels (default 1) FIRQ (not used)

IDENTITY        : ARCVER [0x52] ARCNUM [0x1] CHIPID [ 0x0]
processor [1]   : ARC HS38 R2.1 (ARCv2 ISA)
Timers          : Timer0 Timer1 RTC [UP 64-bit]
ISA Extn        : atomic ll64 unalign (not used)
                : mpy[opt 9] div_rem norm barrel-shift swap minmax swape
BPU             : full match, cache:2048, Predict Table:16384
MMU [v4]        : 8k PAGE, 2M Super Page (not used) JTLB 1024 (256x4), uDTLB 8, uITLB 4, PAE40 (not used)
I-Cache         : 64K, 4way/set, 64B Line, VIPT aliasing
D-Cache         : 64K, 2way/set, 64B Line, PIPT
SLC             : 512K, 128B Line
Peripherals     : 0xf0000000, IO-Coherency
Vector Table    : 0x90000000
FPU             : SP DP
DEBUG           : ActionPoint smaRT RTT
Extn [CCM]      : DCCM @ 80000000, 256 KB / ICCM: @ 70000000, 256 KB
OS ABI [v4]     : 64-bit data any register aligned
Extn [SMP]      : ARConnect (v2): 4 cores with IPI IDU DEBUG GFRC
Enable CONFIG_ARC_HAS_ACCL_REGS for working apps
## CPU1 LIVE ##: Executing Code...
Idle Task [2] bf04b540
Trying to bring up CPU2 ...
archs-intc      : 2 priority levels (default 1) FIRQ (not used)

IDENTITY        : ARCVER [0x52] ARCNUM [0x2] CHIPID [ 0x0]
processor [2]   : ARC HS38 R2.1 (ARCv2 ISA)
Timers          : Timer0 Timer1 RTC [UP 64-bit]
ISA Extn        : atomic ll64 unalign (not used)
                : mpy[opt 9] div_rem norm barrel-shift swap minmax swape
BPU             : full match, cache:2048, Predict Table:16384
MMU [v4]        : 8k PAGE, 2M Super Page (not used) JTLB 1024 (256x4), uDTLB 8, uITLB 4, PAE40 (not used)
I-Cache         : 64K, 4way/set, 64B Line, VIPT aliasing
D-Cache         : 64K, 2way/set, 64B Line, PIPT
SLC             : 512K, 128B Line
Peripherals     : 0xf0000000, IO-Coherency
Vector Table    : 0x90000000
FPU             : SP DP
DEBUG           : ActionPoint smaRT RTT
OS ABI [v4]     : 64-bit data any register aligned
Extn [SMP]      : ARConnect (v2): 4 cores with IPI IDU DEBUG GFRC
Enable CONFIG_ARC_HAS_ACCL_REGS for working apps
## CPU2 LIVE ##: Executing Code...
Idle Task [3] bf04b000
Trying to bring up CPU3 ...
archs-intc      : 2 priority levels (default 1) FIRQ (not used)

IDENTITY        : ARCVER [0x52] ARCNUM [0x3] CHIPID [ 0x0]
processor [3]   : ARC HS38 R2.1 (ARCv2 ISA)
Timers          : Timer0 Timer1 RTC [UP 64-bit]
ISA Extn        : atomic ll64 unalign (not used)
                : mpy[opt 9] div_rem norm barrel-shift swap minmax swape
BPU             : full match, cache:2048, Predict Table:16384
MMU [v4]        : 8k PAGE, 2M Super Page (not used) JTLB 1024 (256x4), uDTLB 8, uITLB 4, PAE40 (not used)
I-Cache         : 64K, 4way/set, 64B Line, VIPT aliasing
D-Cache         : 64K, 2way/set, 64B Line, PIPT
SLC             : 512K, 128B Line
Peripherals     : 0xf0000000, IO-Coherency
Vector Table    : 0x90000000
FPU             : SP DP
DEBUG           : ActionPoint smaRT RTT
Extn [CCM]      : DCCM @ 80000000, 256 KB / ICCM: @ 70000000, 256 KB
OS ABI [v4]     : 64-bit data any register aligned
Extn [SMP]      : ARConnect (v2): 4 cores with IPI IDU DEBUG GFRC
Enable CONFIG_ARC_HAS_ACCL_REGS for working apps
## CPU3 LIVE ##: Executing Code...
smp: Brought up 1 node, 4 CPUs
devtmpfs: initialized
random: get_random_u32 called from rhashtable_init+0x11a/0x284 with crng_init=0
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 1024 (order: 3, 65536 bytes)
NET: Registered protocol family 16
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
clocksource: Switched to clocksource ARConnect GFRC
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 2, 32768 bytes)
TCP bind hash table entries: 8192 (order: 3, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 1, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 1, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
ARC perf        : 8 counters (48 bits), 113 conditions
workingset: timestamp_bits=30 max_order=17 bucket_order=0
random: fast init done
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
io scheduler mq-deadline registered
io scheduler kyber registered
usbcore: registered new interface driver udlfb
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
console [ttyS0] disabled
f0005000.serial: ttyS0 at MMIO 0xf0005000 (irq = 6, base_baud = 2083125) is a 16550A
console [ttyS0] enabled
libphy: Fixed MDIO Bus: probed
stmmaceth f0008000.ethernet: PTP uses main clock
stmmac - user ID: 0x10, Synopsys ID: 0x37
stmmaceth f0008000.ethernet: Ring mode enabled
stmmaceth f0008000.ethernet: DMA HW capability register supported
stmmaceth f0008000.ethernet: Normal descriptors
stmmaceth f0008000.ethernet: RX Checksum Offload Engine supported
stmmaceth f0008000.ethernet: COE Type 2
stmmaceth f0008000.ethernet: TX Checksum insertion supported
stmmaceth f0008000.ethernet: Enable RX Mitigation via HW Watchdog Timer
libphy: stmmac: probed
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-platform: EHCI generic platform driver
ehci-platform f0040000.ehci: EHCI Host Controller
ehci-platform f0040000.ehci: new USB bus registered, assigned bus number 1
ehci-platform f0040000.ehci: irq 15, io mem 0xf0040000
ehci-platform f0040000.ehci: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-platform: OHCI generic platform driver
ohci-platform f0060000.ohci: Generic Platform OHCI controller
ohci-platform f0060000.ohci: new USB bus registered, assigned bus number 2
ohci-platform f0060000.ohci: irq 15, io mem 0xf0060000
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
usbcore: registered new interface driver usb-storage
IR NEC protocol handler initialized
IR RC5(x/sz) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
IR SANYO protocol handler initialized
IR Sharp protocol handler initialized
IR MCE Keyboard/mouse protocol handler initialized
IR XMP protocol handler initialized
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
Synopsys Designware Multimedia Card Interface Driver
dw_mmc f000a000.mmc: 'num-slots' was deprecated.
dw_mmc f000a000.mmc: IDMAC supports 32-bit address mode.
dw_mmc f000a000.mmc: Using internal DMA controller.
dw_mmc f000a000.mmc: Version ID is 290a
dw_mmc f000a000.mmc: DW MMC controller at irq 12,32 bit host data width,16 deep fifo
mmc_host mmc0: Bus speed (slot 0) = 50000000Hz (slot req 400000Hz, actual 396825HZ div = 63)
sdhci-pltfm: SDHCI platform and OF driver helper
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 10
Segment Routing with IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
ttyS0 - failed to request DMA
Waiting for root device /dev/mmcblk0p2...
usb 1-1: new high-speed USB device number 2 using ehci-platform
mmc_host mmc0: Bus speed (slot 0) = 50000000Hz (slot req 25000000Hz, actual 25000000HZ div = 1)
mmc0: new SDHC card at address 0007
blk_queue_max_segment_size: set to minimum 8192
mmcblk0: mmc0:0007 SD4GB 3.68 GiB
 mmcblk0: p1 p2
EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 2 ports detected
random: crng init done
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 152K
This architecture does not have kernel memory protection.
EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
Starting logging: OK
Initializing random number generator... done.
Starting network: stmmaceth f0008000.ethernet eth0: device MAC address 7e:f7:c5:69:03:97
Micrel KSZ9031 Gigabit PHY stmmac-0:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=stmmac-0:00, irq=POLL)
stmmaceth f0008000.ethernet eth0: PTP not supported by HW
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
udhcpc: started, v1.27.2
udhcpc: sending discover
stmmaceth f0008000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
udhcpc: sending discover
udhcpc: sending select for 192.168.7.179
udhcpc: lease of 192.168.7.179 obtained, lease time 864000
deleting routers
adding dns 192.168.7.9
adding dns 192.168.7.8
OK
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
Starting sshd: OK

Welcome to the HSDK Platform
hsdk login: root
# ifconfig
eth0      Link encap:Ethernet  HWaddr 7E:F7:C5:69:03:97
          inet addr:192.168.7.179  Bcast:192.168.7.255  Mask:255.255.255.0
          inet6 addr: fe80::7cf7:c5ff:fe69:397/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:435 errors:0 dropped:20 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:36096 (35.2 KiB)  TX bytes:1340 (1.3 KiB)
          Interrupt:10 Base address:0x8000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

# ping 168.95.1.1
PING 168.95.1.1 (168.95.1.1): 56 data bytes
64 bytes from 168.95.1.1: seq=0 ttl=55 time=6.185 ms
64 bytes from 168.95.1.1: seq=1 ttl=55 time=8.870 ms
^C
--- 168.95.1.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 6.185/7.527/8.870 ms
#

Reference

Building-and-Running-ARC-Linux-for-HSDK

Monday, March 4, 2024

ARC HS Development Kit

HSDK Board


Debugger

  • Ashling Opella-XD
Installation on Ubuntu 22.04.3 LTS

[ ]$ sudo apt-get install gcc-multilib
[ ]$ sudo apt-get install libqt5widgets5 [ ]$ sudo apt-get install libqt5widgets5:i386
[ ]$ sudo apt-get install libusb-1.0-0:i386


Using the JTAG low-level console

[ ]$ opxddiag --list
[ ]$ ash-arc-gdb-server --jtag-console-mode --device arc-hs

Load U-boot

[ ]$ mdb -DLL=opxdarc \
     -prop=jtag_frequency=12MHz \
     -prop=jtag_optimise=1 \
     -nooptions -run -cl -memxfersize=0x8000 u-boot
 
  • Digilent JTAG-HS2

[ ] $ djtgcfg enum
Found 2 device(s)

Device: JtagHs2
    Device Transport Type: 00020001 (USB)
    Product Name:          Digilent JTAG-HS2
    User Name:             JtagHs2
    Serial Number:         ooxxooxxooxxooxx

Device: HSDK
    Device Transport Type: 00020001 (USB)
    Product Name:          DesignWare ARC SDP
    User Name:             HSDK
    Serial Number:         ooxxooxxooxxooxx

Load U-boot

[ ]$ mdb -digilent -cl -run u-boot


Minicom Console

U-Boot 2024.01-rc3 (Nov 24 2023 - 17:37:03 +0800)

CPU:   ARC HS38 v2.1c at 500 MHz
Model: snps,hsdk
Board: Synopsys ARC HS Development Kit
U-Boot autostart: enabled
DRAM:  1 GiB
Core:  20 devices, 16 uclasses, devicetree: embed
Relocation Offset is: 3ef91000
MMC:   mmc0@f000a000: 0
Loading Environment from FAT... MMC: no card present
** Bad device specification mmc 0 **
In:    serial0@f0005000
Out:   serial0@f0005000
Err:   serial0@f0005000
Clock values are saved to environment
Net:
Warning: ethernet@f0008000 (eth0) using random MAC address - 2a:99:60:c5:a4:2c
eth0: ethernet@f0008000
hsdk#