include/linux/turris-omnia-mcu-interface.h

Source file repositories/reference/linux-study-clean/include/linux/turris-omnia-mcu-interface.h

File Facts

System
Linux kernel
Corpus path
include/linux/turris-omnia-mcu-interface.h
Extension
.h
Size
11399 bytes
Lines
398
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef __TURRIS_OMNIA_MCU_INTERFACE_H
#define __TURRIS_OMNIA_MCU_INTERFACE_H

#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/types.h>
#include <linux/unaligned.h>
#include <asm/byteorder.h>

enum omnia_commands_e {
	OMNIA_CMD_GET_STATUS_WORD		= 0x01, /* slave sends status word back */
	OMNIA_CMD_GENERAL_CONTROL		= 0x02,
	OMNIA_CMD_LED_MODE			= 0x03, /* default/user */
	OMNIA_CMD_LED_STATE			= 0x04, /* LED on/off */
	OMNIA_CMD_LED_COLOR			= 0x05, /* LED number + RED + GREEN + BLUE */
	OMNIA_CMD_USER_VOLTAGE			= 0x06,
	OMNIA_CMD_SET_BRIGHTNESS		= 0x07,
	OMNIA_CMD_GET_BRIGHTNESS		= 0x08,
	OMNIA_CMD_GET_RESET			= 0x09,
	OMNIA_CMD_GET_FW_VERSION_APP		= 0x0A, /* 20B git hash number */
	OMNIA_CMD_SET_WATCHDOG_STATE		= 0x0B, /* 0 - disable
							 * 1 - enable / ping
							 * after boot watchdog is started
							 * with 2 minutes timeout
							 */

	/* OMNIA_CMD_WATCHDOG_STATUS		= 0x0C, not implemented anymore */

	OMNIA_CMD_GET_WATCHDOG_STATE		= 0x0D,
	OMNIA_CMD_GET_FW_VERSION_BOOT		= 0x0E, /* 20B Git hash number */
	OMNIA_CMD_GET_FW_CHECKSUM		= 0x0F, /* 4B length, 4B checksum */

	/* available if FEATURES_SUPPORTED bit set in status word */
	OMNIA_CMD_GET_FEATURES			= 0x10,

	/* available if EXT_CMD bit set in features */
	OMNIA_CMD_GET_EXT_STATUS_DWORD		= 0x11,
	OMNIA_CMD_EXT_CONTROL			= 0x12,
	OMNIA_CMD_GET_EXT_CONTROL_STATUS	= 0x13,

	/* available if NEW_INT_API bit set in features */
	OMNIA_CMD_GET_INT_AND_CLEAR		= 0x14,
	OMNIA_CMD_GET_INT_MASK			= 0x15,
	OMNIA_CMD_SET_INT_MASK			= 0x16,

	/* available if FLASHING bit set in features */
	OMNIA_CMD_FLASH				= 0x19,

	/* available if WDT_PING bit set in features */
	OMNIA_CMD_SET_WDT_TIMEOUT		= 0x20,
	OMNIA_CMD_GET_WDT_TIMELEFT		= 0x21,

	/* available if POWEROFF_WAKEUP bit set in features */
	OMNIA_CMD_SET_WAKEUP			= 0x22,
	OMNIA_CMD_GET_UPTIME_AND_WAKEUP		= 0x23,
	OMNIA_CMD_POWER_OFF			= 0x24,

	/* available if USB_OVC_PROT_SETTING bit set in features */
	OMNIA_CMD_SET_USB_OVC_PROT		= 0x25,
	OMNIA_CMD_GET_USB_OVC_PROT		= 0x26,

	/* available if TRNG bit set in features */
	OMNIA_CMD_TRNG_COLLECT_ENTROPY		= 0x28,

	/* available if CRYPTO bit set in features */
	OMNIA_CMD_CRYPTO_GET_PUBLIC_KEY		= 0x29,
	OMNIA_CMD_CRYPTO_SIGN_MESSAGE		= 0x2A,
	OMNIA_CMD_CRYPTO_COLLECT_SIGNATURE	= 0x2B,

	/* available if BOARD_INFO it set in features */
	OMNIA_CMD_BOARD_INFO_GET		= 0x2C,
	OMNIA_CMD_BOARD_INFO_BURN		= 0x2D,

	/* available only at address 0x2b (LED-controller) */
	/* available only if LED_GAMMA_CORRECTION bit set in features */
	OMNIA_CMD_SET_GAMMA_CORRECTION		= 0x30,
	OMNIA_CMD_GET_GAMMA_CORRECTION		= 0x31,

	/* available only at address 0x2b (LED-controller) */
	/* available only if PER_LED_CORRECTION bit set in features */
	/* available only if FROM_BIT_16_INVALID bit NOT set in features */
	OMNIA_CMD_SET_LED_CORRECTIONS		= 0x32,
	OMNIA_CMD_GET_LED_CORRECTIONS		= 0x33,
};

enum omnia_flashing_commands_e {
	OMNIA_FLASH_CMD_UNLOCK		= 0x01,
	OMNIA_FLASH_CMD_SIZE_AND_CSUM	= 0x02,
	OMNIA_FLASH_CMD_PROGRAM		= 0x03,
	OMNIA_FLASH_CMD_RESET		= 0x04,

Annotation

Implementation Notes