USB driver for FreeBSD/Beaglebone

It took me two months but I finally got back to hacking on musb driver for FreeBSD (the one that is used in TI AM335x-based devices like Beaglebone or Beaglebone Black). Previous revision turned out not to be ready for production. Here is the new one: beaglebone-usb-20130626.diff. I adopted it to latest HEAD, fixed numerous bugs, added support for SPLIT transactions and USB suspend/resume signalling. There is some cleaning-up to do but unless something major comes up the plan is to commit it over next few days.

June 27, 2013 · 1 min · 87 words · Oleksandr Tymoshenko

Raspberry Pi console

Quick hint. If you did not disable “device sc” in kernel config all the message from kernel go to video console. But if something bad happened after kernel started and before framebuffer driver is activated all you’ll see would be “Kernel args: (null)” message on serial console which is not very helpful. So in order to debug this problem and have kernel boot messages on both monitor and serial port without recompiling kernel just add following line to /boot/loader.rc on SD card: ...

June 24, 2013 · 1 min · 84 words · Oleksandr Tymoshenko

Framebuffer/syscons support for AM335x

I finally got around to finishing the PWM and LCDC driver for AM335x. Everything was committed today. Here is demo on AM335x EVM (I apologize for quality):

May 26, 2013 · 1 min · 27 words · Oleksandr Tymoshenko

Work in Progress: LCD driver for AM335x evaluation module

I’m trying to wrap up some project I started working on quite some time ago and this is first chunk of clean-up. Patchcontains: Kernel config for AM335x EVM dts file for AM335x EVM with TFT panel info LCD controller driver with some functionality missing: only 24/32 bit depth and only TFT mode is supported Really simple PWM driver. LCD backlight is controlled through eCAS submodule of PWMSS0 module. I tested it only on evaluation module, although I think with proper panel/pinmux configuration it should work with BeagleBone’s LCD caps too. Parts missing: adjusting clock to proper pixel frequency, proper allocation of framebuffer memory.

May 5, 2013 · 1 min · 103 words · Oleksandr Tymoshenko

FDT driver skeleton generator

Writing new driver for FDT-based device always involves several simple steps: writing generic newbus driver skeleton Checking for compatibility of node in probe routine Allocate memory/IRQ resources in attach routine I can’t say for other developers but I just copy existing driver, remove all device-specific stuff and rewrite generic stuff. Which is less time-consuming then writing it from scratch but time-consuming it is. Being huge fan of automation of any kind I decided to let computer do all this dumb work and leave creative part (copy-pasting registers definition from spec to code) to myself. the result is this script. ...

May 3, 2013 · 1 min · 170 words · Oleksandr Tymoshenko

Netbooting ARM/MIPS devices: ubldr

As it was mentioned in previous post U-Boot can boot FreeBSD kernel directly but this approach doesn’t allow a great deal of control over boot process: there is no way to set tunables’ values or pre-load module. Controlling this stuff requires more knowledge of FreeBSD internal data structures and its boot process then U-Boot holds. On i386 and other Tier1 architectures this task is handled by the loader(8) program. It’s last stage boot loader (e.g. it’s supposed to pass control to FreeBSD kernel only), highly customizable and scriptable. loader(8) relies on one of the previous stages boot loader to access resources like disks, console, network. For i386 it’s BTX and BIOS. ...

April 19, 2013 · 3 min · 526 words · Oleksandr Tymoshenko

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

Netbooting ARM/MIPS devices: server setup

I was asked to share details about my root-over-NFS setup so here they are. I decided to split how-to in two posts: server/kernel part and u-boot part. Usual components in the setup are: DHCP server TFTP server NFS server NAT (optional) DHCP server I use net/isc-dhcp42-server as a server. Sample dhcpd.conf: option root-opts code 130 = string; # NFS / mount options log-facility local7; subnet 192.168.10.0 netmask 255.255.255.0 { server-name "cinderella.bluezbox.com"; server-identifier 192.168.10.1; option subnet-mask 255.255.255.0; option broadcast-address 192.168.10.255; option domain-name-servers 8.8.8.8; option domain-name "bluezbox.com"; next-server 192.168.10.1; option routers 192.168.10.1; } group { host pandaboard { hardware ethernet 0E:60:33:B1:46:01; fixed-address 192.168.10.90; filename "kernel.PANDA.bin"; option root-path "/src/FreeBSD/nfs/armv6"; option root-opts "nolockd"; } host rpi { hardware ethernet b8:27:eb:f6:08:83; fixed-address 192.168.10.91; filename "ubldr"; option root-path "/src/FreeBSD/nfs/rpi"; option root-opts "nolockd"; } } Config is pretty self-explanatory. I use google’s 8.8.8.8 nameserver but you can change it to your very own DNS server. Difference between various filename “…” will be explained later. ...

February 14, 2013 · 3 min · 565 words · Oleksandr Tymoshenko

Netbooting Hackberry A10 (Allwinner A10)

Last few weeks I’ve been acting as a reviewer for Ganbold Tsagaankhuu’s port of FreeBSD for Cubieboard so in order to provide more valuable input and less naysaying I decided to get A10-based device to test his changes. So I ordered Hackberry from miniand.com. I’m not great fan of pushing SD cards back and forth so first thing I do with my SoCs is get them netbooting. That’s where fun begins. ...

February 10, 2013 · 1 min · 164 words · Oleksandr Tymoshenko

Accessing GPIO from Perl, Python, and Ruby

I started this smallish project to overcome coder’s block and original idea was to implement it in only one scripting language. I chose Python as I believed it had most clear API but then I decided to throw in Perl and Ruby as well. It was more exercise in building C extensions then in actual system programming but it was fun nonetheless. All three sub-projects lack proper documentation but there are examples that should be enough to get started. ...

February 7, 2013 · 1 min · 83 words · Oleksandr Tymoshenko