SUPERIO(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

🌸 SUPERIO(9) β€” the gen-z guide to the Super I/O bus interface 🌸

okay so bestie, this is the superio(9) manual page from the Kernel Developer's Manual, and like… it's a whole vibe. it's all about the Super I/O bus interface β€” raw config access, finding devices, all the good stuff. iykyk πŸ’…


✨ NAME ✨

the whole fam, in one long group chat:

superio, superio_devid, superio_dev_disable, superio_dev_enable, superio_dev_enabled, superio_find_dev, superio_get_dma, superio_get_iobase, superio_get_irq, superio_get_ldn, superio_get_type, superio_read, superio_revid, superio_vendor, superio_write β€” Super I/O bus interface πŸ¦‹

like, literally all of them. one bus interface. iconic.


πŸŽ€ SYNOPSIS πŸŽ€

first things first, bestie, you gotta invite these headers to the party:

#include <sys/bus.h>
#include <dev/superio/superio.h>

now the function guest list πŸ’–:

uint16_t
superio_devid(device_t dev);

void
superio_dev_disable(device_t dev, uint8_t mask);

void
superio_dev_enable(device_t dev, uint8_t mask);

bool
superio_dev_enabled(device_t dev, uint8_t mask);

device_t
superio_find_dev(device_t dev, superio_dev_type_t type, int ldn);

uint8_t
superio_get_dma(device_t dev);

uint16_t
superio_get_iobase(device_t dev);

uint8_t
superio_get_irq(device_t dev);

uint8_t
superio_get_ldn(device_t dev);

superio_dev_type_t
superio_get_type(device_t dev);

uint8_t
superio_read(device_t dev, uint8_t reg);

uint8_t
superio_revid(device_t dev);

superio_vendor_t
superio_vendor(device_t dev);

void
superio_write(device_t dev, uint8_t reg, uint8_t val);

no cap, that's all of them. 🫢


🌈 DESCRIPTION 🌈

so the superio set of functions is literally the whole management era for Super I/O devices. they give you raw configuration access, device locating, device info, and device configuration. it's giving "full-service friend group" 😭


πŸ’œ The controller interface πŸ’œ

  • superio_vendor() β€” used to get a vendor of the Super I/O controller dev. the possible return values are SUPERIO_VENDOR_ITE and SUPERIO_VENDOR_NUVOTON. two icons, no third option πŸŽ€
  • superio_devid() β€” used to get a device ID of the Super I/O controller dev.
  • superio_revid() β€” used to get a revision ID of the Super I/O controller dev.
  • superio_find_dev() β€” used to find a device on the superio(4) bus, specified by dev, that has the requested type and logical device number.

okay so about superio_find_dev() β€” this is the main character of the section, lowkey:

  • either of those (type and logical device number), but not both, can be a wildcard ✨
  • supported types are SUPERIO_DEV_GPIO, SUPERIO_DEV_HWM, and SUPERIO_DEV_WDT
  • the wildcard value for type is SUPERIO_DEV_NONE
  • the wildcard value for ldn is -1
fr fr: not both. pick a lane, bestie πŸ™ˆ

πŸ’– The device interface πŸ’–

  • superio_read() β€” used to read data from the Super I/O configuration register of the device dev.
  • superio_write() β€” used to write data to the Super I/O configuration register of the device dev.
  • superio_dev_enable(), superio_dev_disable(), and superio_dev_enabled() β€” used to enable, disable, or check status of the device dev. the mask parameter selects sub-functions of a device that supports them. for devices that do not have sub-functions, mask should be set to 1. πŸ“

πŸ¦‹ The accessor interface πŸ¦‹

  • superio_get_dma() β€” used to get a DMA channel number configured for the device dev.
  • superio_get_iobase() β€” used to get a base I/O port configured for the device dev. heads up: the device may expose additional or alternative configuration access via the I/O ports.
  • superio_get_irq() β€” used to get an interrupt number configured for the device dev.
  • superio_get_ldn() β€” used to get a Logical Device Number of the device dev.
  • superio_get_type() β€” used to get a type of the device dev. 🌟

πŸ‘‘ SEE ALSO πŸ‘‘

go read these too, bestie, they're in the same friend group:


🧚 AUTHORS 🧚

this manual page was written by Andriy Gapon avg@FreeBSD.org β€” absolute legend, we stan πŸ”₯


and that's the tea, bestie πŸ’… this page came to you from Debian, dated October 11, 2019 β€” so go forth and configure those Super I/O devices, no cap, you're gonna slay 🌸✨🫢

πŸ“¦ where this page comes from