STR9104/CNS1104 FreeBSD Port Progress

Returning from Indonesia, I continued my Freebsd porting attempt to the Emprex NSD-100. So far it’s going quite well. I took the FA526 CPU support from NetBSD, I use the 8250 driver for the UART, and default EHCI driver. I got stuck for a while on the EHCI part until Hans Petter Selasky pointed me that there might a problem in the busdma/cache handling. With the EHCI part fixed, I can get to the userland, booting from USB stick.

The remaining drivers that needs to be written are the OHCI and network. The OHCI shouldn’t take too much time, but I think the network will take quite a long time.

I was planning to clean up, and release the code today, but I was busy with something else, so may be I will release the code in the next few days. For those of you who are curious about the boot log, here it is:

KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2009 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.0-CURRENT #169: Sun May 10 01:25:55 WIT 2009
    yohanes@cameron:/usr/home/yohanes/freebsd/freebsd/src/sys/arm/compile/CNS11XXNAS
WARNING: DIAGNOSTIC option enabled, expect reduced performance.
Preloaded elf kernel "elf kernel" at 0xc12d30b8.
unknown CPU (ID = 0x66015261)
  WB enabled LABT
  16KB/16B 2-way Instruction cache
  16KB/16B 2-way write-back-locking-B Data cache
real memory  = 67108864 (64 MB)
Physical memory chunk(s):
00000000 - 0xffffff, 16777216 bytes (4096 pages)
0x1337000 - 0x3eaefff, 45580288 bytes (11128 pages)
avail memory = 61718528 (58 MB)
ULE: setup cpu 0
nfslock: pseudo-device
null: <null device, zero device>
random: <entropy source, Software, Yarrow>
mem: <memory>
econaarm0: <ECONA device bus> on motherboard
econa add children
econa add child econa_ic addr 7d000000
econa add child uart addr 78000000
econa add child timer addr 79000000
econa add child ehci addr f8000000
econa_alloc_resource start 00000000 end ffffffff, count = 00000008
econa_alloc_resource start 00000000 end ffffffff, count = 00000008
econa_alloc_resource start 78000000 end 78ffffff, count = 01000000
sys_res_memory
Alloc OK
econa_alloc_resource start 00000000 end ffffffff, count = 00000008
econa_alloc_resource start 00000000 end ffffffff, count = 00000008
econa_alloc_resource start 78000000 end 78ffffff, count = 01000000
sys_res_memory
Alloc OK
uart0: <Non-standard ns8250 class UART with FIFOs> mem 0x78000000-0x78ffffff irq 10 on econaarm0
econa_alloc_resource start 00000000 end ffffffff, count = 00000008
econa_alloc_resource start 78000000 end 78ffffff, count = 01000000
sys_res_memory
Alloc OK
econa_alloc_resource start 00000000 end ffffffff, count = 00000001
econa_alloc_resource start 0000000a end 0000000a, count = 00000001
sys_res_irq
Alloc OK
uart0: [FILTER]
uart0: fast interrupt
uart0: console (38461,n,8,1)
timer0: <Econa CPU Timer> mem 0x79000000-0x79ffffff irq 0,1 on econaarm0
econa_alloc_resource start 00000000 end ffffffff, count = 00000001
econa_alloc_resource start 79000000 end 79ffffff, count = 01000000
sys_res_memory
Alloc OK
econa_alloc_resource start 00000000 end ffffffff, count = 00000001
econa_alloc_resource start 00000000 end 00000000, count = 00000001
sys_res_irq
Alloc OK
STR9100 CPU Clock: 200 MHz
HZ = 100
reload value = 500000
IRQ Timer1 at int #0x0 clock 100000000(Hz)
timer0: [FILTER]
DONE timer
done00000000
ehci probe
ehci probe
ehci0: <CNS11XX USB EHCI> mem 0xf8000000-0xffffffff irq 24 on econaarm0
econa_alloc_resource start 00000000 end ffffffff, count = 00000001
econa_alloc_resource start f8000000 end ffffffff, count = 08000000
sys_res_memory
Alloc OK
econa_alloc_resource start 00000000 end ffffffff, count = 00000001
econa_alloc_resource start 00000018 end 00000018, count = 00000001
sys_res_irq
Alloc OK
add USB device
setup intr
ehci0: [MPSAFE]
ehci0: [ITHREAD]
init ehci
usbus0: EHCI version 1.0
probe and attach
usbus0: <CNS11XX USB EHCI> on ehci0
done
initcloks
enabling timer
Timecounter "CPU Timer" frequency 50000000 Hz quality 1000
Timecounters tick every 10.000 msec
usbus0: 480Mbps High Speed USB v2.0
WARNING: DIAGNOSTIC option enabled, expect reduced performance.
ugen0.1: <Cavium> at usbus0
uhub0: <Cavium EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
uhub0: 2 ports with 2 removable, self powered
ugen0.2: <Kingston> at usbus0
umass0: <Kingston DataTraveler 2.0, class 0/0, rev 2.00/1.00, addr 2> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x0000
register sim 0
scanning the sim
umass0:0:0:-1: Attached to scbus0
(probe0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0
(probe0:umass-sim0:0:0:0): CAM Status: SCSI Status Error
(probe0:umass-sim0:0:0:0): SCSI Status: Check Condition
(probe0:umass-sim0:0:0:0): UNIT ATTENTION asc:28,0
(probe0:umass-sim0:0:0:0): Not ready to ready change, medium may have changed
(probe0:umass-sim0:0:0:0): (probe0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0
(probe0:umass-sim0:0:0:0): UNIT ATTENTION asc:28,0
(probe0:umass-sim0:0:0:0): Not ready to ready change, medium may have changed
Retrying Command (per Sense Data)
(probe0:umass-sim0:0:0:0): Retrying Command
pass0 at umass-sim0 bus 0 target 0 lun 0
pass0: <Kingston DataTraveler 2.0 1.00> Removable Direct Access SCSI-2 device
pass0: 40.000MB/s transfers
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <Kingston DataTraveler 2.0 1.00> Removable Direct Access SCSI-2 device
da0: 40.000MB/s transfers
da0: 1906MB (3903578 512 byte sectors: 255H 63S/T 242C)
GEOM: new disk da0
GEOM_LABEL: Label for provider da0s1a is ufsid/4a01b053676144f3.
GEOM_LABEL: Label for provider da0s1a is ufs/FreeBSDonUSB.
root_mount_prepare 100

Manual root filesystem specification:
  <fstype>:<device>  Mount <device> using filesystem <fstype>
                       eg. ufs:/dev/da0a
  ?                  List valid disk boot devices
  <empty line>       Abort manual input

mountroot> ufs:da0s1a
Trying to mount root from ufs:da0s1a
warning: no time-of-day clock registered, system time will not be set accurately
start_init: trying /sbin/init
Enter full pathname of shell or RETURN for /bin/sh:
# ls /
.snap		dev		media		root		usr
COPYRIGHT	etc		mnt		sbin		var
bin		lib		proc		sys
boot		libexec		rescue		tmp

10 thoughts on “STR9104/CNS1104 FreeBSD Port Progress”

  1. I think the linux-kernel would need a new patch for network also as network disconnects while transfering data using samba:

    Global threshold reached.
    eth0 status:00000011
    GSW_MAC_PORT_0_CONFIG:00423DF5
    GSW_MAC_PORT_1_CONFIG:00463D96
    Global threshold reached and Port 0 queue threshold reached.
    Global threshold reached.
    eth0 status:00000011
    GSW_MAC_PORT_0_CONFIG:00423DF5
    GSW_MAC_PORT_1_CONFIG:00463D96
    Global threshold reached and Port 0 queue threshold reached.
    Global threshold reached.
    eth0 status:00000011
    GSW_MAC_PORT_0_CONFIG:00423DF5
    GSW_MAC_PORT_1_CONFIG:00463D96
    Global threshold reached and Port 0 queue threshold reached.
    Global threshold reached.
    eth0 status:00000011
    GSW_MAC_PORT_0_CONFIG:00423DF5
    GSW_MAC_PORT_1_CONFIG:00463D96
    Global threshold reached and Port 0 queue threshold reached.
    Global threshold reached.
    eth0 status:00000011
    GSW_MAC_PORT_0_CONFIG:00423DF5
    GSW_MAC_PORT_1_CONFIG:00463D96
    Global threshold reached and Port 0 queue threshold reached.
    Global threshold reached.
    eth0 status:00000011
    GSW_MAC_PORT_0_CONFIG:00423DF5
    GSW_MAC_PORT_1_CONFIG:00463D96
    Global threshold reached and Port 0 queue threshold reached.
    Global threshold reached.
    eth0 status:00000011
    GSW_MAC_PORT_0_CONFIG:00423DF5
    GSW_MAC_PORT_1_CONFIG:00463D96
    Global threshold reached and Port 0 queue threshold reached.
    Global threshold reached.
    eth0 status:00000011
    GSW_MAC_PORT_0_CONFIG:00423DF5
    GSW_MAC_PORT_1_CONFIG:00463D96
    Global threshold reached and Port 0 queue threshold reached.

  2. The binary kernel that i uploaded have the debugging set, and it will make the network stop when receiving large number of packets. I will upload new binary with the debugging disabled.

  3. Do you mean this
    CONFIG_DEBUG_USER=y ?

    If I created the zImage do I need to set the machtype with devio?

  4. No, not that one, in the top of drivers/net/star9104.c

    Comment this line:

    #define REPORT_STATUS

    so it becomes:

    //#define REPORT_STATUS

  5. compiled the kernel without REPORT_STATUS. The messages are gone but the lags when using samba do remain. I got no idea whats wrong…

  6. Today I patched to latest (2.6.29.3) stable kernel and compiled/flashed without any problems. I build the modules and recreated the whole debian filesystem. After that I did a dist-upgrade and configured the system. The system seems to run much better but samba errors still occur.

Leave a Reply to Manuel Cancel reply

Your email address will not be published. Required fields are marked *