Bayam Keju Panggang dan Nasi Bayam Panggang
Aug 13th 2010risnaUncategorized
Comments Off
All of our blogs
Aug 13th 2010risnaUncategorized
Comments Off
Jul 6th 2010yohanesUncategorized

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).
Comments Off
Jun 25th 2010risnaUncategorized
Comments Off
Apr 4th 2010yohanesUncategorized
The latest progress of my freeBSD port for CNS21XX and ThinkLink Hot-e was three weeks ago. The CNS21XX network driver and Hot-e network driver was completed. I haven’t touched anything since then because I had to work on weekends at the office. This weekend, I could have continued coding, but I don’t feel like coding, so I did a hardware project: adding serial port and SD card slot to my D-LINK DIR-300 that I bought April last year.
This is not a difficult project, I already added SD/MMC card to my WRT54GL about 2,5 years ago. The difference is that there isn’t much guide about the hardware part (which GPIO pins to solder), and the software part (how to activate the drivers). So here is a short guide to anyone who needs it. Note that I already installed OpenWRT Kamikaze using the guide from: OpenWRT site.
This is what the front side of PCB looks like:
On the bottom right, you can connect a serial port (note: 3.3V, you will need MAX3232 or use a data cable from phone, don’t connect directly). Many guides are already available for connecting serial port (for example: here, here, here, and here), so I wont write about it. Just note that you will use the 3.3V and GND for the SD card mod.
This is what the PCB looks like from the back:
I found the GPIO pins from this posting by guidoa:
1: SES Button Blue led (Enable=ON)
2: WiFi led
3: SES Button Red led (Enable=ON)
4: SES Button (Pressed=01)
6: Reset Button (Pressed=01)
7: Status led (Enable=ON)
I have confirmed it using voltmeter and gpioctl command line tool. The SES button is the button on the right side of the unit. As far as I know, SES button, and the LEDS (red and blue) are not used by default, the Wifi LED is used to indicate Wifi ON/OFF. So we can use GPIO 1,3,4. We need another one: we can use GPIO 6 or 7. Since The status led is not used, I prefer GPIO 7. You can see the location of the GPIO pins that I used from the above picture.
Now, look at the SD Card Pinout (you can search it in Google, or just look here).
You need to connect SD Pin 4 to to 3.3V (see the serial port above), Pin 3 and 6 to GND. The rest is up to you (we will configure this later in software). This is what I use:
After you solder them, you need to install these packages using opkg: kmod-mmc, kmod-mmc-over-gpio, kmod-mmc-spi, kmod-spi-bitbang, and kmod-spi-gpio. We need to edit /etc/init.d/mmc_over_gpio. The line that you are looking for is the add_device "default". There are some numbers in the following order DI, DO, CLK, CS and SPI_MODE. You need to fill in the GPIO that you use for each of that pins and just fill in 0 for SPI_MODE. In my case I edit the line to become: add_device "default" 4 7 1 3 0.
Now I can start the SD card using: /etc/init.d/mmc_over_gpio start. You can now mount the card. To remove the card, umount the card and /etc/init.d/mmc_over_gpio stop. The SD card speed is to slow, I will look on to this later, but for now the speed is enough for me.
This is my final result (I am really lousy at soldering):
Doesn’t look too bad from the outside for the SD Card:
But I made a stupid mistake for the RS232 port. I put the port on the wrong place, and I can not drill for the screw on the right side of the port. Fortunately this is not fatal, I just glued the port to the casing.
Update This is the dmesg log after /etc/init.d/mmc_over_gpio start
gpio-mmc: Failed to request mmc_spi module. mmc_spi spi32765.0: SD/MMC host mmc0, no DMA, no WP, no poweroff gpio-mmc: MMC-Card "default" attached to GPIO pins di=4, do=7, clk=1, cs=3 mmc_spi spi32765.0: can't change chip-select polarity mmc0: new SD card on SPI mmcblk0: mmc0:0000 SD512 495488KiB mmcblk0: p1
Update 9 April 2010 to make it clear, this is the picture of the back side of the pcb after soldering:
Comments Off
Mar 1st 2010risnaUncategorized
Comments Off
Feb 21st 2010risnaUncategorized
Comments Off
Feb 17th 2010risnaUncategorized
Comments Off
Jan 20th 2010yohanesUncategorized
I am still fixing the Cavium Econa CNS11XX network driver with the guide from Pyun YongHyeon. He is guiding to make the network driver more robust. Unfortunately, we still don’t know why the driver is slower than the Linux version. The port is currently accessible through FreeBSD CVS at:
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/arm/econa/
I asked in the freebsd-arm mailing list if anyone would like to donate me a CNS21XX device, and Stefan Bethke immediately offered me to buy one for me. I bought the device from dealextreme with the money donated to me. It took 9 days until it arrived.
Meanwhile John Nicolls from ThinkLinx sent me a Hot-e, a device based on AT91SAM9G20. I told him that I have received mr Stefan offer, but he said I can work on it anytime I want it. Since the Hot-e arrived earlier, I have managed to get it to boot. At first i was going to use the work from Sylvestre Gallon on at91sam9621(mailing list archive), but it turns out that it is not usable yet.
I have fixed the clock computation in at91_pmc.c, and currently writing a new timer driver (at91_pit.c), because the system timer device (at91_st.c) no longer exists in AT91SAM9G20. Currently the timer device is still not working properly, but I think I will be able to get it work this week.
When the CNS211XX LAN device finally arrived, I stopped the work for Hot-e for a while to test the new device. I bought a CA-42 cable to connect to it, but I can’t send anything to the device. I thought that the device was faulty, but turns out that the cable is faulty. I was disappointed because usually I used that type of cable (it is cheap only 132 baht or 4 usd). Fortunately I still have one MAX3232, and I can make my own cable.
I think porting CNS21XX will not be so difficult. I made some small adjustment for the serial port driver to make it show something. Memory mapping is different compared to CNS11XX, but that can easily be adjusted. The Interrupt controller is different, so I need to rewrite some parts. After it works, EHCI/OHCI was working fine. The network driver will need major adjustment (may be I will just write a new driver for this one), and the device doesn’t use CFI for Flash, it uses SPI, so I will need to write a driver for SPI bus.
For CNS11XX and CNS21XX You can see my progress in this wiki page:
http://wiki.freebsd.org/FreeBSDcns11xx
Comments Off
Jan 10th 2010risnaUncategorized
Comments Off
Jan 8th 2010risnaUncategorized
Comments Off