Netbooting ARM/MIPS devices: kinds of kernel and u-boot

U-Boot is a boot loader. Its task is to get kernel into memory and pass control to it. I will cover only parts of it related to netboot. kernel or kernel.bin But before we start loading something we need to know what to load. In previous post I mentioned that there are kernel, kernel.bin, and ubldr files. Let’s get into details. First of all: ubldr requires its own post. So there will be one more covering just ubldr. Now kernel and kernel.bin. ...

February 15, 2013 · 3 min · 580 words · Oleksandr Tymoshenko

VCHIQ drivers work again

I synced both vchiq-freebsd and userland to latest and greatest. As I mentioned earlier - OS compatibility shim was removed from upstream sources so I had to create Linux KPI implementation layer which turned out not that awful task because I managed to reuse a lot of code from Max Khon’s DAHDI port. I had to implement (in somewhat hackish fashion) kthread API, re-implement semaphores support using condvar and mutex in order to get _interruptible part of API working properly and create dumb implementation of rather small subset of Linux list.h API. ...

January 13, 2013 · 1 min · 212 words · Oleksandr Tymoshenko

FreeBSD/armv6: what's new and exciting?

It’s been a while since last update on the project status so it might seem as there was no progress in this area. The reality is: there is a bunch of activities happening with various levels of success. So I decided to give kind of end-of-the-year round-up of ongoing projects, plans and obstacles ARM hackers face. First of all we tried switching default cache type from write-through to write-back type. It should have increased performance but instead opened a can of worms. Memory corruption debugging led to L2 cache driver on Pandaboard, EHCI driver code and subsequently to busdma code. Whole process took quite a few days full of hair-pulling and nagging various people and ended up in committing USB fixes and Ian Lepore’s busdma patches. PL310 (L2 cache controller) driver is being tested at this very moment. Original issue (WB caches) still stands and postponed till next year. ...

December 30, 2012 · 4 min · 750 words · Oleksandr Tymoshenko

Cross-compilation hiccups

Good news and bad news. Let’s start with good ones. Daisuke Aoyama tracked down what causes “Unrecognized filesystem type” error with some SD cards. It is U-Boot using High Speed mode. Root cause is still unknown but as a workaround I just disabled HS mode for SD card in u-boot and updated freebsd-uboot-20121129.tar.gz. Or alternatively you can get uboot-nohs.img and use it to replace uboot.img on your SD card. Bad news are: installworld for cross-compiled FreeBSD is broken unless you’re doing it on the latest HEAD. The reason is utility called mtree(8). It is used to ensure that target filesystem permissions and owners/groups are correct. Owners and groups are described as usernames and group names, not as numeric UIDs/GUIDs and mtree uses getpwXXX family of routines to convert names to numeric values. See the problem already? If new system user is added to latest HEAD and you use old trusty FreeBSD 9.0, there is no way mtree would know about this user. NetBSD solved this problem by introducing -N command-line option that lets you point mtree to the target system’s master.passwd and groups. So we need to port this feature to FreeBSD in order to get proper cross-compilation environment. And that’s my plan for next few days. ...

December 1, 2012 · 2 min · 244 words · Oleksandr Tymoshenko

FreeBSD on Pi: more stuff

Long overdue update on how the things are going with FreeBSD on Raspberry Pi. We’ve made some good progress so far: Hans Petter Selasky fixed low-speed interrupt endpoints problem which means we have working USB keyboard now GPIO driver by Luiz Otavio O Souza. So now you can blink OK LED (gpioctl -f /dev/gpioc0 -t 16). Not the most productive activity though. Kernel now obtains information about display resolution, memory layout, MAC address from firmware Framebuffer/syscons support added Some stability fixes for SDHCI/li> Initial port of VCHIQ interface (vchiq-freebsd) Port of userland libraries (userland) Overall stability and performance is still a problem, but it’s what we’re going to work on next. ...

November 29, 2012 · 2 min · 422 words · Oleksandr Tymoshenko

Flyswatter JTAG and AVR32

Today I soldered AVR32 adapter for Flyswatter JTAG. Actually it’s very simple task - just connect respective pins and make common ground wire. No capacitors, resistors or MOSFETs. Idea was to make it nice and neat but having bought wrong breadboard and soldered first headers in a wrong place I just let it flow and here it is: From aesthetics point of view suck, but it also works and it’s everything I need: ...

August 9, 2010 · 1 min · 100 words · Oleksandr Tymoshenko

Minor OpenOCD fixes

Back from the land of GUI software. I have bought one more Flyswatter JTAG recently and now have two boards connected to my home box. Unfortunately both Flyswatters got the same USB serial number so stock openocd opens only the first device it stumbles upon. Here is small patch that adds ft2232_index command to OpenOCD FTDI driver that allows to point at specific device to open. Works only with libftdi. In the same directory you can find my configs for AR71XX-based RouterStation Pro and Portwell’s CAM-0010 device based on Octeon CN3010

July 6, 2010 · 1 min · 91 words · Oleksandr Tymoshenko

Writing FreeBSD NIC driver

I’ve been through writing NIC driver 2.5 times. 0.5 was porting ADM5120 switch driver by Ruslan Ermilov and Vsevolod Lobko from NetBSD. The usual routine for this kind of thing is “take existing driver and rewrite it”, e.g. copy selected parts or remove unnecessary ones. So I decided that it would be nice to skip “remove” part of procedure next time. All cards I had to deal with (“both” wouldn’t be that impressive here) had similar design save for registers layout and some quirks. I believe that vast majority of NICs have the same design to some extent: there are circular RX/TX rings of more or less similar structure, interrupt status/mask register, media settings registers, you name it. Not a rocket science. ...

February 19, 2010 · 1 min · 193 words · Oleksandr Tymoshenko

projects/mips RIP

All changes from projects/mips has been merged to HEAD. Kudos go to imp@ for sieving through mergeinfo mess projects/mips has been.

January 11, 2010 · 1 min · 21 words · Oleksandr Tymoshenko

FreeBSD/mips and LLVM

Good news: LLVM builds fine on RouterStation Pro with root mounted over NFS. Bad news: it segfaults on some tests and when trying to build hello world application. Stay tuned

January 8, 2010 · 1 min · 30 words · Oleksandr Tymoshenko