Qualcomm SMEM Items

This is a compilation of the SMEM items defined in the codeaurora kernel.

3: SMEM_VERSION_INFO
Contains an array of 32 little endian integers, defining the version of things.

7: SMEM_SPINLOCK_ARRAY
An array of 8 32-bit lock entries, for a total of 32 bytes in size.

MSM7x30
On MSM7x30 Dekker's algorithm is used. Each lock is described by the following structure:

struct dek_spinlock { u8 self_lock; u8 other_lock; u8 next_yield; u8 pad; };

With the application CPU being "self_lock" and represented as "next_yield" 0.

MSM8x60
On MSM8x60 the spinlock mechanism is replaced by ldrex/strexeq.

The application CPU is represented by the little endian id 1, with 0 representing the lock being free.

427 - 434: SMEM_SMP2P_APPS_BASE
Each SMEM item consists of a header, Followed by a list of 16 entries of: struct smp2p_header { u8 magic[4]; u8 version; u8 features[3]; __le16 local_pid; __le16 remote_pid; __le16 count; __le16 valid; __le32 flags; };

Magic
Must be "$SMP"

Version
Currently 1

Features
A set of bits, each representing supported features:
 * 1) Subsystem Restart Ack

Local PID
ID of the local processor for this item.

Remote PID
ID of the remote processor for this item.

Count
Number of allocated entries following the header.

Valid
Number of entries currently in use

Flags
Following the SMP2P header is a list of count entries of: struct smp2p_entry { u8 name[16]; __le32 value; };

Name
Identifier for this entry

Value
The 32 bit value for this SMP2P entry. Normally only used to signal single-bit events.

469: SMEM_IMAGE_VERSION_TABLE
The image version table is an array of entries each describing individual components in the system.

The entries are described by the struct: struct image_version { char name[75]; char variant[20] char pad; char oem[32]; };

478: SMEM_GLINK_NATIVE_XPRT_DESCRIPTOR
The GLINK SMEM XPRT descriptor contains the read and write index for the TX and RX FIFOs.

struct glink_desc { __le32 tx_read; __le32 tx_write; __le32 rx_read; __le32 rw_write; };

TX Read/write
Indices into the TX FIFO (item #479), the producer puts data in the FIFO and updates the write index', it then signals the remote processor which reads the data and updates the read index.

RX Read/write
Analogous to the TX, but roles are switched.

479, 480: SMEM_GLINK_NATIVE_XPRT_FIFO
Ring buffer for GLINK TX and RX data, respectively (as seen from APPS).

Multiple remote targets can be supported based on SMEM partitioning.

505: SMEM_NUM_ITEMS
Current number of defined SMEM items