Beckhoff BIOS API Linux Kernel Driver
Switch branches/tags
Clone or download
pbruenn api: fix return code mismatch with Windows 0x20000000
On Windows error codes from the BIOS API get extended
with OR 0x20000000. This was missing for the Linux and
FreeBSD ioctl and bbapi_rw() interfaces.
We change the error codes for __FreeBSD__ only and keep
everything as is for Linux users to don't break them!
Latest commit 1424018 Nov 2, 2018
Permalink
Failed to load latest commit information.
button Relicense BBAPI driver under MIT license Aug 22, 2018
display Relicense BBAPI driver under MIT license Aug 22, 2018
extra Relicense BBAPI driver under MIT license Aug 22, 2018
power Relicense BBAPI driver under MIT license Aug 22, 2018
scripts bbapi: improve and run indent Feb 22, 2016
sups Relicense BBAPI driver under MIT license Aug 22, 2018
tools unittest: make it compile on FreeBSD Jul 17, 2018
watchdog Relicense BBAPI driver under MIT license Aug 22, 2018
.gitignore .gitignore: cmake build folder Jun 19, 2018
CHANGES bbapi: release v1.7 Feb 12, 2016
CMakeLists.txt Makefile: use cmake to build userspace tools May 23, 2018
COPYING Relicense BBAPI driver under MIT license Aug 22, 2018
Lindent add CX5130 test config; prepare watchdog driver for devices without l… Oct 16, 2015
Makefile unittest: make it compile on FreeBSD Jul 17, 2018
Makefile.FreeBSD FreeBSD: define PAGE_KERNEL_EXEC as M_EXEC Jul 26, 2018
README.md Some basic fixes to markdown syntax Jul 15, 2018
TcBaDevDef.h api: fix return code mismatch with Windows 0x20000000 Nov 2, 2018
api.c api: fix return code mismatch with Windows 0x20000000 Nov 2, 2018
api.h Relicense BBAPI driver under MIT license Aug 22, 2018
config_cx2030_cx2100-0004.h Relicense BBAPI driver under MIT license Aug 22, 2018
config_cx2030_cx2100-0904.h Relicense BBAPI driver under MIT license Aug 22, 2018
config_cx5000.h Relicense BBAPI driver under MIT license Aug 22, 2018
config_cx5130.h Relicense BBAPI driver under MIT license Aug 22, 2018
display_example.cpp Relicense BBAPI driver under MIT license Aug 22, 2018
sensors_example.cpp Relicense BBAPI driver under MIT license Aug 22, 2018
simple_cdev.c Relicense BBAPI driver under MIT license Aug 22, 2018
simple_cdev.h Relicense BBAPI driver under MIT license Aug 22, 2018
test_config.h Relicense BBAPI driver under MIT license Aug 22, 2018
unittest.cpp Relicense BBAPI driver under MIT license Aug 22, 2018

README.md

Beckhoff BIOS API

General information about BBAPI

The “BIOS-API” is a piece of software which is part of the BIOS in Beckhoff industrial motherboards. It offers a one-stop solution for communicating with several components on the board, such as temperature and voltage sensors, the S-USV microcontroller, the PWRCTRL microcontroller, the Watchdog and other components (if installed). It also offers access to a small memory area in the EEPROM reserved for user data. the API is integrated into the BIOS. The OS which is running on the board needs to have a special Device Driver installed to access the API functions. Through this driver the user software can take advantage of the API functionality.

BBAPI Driver

The Beckhoff BIOS API linux driver is implemented in two layers. The kernel module 'bbapi' represents the bottom layer, which communicates directly to the BIOS. The upper interface of 'bbapi' is based on ioctl's and IndexGroups and IndexOffsets defined in the "Beckhoff BIOS-API manual".

On top of 'bbapi' a second layer is implemented to provide a linux interface based on device files. 'bbapi_disp' and 'bbapi_wdt' implement this second layer. Both depend on an installed 'bbapi' module. 'bbapi_disp' implements virtual terminal like interface to the CX2100 text display 'bbapi_wdt' implements a common watchdog interface to the CX hw watchdog

How to build and install the kernel modules

Install 'bbapi'

  1. cd into bbapi <src_dir>
  2. make && make install

Install 'bbapi_disp'

  1. make sure 'bbapi' is already installed
  2. cd into <src_dir>/display
  3. make && make install

Install 'bbapi_power'

  1. make sure 'bbapi' is already installed
  2. cd into <src_dir>/power
  3. make && make install

Install 'bbapi_sups'

  1. make sure 'bbapi' is already installed
  2. cd into <src_dir>/sups
  3. make && make install

Install 'bbapi_wdt'

  1. make sure 'bbapi' is already installed
  2. cd into <src_dir>/watchdog
  3. make && make install

How to access the bbapi

/dev/bbapi is the device file to access the low level BBAPI
see "Beckhoff BIOS-API manual" and unittest.cpp for more details.

/dev/cx_display is the device file to access the CX2100 text display.
see display_example.cpp for detailed information

/dev/watchdog is the device file to access the CX hardware watchdog.
See https://www.kernel.org/doc/Documentation/watchdog/watchdog-api.txt

/sys/class/gpio/sups_pwrfail/value shows the power fail state on devices with S-UPS.
See scripts/poll_pwrfail.sh for detailed information

History

See CHANGES