NetBSD on the EdgeRouter Lite
Frederic Cambus January 29, 2021 [NetBSD] [MIPS64]NetBSD-current now has pre-built octeon bootable images (which will appear in NetBSD 10.0) for the evbmips port, so I decided to finally give it a try. I've been happily running OpenBSD/octeon on my EdgeRouter Lite for a few years now, and have previously published some notes including more detail about the CPU.
Contrary to the OpenBSD/octeon port which is very stable and runs SMP kernels, things are a little less polished on the NetBSD side for this platform. The system runs an uniprocessor kernel and there are still some stability issues.
Here is the U-Boot configuration to boot the image:
Octeon ubnt_e100# set bootcmd 'fatload usb 0 $loadaddr netbsd;bootoctlinux $loadaddr coremask=0x3 root=wedge:octeon-root'
Octeon ubnt_e100# saveenv
Saving Environment to Flash...
Un-Protected 1 sectors
Erasing Flash...
. done
Erased 1 sectors
Writing to Flash... 4....3....2....1....done
Protected 1 sectors
Octeon ubnt_e100#
On first boot, the system automatically expands the filesystem:
Resizing / (NAME=octeon-root)
/dev/rdk1: grow cg |************************************* | 69%
Here is the login session, for posterity:
Thu Jan 28 23:40:37 UTC 2021
NetBSD/evbmips (octeon) (constty)
login:
Here is the output of running file on executables:
ELF 32-bit MSB pie executable, MIPS, N32 MIPS-III version 1 (SYSV), dynamically
linked, interpreter /libexec/ld.elf_so, for NetBSD 9.99.79, not stripped
For the record, OpenSSL speed benchmark results are available here.
System message buffer (dmesg output):
[ 1.000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
[ 1.000000] 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
[ 1.000000] 2018, 2019, 2020, 2021 The NetBSD Foundation, Inc. All rights reserved.
[ 1.000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[ 1.000000] The Regents of the University of California. All rights reserved.
[ 1.000000] NetBSD 9.99.79 (OCTEON) #0: Thu Jan 28 18:52:43 UTC 2021
[ 1.000000] mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbmips/compile/OCTEON
[ 1.000000] Cavium Octeon CN5020-500
[ 1.000000] total memory = 512 MB
[ 1.000000] avail memory = 496 MB
[ 1.000000] timecounter: Timecounters tick every 10.000 msec
[ 1.000000] mainbus0 (root)
[ 1.000000] cpunode0 at mainbus0: 2 cores, crypto+kasumi, 64bit-mul, unaligned-access ok
[ 1.000000] cpu0 at cpunode0 core 0: 500.00MHz
[ 1.000000] cpu0: Cavium CN5020-500 (0xd0601) Rev. 1 with software emulated floating point
[ 1.000000] cpu0: 64 TLB entries, 512TB (49-bit) VAs, 512TB (49-bit) PAs, 256MB max page size
[ 1.000000] cpu0: 32KB/128B 4-way set-associative L1 instruction cache
[ 1.000000] cpu0: 16KB/128B 64-way set-associative write-through coherent L1 data cache
[ 1.000000] cpu0: 128KB/128B 8-way set-associative write-back L2 unified cache
[ 1.000000] cpu1 at cpunode0 core 1: disabled (uniprocessor kernel)
[ 1.000000] wdog0 at cpunode0: default period is 4 seconds
[ 1.000000] iobus0 at mainbus0
[ 1.000000] iobus0: initializing POW
[ 1.000000] iobus0: initializing FPA
[ 1.000000] com0 at iobus0 address 0x0001180000000800: ns16650, no ERS, 16-byte FIFO
[ 1.000000] com0: console
[ 1.000000] com at iobus0 address 0x0001180000000c00 not configured
[ 1.000000] octrnm0 at iobus0 address 0x0001180040000000
[ 1.000000] entropy: ready
[ 1.000000] octtwsi at iobus0 address 0x0001180000001000 not configured
[ 1.000000] octmpi at iobus0 address 0x0001070000001000 not configured
[ 1.000000] octsmi0 at iobus0 address 0x0001180000001800
[ 1.000000] octpip0 at iobus0 address 0x00011800a0000000
[ 1.000000] octgmx0 at octpip0
[ 1.000000] cnmac0 at octgmx0: address=0x1180008000000: RGMII
[ 1.000000] cnmac0: Ethernet address 44:d9:e7:9e:f5:9e
[ 1.000000] atphy0 at cnmac0 phy 7: Atheros AR8035 10/100/1000 PHY, rev. 2
[ 1.000000] atphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseSX-FDX, 1000baseT-FDX, auto
[ 1.000000] cnmac1 at octgmx0: address=0x1180008000000: RGMII
[ 1.000000] cnmac1: Ethernet address 44:d9:e7:9e:f5:9f
[ 1.000000] atphy1 at cnmac1 phy 6: Atheros AR8035 10/100/1000 PHY, rev. 2
[ 1.000000] atphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseSX-FDX, 1000baseT-FDX, auto
[ 1.000000] cnmac2 at octgmx0: address=0x1180008000000: RGMII
[ 1.000000] cnmac2: Ethernet address 44:d9:e7:9e:f5:a0
[ 1.000000] atphy2 at cnmac2 phy 5: Atheros AR8035 10/100/1000 PHY, rev. 2
[ 1.000000] atphy2: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseSX-FDX, 1000baseT-FDX, auto
[ 1.000000] dwctwo0 at iobus0 address 0x0001180068000000
[ 1.000000] dwctwo0: Core Release: 2.65a (snpsid=4f54265a)
[ 1.000000] usb0 at dwctwo0: USB revision 2.0
[ 1.000000] bootbus0 at mainbus0
[ 1.000000] timecounter: Timecounter "mips3_cp0_counter" frequency 500000000 Hz quality 100
[ 1.000003] timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
[ 1.059978] uhub0 at usb0: NetBSD (0x0000) DWC2 root hub (0x0000), class 9/0, rev 2.00/1.00, addr 1
[ 1.059978] uhub0: 1 port with 1 removable, self powered
[ 1.069975] aes: BearSSL aes_ct
[ 1.069975] aes_ccm: self-test passed
[ 1.069975] chacha: Portable C ChaCha
[ 1.079979] blake2s: self-test passed
[ 3.609971] umass0 at uhub0 port 1 configuration 1 interface 0
[ 3.620226] umass0: vendor 13fe (0x13fe) USB DISK 2.0 (0x4200), rev 2.00/1.00, addr 2
[ 3.620226] umass0: using SCSI over Bulk-Only
[ 3.620226] scsibus0 at umass0: 2 targets, 1 lun per target
[ 3.632383] uhub0: autoconfiguration error: illegal enable change, port 1
[ 3.639974] sd0 at scsibus0 target 0 lun 0: <, USB DISK 2.0, PMAP> disk removable
[ 3.639974] sd0: 3824 MB, 959 cyl, 255 head, 32 sec, 512 bytes/sect x 7831552 sectors
[ 3.659974] sd0: GPT GUID: 6e7b1b6a-2e9f-4915-946a-567dad0caaa4
[ 3.669969] dk0 at sd0: "octeon-boot", 163840 blocks at 32768, type: ntfs
[ 3.669969] dk1 at sd0: "octeon-root", 7626752 blocks at 196608, type: ffs
[ 3.683879] WARNING: 1 error while detecting hardware; check system log.
[ 3.691430] boot device: sd0
[ 3.691430] root on dk1
[ 3.709975] root file system type: ffs
[ 3.719976] kern.module.path=/stand/evbmips/9.99.79/modules
[ 3.719976] WARNING: no TOD clock present
[ 3.729990] WARNING: using filesystem time
[ 3.734057] WARNING: CHECK AND RESET THE DATE!