CNS11XX FreeBSD port completed

It has been a long time since I started this project, and even though I am making a good progress at the beginning, my progress was getting slower lately. Today I decided to take a day off from work to finish some remaining task: network driver, automatic memory detection, and flash device support.

Pyun YongHyeon have helped me a lot with the network driver. The speed is still not good, but he have helped to make the network driver to more correct (better, more reliable). I will still need to ask him to check for the final version, but I believe I have fixed most errors he pointed out.

My agestar, which also uses CNS11XX devices comes with 32Mb memory, while the Emprex NSD-100 have 64mb of memory. I have added a code to autodetect the memory size. So one binary file should work on both devices.

The flash device in Emprex NSD-100 complies with CFI, and it was very easy to use with the existing CFI driver. I just need to write several lines of code. The next step is to boot freebsd directly from the flash (with the root filesystem on USB). Unlike in Linux, the flash device can not be accessed as partitions (not yet).

First, we need to write the kernel.bin to cfi0, because the first 132 kb is used by boot loader, we need to skip to somewhere > 132kb. To make it easy, i just skip 1 megabyte from beginning of flash.

dd if=kernel.bin seek=1 bs=1m of=/dev/cfi0

be very very very careful with the dd command. Without correct seek and bs, you may overwrite the bootloader. The command will take quite a long time to finish (3 minutes).

Next step is to set the initial boot command. In the boot loader, setup bootcmd to copy the data in ram to 0x1000000 from 0x10100000, then boot the device:

setenv bootcmd cp.l 0x10100000 0x1000000 0x1a0000\;go 0x1000000
saveenv

Now when we boot the device, we should go directly to freebsd.

I won’t provide binaries, but the latest source code is in:

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

7 thoughts on “CNS11XX FreeBSD port completed”

  1. I wonder if it is possible to use your econa-driver for linux?! Is there an easy way to check out the latest source and integrate it into latest linux-kernel?

  2. Hello Yohanes!

    After long years I tried to compile ubldr, kernel and world ( FreeBSD1 0), again
    and failed ….

    I tried it with the following enviroment variables and commands (kernel did not boot):

    TARGET_CPUTYPE=fa526
    TARGET_ARCH=arm
    MAKEOBJDIRPREFIX=/root/obj
    ARCH=arm
    make TARGET_ARCH=arm TARGET_CPUTYPE=fa526 UBLDR_LOADADDR=0xcf00000 buildworld
    make buildkernel KERNCONF=cns11xx

    after that I startet a serial console for u-boot and tried to netload the kernel.bin/ubldr.bin:

    setenv ipaddr 192.168.y.x
    setenv serverip 192.168.y.z
    tftpboot 0x1000000
    go 0x1000000

    both simply hang ubldr.bin (first try) and kernel.bin (second try) …

    Do you have any hints for me for building a fresh FreeBSD distro for the old agestar?

    regards Manuel

  3. I work on cns11xx support on CURRENT. I still not fix problem. I check old Release then FreeBSD 9.1R is work fine. But 10.1R is hang up at rootfs mount. 9.2R and 9.3R have different problem. I think CURRENT problem is same as 10.1 hung up problem. I think this is interrupt problem. If you have advice, Please let me know.

    Thanks.

Leave a Reply to Manuel Cancel reply

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