Posts Feed
Comments Feed

Bayam Keju Panggang dan Nasi Bayam Panggang

Beberapa waktu lalu saya dan Joe makan di sebuah restoran pizza tapi kami tidak memilih menu pizza. Kami tertarik dengan satu menu unik: bayam panggang!. Jadi intinya bayam dikasih keju dan sedikit daging cincang di panggang. Setelah pulang dari situ, Joe meminta saya untuk membuat bayam panggang versi saya sendiri. Akhirnya saya mencoba bereksperimen. Intinya [...]

Comments Off

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).

Comments Off

Soto Ayam ala Pakde

Beberapa waktu lalu, Joe pulang ke Jakarta dan berhasil mendapatkan resep soto dari Pakde Meruya yang jualan soto. Berhubung di Chiang Mai ga ada yang jualan soto ya udah deh kita meminta resepnya buat dipraktekin disini. Basically pakde cuma ngasih tau bumbunya aja tanpa takaran, naah karena saya pun udah mulai terbiasa masak (setelah kursus [...]

Comments Off

D-LINK DIR-300 Serial Port and SD mod

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:

DLINK DIR-300 PCB FRONT

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.

DLINK DIR-300 SERIAL

This is what the PCB looks like from the back:

DLINK DIR-300 PCB 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:

  • Pin 2 (Data In/MOSI) to GPIO 4 (SES Button)
  • Pin 7 (Data Out/MISO) to GPIO 7 (Status LED)
  • Pin 5 in SD Card (CLK) to GPIO 1 (blue LED)
  • Pin 1 in SD Card (Chip Select) to GPIO 3 (red LED)

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):

D-LINK DIR-300

Doesn’t look too bad from the outside for the SD Card:

DLINK DIR-300 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.

DLINK DIR-300 Serial Port

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:

back side of DLink DIR-300

Comments Off

Another Work-In-Progress Finished

I started this project on September last year, after quite some time I didn’t play with my hook. I thought I will stay with my hook, but I was wrong. These last 3 days, I was in the good mood in crocheting. Finally another work-in-progress from last year is finished. The Mystery Crochet Along was [...]

Comments Off

Crocheted Shawl Finally Finish

After more than a year as WIP, finally I finished this crocheted shawl. What can I say, I’m too lazy to do any craft recently. I feel relieved, because I thought I will never finish this shawl with my very slow speed. I hope my dear friend will be happy with this very late gift [...]

Comments Off

Crochet bukan sekedar merenda

Saya ingin menyatakan bahwa kata kata merenda tidak tepat untuk crochet, karena akan menimbulkan kerancuan baru terhadap merenda kerawang. Alasan saya: KBBI tidak mencantumkan bahwa rajut itu knit dan renda itu crochet. Kalaupun ada penjelasan perajut menggunakan sepasang kawat lurus, perlu diperhatikan knit tidak semata-mata menggunakan sepasang kawat lurus, terkadang bisa menggunakan 4 jarum, atau [...]

Comments Off

ThinLinx Hot-e and CNS21XX

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

Variasi muffin oatmeal raisins

Udah lama ga update laporan belajar bakingnya. Beberapa percobaan kemarin gagal, udah nyoba masak butter cake tapi entah kenapa masaknya ga rata, bagian tengahnya ada yg ga mateng , jadi ga bisa diceritain banyak. Paling kalau udah coba dan berhasil nanti diceritakan disini. Nah cerita bikin muffin aja deh. Beberapa waktu lalu beli loyang muffin [...]

Comments Off

Block your crochet piece!

Dari awal merajut saya sudah sering dengar tentang blocking untuk finishing dari hasil rajutan. Blocking ini ada berbagai teknik, tapi teknik apapun itu saya malas melakukannya. Ada berbagai alasan saya untuk tidak melakukannya, tapi alasan utamanya terlalu malas hehe. Belakangan ini saya coba-coba ngeblocking. Awalnya sih cuma nyetrika hasil rajutannya, tapi kok kurang sip rasanya. [...]

Comments Off

Older Entries »