Minnowboard Turbot: GPIO, I2C, and SPI

Last year I got my hands on Minnowboard Turbot (courtesy of Frank H.) and spent some time working on communications protocols support for it. Below is short summary of what works and what doesn’t. Minnowboard Turbot is Atom-base SoC, and standard x86 part (HDMI, network, USB) FreeBSD just works on it. The board has expansion connector that exposes I2C, SPI, and GPIO pins and can be used to talk to peripheral devices. Short summary of header pins can be found on developer.microsoft.com. ...

January 6, 2017 · 2 min · 357 words · Oleksandr Tymoshenko

Accessing I2C and SPI from userland

Over years I accumulated fair number of devices I have no real use for. I ordered them either on impulse, or to add couple of $$$ to the bill to get free delivery. So in order to get at least some value from those purchases I put together goofy demo using two of such devices: I2C temperature sensor breakout from Sparkfun and 128x32 SPI OLED display from Adafruit. I wrote two libraries to talk to TMP102 (chip in which temp sensor is based) over I2C and to SSD1306(OLED display chip) over SPI and several demos simple enough to put together in one day but flashy enough to excite my inner child and bring fond memories of MSDOS days. The SPI chip requires this fix in kernel. Userland SPI API provides only very basic functionality but luckily it was enough to talk to SSD1306. ...

December 17, 2016 · 1 min · 206 words · Oleksandr Tymoshenko

Raspberry Pi UART0 default frequency

If you’re trying to boot FreeBSD with latest RaspberryPi firmware - be aware that this commit changed default frequency for UART0 on at least RaspberryPi 2, so to get serial console working in u-boot/ubldr again you need to add this line to config.txt: init_uart_clock=3000000

December 14, 2016 · 1 min · 44 words · Oleksandr Tymoshenko

rfkill on Jetson TK1

If you’re trying to install half-sized mini-PCIe wifi card in Jetson TK1, be aware, that the board has rfkill feature that is enabled by default. rfkill is hardware or software controlled switch that enables/disables RF signal on the wifi card itself. In case of mini-PCIe it’s controlled by level on pin 20 of the card. On Jetson TK-1 that pin is connected to GPIO X.7 pin. So to enable wifi on the board you need to run something like: ...

December 11, 2016 · 1 min · 87 words · Oleksandr Tymoshenko

Debugging tip: checking kernel DTB from userland

You can get source for current kernel FDT blob by running following command sysctl -b hw.fdt.dtb | dtc -I dtb -O dts Edit 27/10/2017: added -O option, looks like it’s required in newer dtc

December 1, 2016 · 1 min · 34 words · Oleksandr Tymoshenko

Quest for SMP on Raspberry Pi 3, part II

Update (11/29/2016): DTB overlay no longer required. PSCI monitor will patch in-memory DTB to add psci node. Commit Short version of how to get RPi3 with SMP support Build GENERIC arm64 kernel for your image, not GENERIC-UP Copy https://people.freebsd.org/~gonzo/arm/rpi3-smp/u-boot.bin and https://people.freebsd.org/~gonzo/arm/rpi3-smp/armstub8.bin to FAT partition on SD card. Copy https://people.freebsd.org/~gonzo/arm/rpi3-smp/psci.dtbo to overlays directory on FAT partition Edit config.txt: change value of device_tree_address and add psci overlay. These two lines should be there: device_tree_address=0x4000 Reboot device. It should boot with all four cores enabled and reboot should work too. Long version of what’s in those .bin/.dtbo files Boot sequence for PSCI monitor on RPi3 looks like this: ...

November 25, 2016 · 4 min · 711 words · Oleksandr Tymoshenko

Quest for SMP on Raspberry Pi 3

Getting SMP support for RPI3 took some time and was interesting learning experience. So I share bits of what I learned here. FreeBSD/arm boot start on one CPU (called primary) the rest of CPUs are “on hold”. At some point in boot sequence non-primary CPUs are forced to call mpentry() function. The way CPU is forced to call mpentry is platform-dependent. RPi2 for instance passes mpentry and argument to VideoCore using mailbox interface and then VideoCore kicks ARM CPU in action. So most of SoC has their own implementation of platform_mp_start_ap platform API method. ...

November 24, 2016 · 3 min · 493 words · Oleksandr Tymoshenko

MFC tracking tool filters

I’ve just added extended filters to http://mfc.kernelnomicon.org. Now filter can be either committer, or path, or both. Path is indicated by adding @ character to the beginning, so gonzo means all commits by gonzo, @sys/arm means all commits to sys/arm directory, and gonzo@sys/arm means all commits by gonzo to sys/arm directory. If there are more then one expression separated by space the result will be all filters OR-ed together: @sys/arm @boot/efi means all commits to sys/arm plus all commits to boot/efi directory.

October 29, 2016 · 1 min · 82 words · Oleksandr Tymoshenko

Raspberry Pi userland repo update

raspberrypi-userland git repo was synced to the latest upstream code base: https://github.com/gonzoua/userland/tree/freebsd

October 25, 2016 · 1 min · 12 words · Oleksandr Tymoshenko

MFC tracking web-tool

Next week I plan to do bunch of MFCs for ARM and evdev stuff and to make it less of an ordeal I made this tool to track what’s merged and what’s not: mfc.kernelnomicon.org. It provides basic functionality I thought I would need for this process: Navigator for HEAD commits with visual representation of MFC state: “no mfc scheduled”, “ready for mfc”, “waiting for ‘mfc after’ date”, “merged” Basic filtering: by author name, by two states: “waiting”, and “ready” “MFC basket” - manage set of commits I would like to merge back in one go Generate svn command and change log for selected “MFC basket” Stack used: Django + Bootstrap3 + jQuery ...

October 16, 2016 · 1 min · 115 words · Oleksandr Tymoshenko