CNS11XX FreeBSD port completed

Yohanes Nugroho yohanes at gmail.com
Fri Dec 11 14:27:48 UTC 2009


Hi,

Today I have "completed" the CNS11XX (Cavium Econa ARM formerly known
as StarSemi STR9104) FreeBSD ARM Port. By "complete" I mean I have
written all the drivers (usb, network, and flash). I haven't checked
the correctness of the implementation. The device is a network
attached storage, Emprex NSD-100, sent to me by Bruce Simpson.

This is my first FreeBSD port, so I think there will be mistakes on my
code. So I am requesting anyone who have time to have a look at the
code, or if you have the same device, may be you can try it. You will
need to solder a serial port to the device to try it.

>From the usability point of view, the port is usable. I can put the
FreeBSD kernel to the flash, and boot it from there with the root
filesystem on a USB disk (the boot loader also supports booting from
tftp, and during the development I boot using tftp). The device can
enter multi user mode, and I can ssh/ftp to the device, and compile
some things on the device itself.

The only problem left (at least what is visible from user space) is
the slow network speed (2 megabyte per second, while the linux version
is around 3.8 megabyte per second). Pyun YongHyeon have helped me a
lot with the network driver (I am currently asking him to have a final
look at the driver). I have tried following all of his suggestions to
make a better (more correct driver), and I suspect the problem is not
on the network driver itself.

I am suspecting that the problem is in pmap. There has been several
pmap related problems lately (see
http://lists.freebsd.org/pipermail/freebsd-arm/2009-October/002030.html).
It is also possible that the pmap code is now fine, and I have made
errors when porting the NetBSD CPU code for FA526 to FreeBSD.

If I compile my current code with the latest code from HEAD, and
activated WITNESS and DIAGNOSTIC i will get the error at err-1.txt,
and  If I activated WITNESS, DIAGNOSTIC and INVARIANT i got this the
message in err-2.txt. With the same options I didn't get this error
several months ago .

My code is available at

http://p4db.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/projects/str91xx/src/sys/arm/econa&HIDEDEL=NO

plus additional code from to support FA526 CPU adapted from NetBSD:

http://p4db.freebsd.org/fileLogView.cgi?FSPC=//depot/projects/str91xx/src/sys/arm/arm/cpufunc_asm_fa526.S
http://p4db.freebsd.org/fileViewer.cgi?FSPC=//depot/projects/str91xx/src/sys/arm/arm/cpufunc.c

Instruction to compile, and write to flash using dd to cfi0 is available at:

http://tinyhack.com/2009/09/28/cnx11xxstr91xx-freebsd-progress/
http://tinyhack.com/2009/12/11/cns11xx-freebsd-port-completed/

-- 
Regards
Yohanes
http://yohan.es/
-------------- next part --------------
------
start_init: trying /sbin/init
lock order reversal:
 1st 0xc19e00b0 pmap (pmap) @ arm/arm/pmap.c:929
 2nd 0xc140a6c0 vm page queue mutex (vm page queue mutex) @ arm/arm/pmap.c:1656
KDB: stack backtrace:
_end() at 0xe3e01000
scp=0xe3e01000 rlv=0xe59b0000 (0xe59b0000)
	rsp=0xe24cb004 rfp=0xe92dd800lock order reversal:
 1st 0xc19e00b0 pmap (pmap) @ arm/arm/pmap.c:1916
 2nd 0xc14a405c system map (system map) @ vm/vm_map.c:3532
KDB: stack backtrace:
_end() at 0xe3e01000
scp=0xe3e01000 rlv=0xe59b0000 (0xe59b0000)
	rsp=0xe24cb004 rfp=0xe92dd800
vm_fault(0xc14a4000, e3e00000, 1, 0) -> 1
Fatal kernel mode data abort: 'Translation Fault (S)'
trapframe: 0xc67932d4
FSR=00000005, FAR=e3e00ff4, spsr=60000013
r0 =0000001e, r1 =00000000, r2 =00000000, r3 =00000000
r4 =e3e01000, r5 =c11f21f0, r6 =ffffffff, r7 =c199c110
r8 =fffffffe, r9 =fffffff4, r10=c11f21e4, r11=c6793358
r12=00000000, ssp=c6793320, slr=c1201658, pc =c11f20c8

[thread pid 1 tid 100001 ]
Stopped at      db_md_set_watchpoint+0xb8:      ldr     r7, [r9, r4]
db> 
------
-------------- next part --------------
ugen0.1: <Cavium> at usbus0
uhub0: <Cavium OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ugen1.1: <Cavium> at usbus1
uhub1: <Cavium EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
uhub0: 2 ports with 2 removable, self powered
uhub1: 2 ports with 2 removable, self powered
lock order reversal:
 1st 0xc144c8d4 pmap (pmap) @ arm/arm/pmap.c:2941
 2nd 0xc14de608 PV ENTRY (UMA zone) @ vm/uma_core.c:2526
KDB: stack backtrace:
_end() at 0xe3e01000
scp=0xe3e01000 rlv=0xe59b0000 (0xe59b0000)
	rsp=0xe24cb004 rfp=0xe92dd800lock order reversal:
 1st 0xc144c8d4 pmap (pmap) @ arm/arm/pmap.c:2941
 2nd 0xc14dc05c system map (system map) @ vm/vm_map.c:3532
KDB: stack backtrace:
_end() at 0xe3e01000
scp=0xe3e01000 rlv=0xe59b0000 (0xe59b0000)
	rsp=0xe24cb004 rfp=0xe92dd800
vm_fault(0xc14dc000, e3e00000, 1, 0) -> 1
Fatal kernel mode data abort: 'Translation Fault (S)'
trapframe: 0xc6c19270
FSR=00000005, FAR=e3e00ff4, spsr=60000013
r0 =0000001e, r1 =00000000, r2 =00000000, r3 =00000000
r4 =e3e01000, r5 =c121a92c, r6 =c19d3110, r7 =ffffffff
r8 =fffffffe, r9 =fffffff4, r10=c121a920, r11=c6c192f4
r12=00000000, ssp=c6c192bc, slr=c122a830, pc =c121a804

[thread pid 13 tid 100027 ]
Stopped at      db_md_set_watchpoint+0xb8:panic: _mtx_lock_sleep: recursed on non-recursive mutex pmap @ ../../../arm/arm/pmap.c:3719

Uptime: 3s
Cannot dump. Device not defined or unavailable.
Automatic reboot in 15 seconds - press a key on the console to abort


More information about the freebsd-arm mailing list