fuchsia.hardware.spmi

Added: HEAD

PROTOCOLS

Debug

Defined in fuchsia.hardware.spmi/spmi.fidl

ConnectTarget

Connects to the target device with the given ID. Equivalent to connecting to TargetService via the corresponding driver node.

Returns INVALID_ARGS if target_id is greater than or equal to MAX_TARGETS. May return an error if there is no such target on the bus; otherwise errors will be returned when attempting to access the client.

Request

NameType
target_id uint8
server server_end:Device

Response

NameType
payload Debug_ConnectTarget_Result

GetControllerProperties

Returns the properties of the host SPMI controller.

Request

<EMPTY>

Response

NameType
payload DebugGetControllerPropertiesResponse

Device

Defined in fuchsia.hardware.spmi/spmi.fidl

Each instance of Device represents a target/secondary SPMI device on a SPMI bus. To support multiple SPMI devices, multiple nodes must be instantiated.

CancelWatchControllerWriteCommands

Cancels an pending call to WatchControllerWriteCommands. address and size must exactly match a previous call to WatchControllerWriteCommands(), otherwise NOT_FOUND is returned.

Request

NameType
address uint8
size uint16

Response

NameType
payload Device_CancelWatchControllerWriteCommands_Result

ExtendedRegisterReadLong

Issue one Extended Register Read Long SPMI command to the SPMI device. Used to read from a 16 bit SPMI register space. Up to 8 bytes can be read at a time. When successful, it returns size_bytes in data read from address in the device.

Request

NameType
address uint16
size_bytes uint32

Response

NameType
payload Device_ExtendedRegisterReadLong_Result

ExtendedRegisterWriteLong

Issue one Extended Register Write Long SPMI command to the SPMI device. Used to write to a 16 bit SPMI register space. Up to 8 bytes can be written at a time. When this command is successful, data will be written to address in the device.

Request

NameType
address uint16
data vector<uint8>:8

Response

NameType
payload Device_ExtendedRegisterWriteLong_Result

GetProperties

Get the properties of the SPMI device.

Request

<EMPTY>

Response

NameType
payload Device_GetProperties_Result

WatchControllerWriteCommands

Hanging-get method to receive controller write commands from the device. address and size specify the register range to monitor for commands. Multiple overlapping calls to this method are not allowed. Returns INVALID_ARGS if address or size are invalid, or BAD_STATE if another call is pending for this register range. Returns CANCELED if CancelWatchControllerWriteCommands() was called for this register range.

Request

NameType
address uint8
size uint16

Response

NameType
payload Device_WatchControllerWriteCommands_Result

STRUCTS

Debug_ConnectTarget_Response

Defined in fuchsia.hardware.spmi/spmi.fidl

<EMPTY>

Device_CancelWatchControllerWriteCommands_Response

Defined in fuchsia.hardware.spmi/spmi.fidl

<EMPTY>

Device_ExtendedRegisterReadLong_Response

Defined in fuchsia.hardware.spmi/spmi.fidl

FieldTypeDescriptionDefault
data vector<uint8>:8 No default

Device_ExtendedRegisterWriteLong_Response

Defined in fuchsia.hardware.spmi/spmi.fidl

<EMPTY>

Device_WatchControllerWriteCommands_Response

Defined in fuchsia.hardware.spmi/spmi.fidl

FieldTypeDescriptionDefault
writes vector<Register8>:256 No default

Register8

Defined in fuchsia.hardware.spmi/spmi.fidl

A single register read from or written to with an SPMI command that uses an 8-bit address.

FieldTypeDescriptionDefault
address uint8 No default
data uint8 No default

ENUMS

DriverError flexible

Type: uint32

Defined in fuchsia.hardware.spmi/spmi.fidl

Errors that this driver may return.

NameValueDescription
1

The driver encountered an otherwise unspecified error while performing the operation.

2

The operation is not implemented, supported, or enabled.

3

An argument is invalid.

4

The operation failed because the current state of the driver does not allow it, or a precondition of the operation is not satisfied.

5

The device returned a NACK (negative Acknowledgment). The client may retry the operation after a NACK was sent for instance due to a parity error.

6

The hanging-get method was canceled.

7

No pending hanging-get method was found for the given arguments.

TABLES

ControllerInfo

Defined in fuchsia.hardware.spmi/metadata.fidl

'SPMI'

OrdinalFieldTypeDescription
id uint32

Board-specific controller ID. Optional.

targets vector<TargetInfo>:16

SPMI target devices on this bus. Optional.

DebugGetControllerPropertiesResponse

Defined in fuchsia.hardware.spmi/spmi.fidl

OrdinalFieldTypeDescription
name string:64

User friendly string for the controller name. If not set, the controller name is unknown. If included, this string must be non-empty.

Optional.

Device_GetProperties_Response

Defined in fuchsia.hardware.spmi/spmi.fidl

OrdinalFieldTypeDescription
sid uint8

Unique SPMI target/secondary identifier, corresponds to the SPMI specification sid. Up to 16 secondaries are identifed with an id from 0 to 15 inclusive.

Required.

name string:64

User friendly string for the device name. If not set, the device name is unknown. If included, this string must be non-empty.

Optional.

SubTargetInfo

Defined in fuchsia.hardware.spmi/metadata.fidl

OrdinalFieldTypeDescription
address uint16

The SPMI base register address. Accesses to this sub-target will be restricted to the range [0, size) and offset by address. Required.

size uint32

The size of the SPMI register region accessible to this sub-target. The sum of address and size must be less than or equal to 65536. Required.

name string:64

The name of this sub-target. Optional.

TargetInfo

Defined in fuchsia.hardware.spmi/metadata.fidl

OrdinalFieldTypeDescription
id uint8

SPMI target ID in [0, MAX_TARGETS), unique for this controller. Required.

sub_targets vector<SubTargetInfo>:65536

Sub-target register regions within this target. Optional.

name string:64

The name of this target. Optional.

UNIONS

Debug_ConnectTarget_Result strict

Defined in fuchsia.hardware.spmi/spmi.fidl

OrdinalVariantTypeDescription
response Debug_ConnectTarget_Response
err DriverError

Device_CancelWatchControllerWriteCommands_Result strict

Defined in fuchsia.hardware.spmi/spmi.fidl

OrdinalVariantTypeDescription
response Device_CancelWatchControllerWriteCommands_Response
err DriverError
framework_err internal

Device_ExtendedRegisterReadLong_Result strict

Defined in fuchsia.hardware.spmi/spmi.fidl

OrdinalVariantTypeDescription
response Device_ExtendedRegisterReadLong_Response
err DriverError
framework_err internal

Device_ExtendedRegisterWriteLong_Result strict

Defined in fuchsia.hardware.spmi/spmi.fidl

OrdinalVariantTypeDescription
response Device_ExtendedRegisterWriteLong_Response
err DriverError
framework_err internal

Device_GetProperties_Result strict

Defined in fuchsia.hardware.spmi/spmi.fidl

OrdinalVariantTypeDescription
response Device_GetProperties_Response
framework_err internal

Device_WatchControllerWriteCommands_Result strict

Defined in fuchsia.hardware.spmi/spmi.fidl

OrdinalVariantTypeDescription
response Device_WatchControllerWriteCommands_Response
err DriverError
framework_err internal

CONSTANTS

NameValueTypeDescription
CONTROLLER_INFO_METADATA_TYPE 1229803603 uint32

ControllerInfo is passed to SPMI controller drivers via metadata.

MAX_CONTROLLER_WRITE_COMMANDS 256 uint32

An arbitrary limit on the number of register writes that can be returned to WatchControllerWriteCommands().

MAX_EXTENDED_LONG_TRANSFER_SIZE 8 uint32

The maximum number of bytes that can be read or written in a single Extended Long SPMI command.

MAX_SPMI_NAME_LEN 64 uint32

Maximum length of the SPMI device name.

MAX_SUB_TARGETS 65536 uint32
MAX_TARGETS 16 uint32

SERVICES

DebugService

Defined in fuchsia.hardware.spmi/spmi.fidl

NameTypeTransport
device fuchsia.hardware.spmi/Debug Channel

SubTargetService

Defined in fuchsia.hardware.spmi/spmi.fidl

NameTypeTransport
device fuchsia.hardware.spmi/Device Channel

TargetService

Defined in fuchsia.hardware.spmi/spmi.fidl

NameTypeTransport
device fuchsia.hardware.spmi/Device Channel