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 0x600000, 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

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
setenv ipaddr
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 0x60000 (96*4096) which will be mapped to 0x600000 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).

Unicode: from text and font to display

I’ve always wanted to be able to support all kind of text on my Symbian bible. The problem is this: the Unicode support for Symbian is very limited, and even non existent for some languages. Few weeks ago someone asked me if I can make Symbian bible to support Malayalam bible (using Malayalam script of course). Malayalam writing system was only supported recently by major operating systems (such as Windows XP and OS X Leopard), and Symbian haven’t support it yet (and even if it supports it, the support will only be activated to phones on certain sales area).

I know that there are several Unicode layout library, such as Pango, Qt or ICU. All of them are too big for me to understand and port to Symbian. So my solution was to use the freetype library and harfbuzz font shaping. After using those two libraries on Symbian, I think now I can understand Unicode. Here is my quick guide to understand Unicode, from having a data and a font, to displaying the data with that font.

First thing that you need to understand is: Unicode defines list of characters for many languages of the world.

Some languages doesn’t have the concept of lower or upper case. Some languages have their own numbering system. Every language has their own system of ordering things. If possible: always use the function provided by the library you are using. 

Continue reading “Unicode: from text and font to display”

Fixing Space key on EEE PC

CIMG4171 I bought the  Eee PC 4G last week, but I haven’t used it optimally. Today when trying to write a new blog post using Eee PC, I felt that the space key is very difficult to press. After searching around, I found out that many people experience the same problem. Surprisingly it is very easy to take of the Eee PC keyboard. Just press on the three dots on top of the keyboard using screw driver, and it will pop out.

Fixing it quite easy, I used a tape to make the space key thicker and easier to press, and I put a tape also in the keyboard to keep the rubber part from moving.

You can see more pictures on my photo gallery.

Latest development (kernel space OK, user space: not yet OK)

Here is the current progress of the kernel porting:

  1. Basic architectural support (IRQ, timer, memory mapping)
  2. Serial port
  3. EHCI driver
  4. OHCI driver
  5. MTD driver

Here are some notes regarding the development:

  1. Serial port is 16550 compliant, but you need to remap the registers.
  2. STR9104 have PCI bus, but it is not connected anywhere. The old kernel have a driver for PCI bus, and it was used in the EHCI driver. I think this is kind of a hack, because the PCI stuff is not needed.
  3. The EHCI and OHCI is part of the SoC, not on the PCI bus. There is a quirk in the initialization of the OHCI part (you can look at it in the patch)
  4. MTD driver is based on CFI chipset (AMD/Fujitsu). I only tested reading and writing configuration partition (mtd2 and mtdblock2)
  5. Network Driver (STR9104 contains MAC hardware, and in Agestar it is connected to IP101A as the PHY hardware)

Continue reading “Latest development (kernel space OK, user space: not yet OK)”