Reform LPC driver for OpenBSD

building on the amazing work of @nanocodebug in this post, i’ve written an OpenBSD driver for the reform LPC (system controller), which uses the SPI connection between the processor module and LPC to enable:

  • Automatic power-off after OpenBSD shutdown
  • Reporting power & battery status via sysctl hw.sensors
  • Reporting power & battery status via apmd and apm

i’ve been testing this for just over a month now on my reform running OpenBSD-current without any issue.

for this to work, the device tree file you boot your system with (i.e. the one embedded in your u-boot build, or your external device tree if you use one) needs to have a correctly configured entry for ecspi2. the device tree in reform-openbsd’s u-boot has the correct entry and i’ve tested this device tree extensively.

you’ll need to compile your own OpenBSD kernel to use this, because i haven’t upstreamed the driver yet. the OpenBSD release documentation steps through how to fetch sources and build a new kernel. note - you only need a new kernel with this patch to enable this driver. you don’t need to recompile any other part of your system. also, when you run a custom kernel on OpenBSD, you will clobber your changes if you run sysupgrade, so keep that in mind.

the patch is here and can be applied like any other patch at the top of your /usr/src/sys using patch.

the usual disclaimers apply - this patch will definitely destroy your reform, burn down your house, etc. it hasn’t done this for me, but i’m sure it’s just a matter of time.

9 Likes