STRUCT OMNIA_MCU(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct omnia_mcu(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual page for struct omnia_mcu β€” yes that's section 9, the kernel internals section, we love her πŸ’…. This is the driver's own private little data structure, and I'm gonna walk you through every single field so you can actually read this header without spiraling 🫢.


✨ NAME ✨

struct omnia_mcu β€” driver private data structure

yeah that's it that's the name, short and iconic πŸ‘‘


🌸 SYNOPSIS 🌸

struct omnia_mcu {
    struct i2c_client *client;
    const char *type;
    u32 features;
    u64 board_serial_number;
    u8 board_first_mac[ETH_ALEN];
    u8 board_revision;
  #ifdef CONFIG_TURRIS_OMNIA_MCU_GPIO;
    struct gpio_chip gc;
    struct mutex lock;
    unsigned long mask, rising, falling, both, cached, is_cached;
    struct delayed_work button_release_emul_work;
    unsigned long last_status;
    bool button_pressed_emul;
  #endif;
  #ifdef CONFIG_TURRIS_OMNIA_MCU_SYSOFF_WAKEUP;
    struct rtc_device *rtcdev;
    u32 rtc_alarm;
    bool front_button_poweron;
  #endif;
  #ifdef CONFIG_TURRIS_OMNIA_MCU_WATCHDOG;
    struct watchdog_device wdt;
  #endif;
  #ifdef CONFIG_TURRIS_OMNIA_MCU_TRNG;
    struct hwrng trng;
    struct completion trng_entropy_ready;
  #endif;
  #ifdef CONFIG_TURRIS_OMNIA_MCU_KEYCTL;
    struct completion msg_signed;
    struct mutex sign_lock;
    bool sign_requested;
    int sign_err;
    u8 signature[OMNIA_MCU_CRYPTO_SIGNATURE_LEN];
    u8 board_public_key[OMNIA_MCU_CRYPTO_PUBLIC_KEY_LEN];
  #endif;
 };

not me obsessing over how half the fields are wrapped in #ifdefs 😭 like she's modular, she's customizable, she adapts to your config β€” main character energy fr fr πŸ’œ


πŸŽ€ Members πŸŽ€

okay bestie, here's the whole cast, one by one, no skips, no shortcuts 🌈

  • client β€” the I2C client πŸ¦‹
  • type β€” the MCU type, and it can be STM32, GD32, MKL, or unknown πŸ‘€
  • features β€” a bitmap of the features the MCU firmware supports ✨
  • board_serial_number β€” the board serial number, but only if it's stored in the MCU πŸ’Ύ
  • board_first_mac β€” the board's first MAC address, again only if it's stored in the MCU πŸ“
  • board_revision β€” the board revision, if it's stored in the MCU (spotting a theme here? yes πŸ’…)
  • gc β€” the GPIO chip
  • lock β€” a mutex protecting the internal GPIO chip state πŸ”’
  • mask β€” bitmap of masked IRQs πŸŽ€
  • rising β€” bitmap of rising edge IRQs ⬆️
  • falling β€” bitmap of falling edge IRQs ⬇️
  • both β€” bitmap of both edges IRQs πŸ”₯
  • cached β€” bitmap of cached IRQ line values. The way this works: when an IRQ line is configured for both edges, we cache the corresponding GPIO values in the IRQ handler 🧠
  • is_cached β€” bitmap of which IRQ line values are cached
  • button_release_emul_work β€” front button release emulation work, used with old MCU firmware versions that didn't send button release events and only sent button press events πŸ™ˆ
  • last_status β€” the cached value of the status word, which gets compared against the new value to figure out which interrupt events actually happened. Used with old MCU firmware versions that only told us that the status word changed, but not which bits of the status word changed πŸ’€
  • button_pressed_emul β€” the front button is still being emulated as pressed πŸ‘‘
  • rtcdev β€” the RTC device. Plot twist: it doesn't actually count real-time πŸ•°οΈ it's only used for the RTC alarm mechanism, so that the board can be configured to wake up from poweroff state at a specific time ⏰
  • rtc_alarm β€” the RTC alarm that was set for the board to wake up on, expressed in MCU time (that's seconds since the last MCU reset) 🌸
  • front_button_poweron β€” whether the front button should power on the device after it's been powered off πŸ”Œ
  • wdt β€” the watchdog driver structure πŸ•
  • trng β€” the RNG driver structure 🎲
  • trng_entropy_ready β€” the RNG entropy ready completion βœ…
  • msg_signed β€” the message signed completion ✍️
  • sign_lock β€” a mutex protecting the message signing state πŸ”
  • sign_requested β€” a flag saying that message signing was requested but not completed yet ⏳
  • sign_err β€” the message signing error number, filled in by the interrupt handler 🚨
  • signature β€” the message signing signature, also filled in by the interrupt handler πŸ–ŠοΈ
  • board_public_key β€” the board public key, if it's stored in the MCU πŸ”‘

πŸ’… SEE ALSO πŸ’…

  • Kernel file ./drivers/platform/cznic/turris-omnia-mcu.h

iykyk, go read the header, it's right there 🧚


okay that's the whole page bestie, you ate that 🫢. This one came to you from ./drivers/platform/cznic, dated October 2026, and it's struct omnia_mcu(9) β€” the Kernel API Manual. mwah πŸ’–β­

πŸ“¦ where this page comes from