CNS21XX port completed


About six months ago, Stefan Bethke donated me some money to buy a device from dealextreme so I can port FreeBSD to that device (you can see the pictures here). This device uses ARM Cavium Econa CNS21XX (formerly known as STR8132). Within few days I have completed the driver for serial port, interrupt controller, EHCI/OHCI. Then I stopped working on it, three months later I continued and finished the network driver, then I stopped again.

The last part that wasn’t finished was the SPI controller and the SPI flash driver, so this weekend I spent some time to finish it. So now, I can say that the port is finished, all drivers have been written for the device. With SPI flash support, I can now write the kernel to the device, and boot it from there (I don’t need to boot from network anymore).

Actually I am not really finished yet, since I still need to reformat the code according to the FreeBSD standard, and there might still be bugs in my code, so I invite everyone that have this device to try it out. There is also a feature in the network driver that is not implemented yet (multicast filtering), because the datasheet is not very clear (i would be very happy if someone could help me to complete this, wait now i suddenly understands the documentation).

For the boot loader, I am still using the default boot loader. This boot loader will load the kernel from memory 0×600000, and since I can’t change the boot loader configuration in this particular device, I modified the kernel configuration to match this. The latest code can be accessed at http://gitorious.org/freebsd-arm.

To do initial boot, you will need serial port. You will need to put your kernel on your tftp server. Hit any key during boot, and type:

setenv serverip 172.17.1.1
setenv ipaddr 172.17.1.2
tftpboot 0x600000 kernel.bin
go 0x600000

and to make it permanent:

dd if=kernel.gz.tramp.bin of=/dev/flash/spi0 obs=4k conv=osync seek=96

Please note that the blocksize is 4k, and 96 means the offset is 0×60000 (96*4096) which will be mapped to 0×600000 by the boot loader. If you are brave, you can just compile the image and dd using the default Linux, but I don’t recommend this, since you may have different hardware (espcially SPI flash chip).

Another news: I have completed the driver for ThinLinx Hot-e NAND using NAND2 framework. I also completed the SPI part and support for the flash SPI (read only).

8 thoughts on “CNS21XX port completed

  1. Hi Yohanes. I know that this may be off current topic, but I was hoping that you could help? I have the agestar ncb3ast nas that was running v04r11 firmware but I accidently flashed it with firmware v03r14 eon for the emprex nsd100, it flashed ok saying success but nothing works it`s bricked tried all the suggestions on this forum, when i tried the serial connection i only get
    garbage on the screen ? is it beyond hope ? thankyou for your help, and great work. jelly

  2. @Sergio yes it should be compatible, you need to connect serial port to it to test.

    @jelly it seems that either your serial connection is bad (check the soldering), or you entered the wrong info for the speed. But there is a possibility that the bootloader from nsd100 is not compatible with your board. In that case, you need to program directly to the flash chip (not easy, depends on your chip)

  3. Hi yohanes thanks for your reply. It looks like the boot loader is incompatible! Do you know how i can jtag it? The star nas uses the STR9104 cpu and the eon EN29lv640H flash, but the nsd100 uses the STR9104 and an MX29lv640DT i think? any ideas would be welcome. Tia

  4. Hello yohanes! I am trying to compile your freebsd-git-sources and don’t know how to start (I only compiled linux for different platforms :) never freebsd ). Is there any weblink for beginners? Manuel

  5. Hello yohanes!
    Have you noticed any data transfer problems when the device is connected to a wireless router and reached from the wireless side?.
    SnakeOS seems to have problems with lan driver when wireless transmission is involved rendering the device unusable for copying files. If that works ok on BSD then I’ll try it!

    Regards
    Marcelo

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>