Difference between revisions of "Qualcomm SMEM Items"

From eLinux.org
Jump to: navigation, search
m (Local PID)
(Add "compute" entries to SMP2P SMEM items table)
 
(16 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
=== 2: SMEM_ALLOCATION_TABLE ===
 
=== 2: SMEM_ALLOCATION_TABLE ===
 
=== 3: SMEM_VERSION_INFO ===
 
=== 3: SMEM_VERSION_INFO ===
 +
Contains an array of 32 little endian integers, defining the version of things.
 +
 +
{| class="wikitable"
 +
!colspan="2"|Known entries
 +
|-
 +
|7
 +
|Modem/Master SBL
 +
|}
 +
 
=== 4: SMEM_HW_RESET_DETECT ===
 
=== 4: SMEM_HW_RESET_DETECT ===
 
=== 5: SMEM_AARM_WARM_BOOT ===
 
=== 5: SMEM_AARM_WARM_BOOT ===
 
=== 6: SMEM_DIAG_ERR_MESSAGE ===
 
=== 6: SMEM_DIAG_ERR_MESSAGE ===
 
=== 7: SMEM_SPINLOCK_ARRAY ===
 
=== 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.
 +
 
=== 8: SMEM_MEMORY_BARRIER_LOCATION ===
 
=== 8: SMEM_MEMORY_BARRIER_LOCATION ===
 
=== 8: SMEM_FIXED_ITEM_LAST ===
 
=== 8: SMEM_FIXED_ITEM_LAST ===
Line 92: Line 120:
 
=== 425: SMEM_SSR_REASON_VCODEC0 ===
 
=== 425: SMEM_SSR_REASON_VCODEC0 ===
 
=== 427 - 434: SMEM_SMP2P_APPS_BASE ===
 
=== 427 - 434: SMEM_SMP2P_APPS_BASE ===
Each SMEM item consists of a header, Followed by a list of 16 entries of:
 
 
 
{| class="wikitable"
 
{| class="wikitable"
!colspan="8"|SMP2P SMEM item
+
!colspan="3"|SMP2P Items
 +
|-
 +
|428
 +
|Apps
 +
|Modem
 
|-
 
|-
|0
+
|429
|1
+
|Apps
|2
+
|Audio
|3
+
|-
|4
+
|430
|5
+
|Apps
|6
+
|Sensor
|7
+
|-
 +
|432
 +
|Apps
 +
|Compute
 
|-
 
|-
|colspan="4"|Magic
+
|94
|V
+
|Compute
|colspan="3"|Features
+
|Apps
 
|-
 
|-
|colspan="2"|L
+
|435
|colspan="2"|R
+
|Modem
|colspan="2"|Count
+
|Apps
|colspan="2"|Valid
 
 
|-
 
|-
|colspan="4"|Flags
+
|443
 +
|Audio
 +
|Apps
 
|-
 
|-
 +
|481
 +
|Sensor
 +
|Apps
 
|}
 
|}
 +
 +
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 ====
 
==== Magic ====
Line 123: Line 172:
  
 
==== Version ====
 
==== Version ====
 +
Currently '''1'''
  
 
==== Features ====
 
==== Features ====
 +
A set of bits, each representing supported features:
 +
# Subsystem Restart Ack
  
 
==== Local PID ====
 
==== Local PID ====
Line 130: Line 182:
  
 
==== Remote PID ====
 
==== Remote PID ====
 +
ID of the remote processor for this item.
  
 
==== Count ====
 
==== Count ====
 +
Number of allocated entries following the header.
  
==== Valid entries ====
+
==== Valid ====
 +
Number of entries currently in use
  
 
==== Flags ====
 
==== 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.
 +
 +
=== 435: SMEM_SMP2P_MODEM_BASE ===
 +
=== 443: SMEM_SMP2P_AUDIO_BASE ===
 +
=== 451: SMEM_SMP2P_WIRLESS_BASE ===
 +
=== 459: SMEM_SMP2P_POWER_BASE ===
 +
=== 467: SMEM_FLASH_DEVICE_INFO ===
 +
=== 468: SMEM_BAM_PIPE_MEMORY ===
 +
=== 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];
 +
};
  
 
{| class="wikitable"
 
{| class="wikitable"
!colspan="16"|SMP2P entries item
+
!colspan="2"|Known entries
 
|-
 
|-
 
|0
 
|0
 +
|Boot
 +
|-
 
|1
 
|1
|2
+
|TZ
 +
|-
 
|3
 
|3
|4
+
|RPM
|5
+
|-
|6
 
|7
 
|8
 
|9
 
 
|10
 
|10
 +
|Application subsystem
 +
|-
 
|11
 
|11
 +
|Modem subsystem
 +
|-
 
|12
 
|12
 +
|ADSP subsystem
 +
|-
 
|13
 
|13
 +
|Communication subsystem
 +
|-
 
|14
 
|14
|15
+
|Video subsystem
|-
 
|colspan="16"|Name
 
|-
 
|colspan="4"|Flags
 
|-
 
 
|}
 
|}
  
==== Name ====
 
 
==== Flags ====
 
 
=== 435: SMEM_SMP2P_MODEM_BASE ===
 
=== 443: SMEM_SMP2P_AUDIO_BASE ===
 
=== 451: SMEM_SMP2P_WIRLESS_BASE ===
 
=== 459: SMEM_SMP2P_POWER_BASE ===
 
=== 467: SMEM_FLASH_DEVICE_INFO ===
 
=== 468: SMEM_BAM_PIPE_MEMORY ===
 
=== 469: SMEM_IMAGE_VERSION_TABLE ===
 
 
=== 470: SMEM_LC_DEBUGGER ===
 
=== 470: SMEM_LC_DEBUGGER ===
 
=== 471: SMEM_FLASH_NAND_DEV_INFO ===
 
=== 471: SMEM_FLASH_NAND_DEV_INFO ===
 
=== 472: SMEM_A2_BAM_DESCRIPTOR_FIFO ===
 
=== 472: SMEM_A2_BAM_DESCRIPTOR_FIFO ===
=== 473: SMEM_CLOCK_INFO ===
+
=== 473: SMEM_CPR_CONFIG ===
=== 474: SMEM_IPC_FIFO ===
+
=== 474: SMEM_CLOCK_INFO ===
=== 475: SMEM_RF_EEPROM_DATA ===
+
=== 475: SMEM_IPC_FIFO ===
=== 476: SMEM_COEX_MDM_WCN ===
+
=== 476: SMEM_RF_EEPROM_DATA ===
=== 477: SMEM_GLINK_NATIVE_XPRT_DESCRIPTOR ===
+
=== 477: SMEM_COEX_MDM_WCN ===
=== 478: SMEM_GLINK_NATIVE_XPRT_FIFO_0 ===
+
=== 478: SMEM_GLINK_NATIVE_XPRT_DESCRIPTOR ===
=== 479: SMEM_GLINK_NATIVE_XPRT_FIFO_1 ===
+
The GLINK SMEM XPRT descriptor contains the read and write index for the TX and RX FIFOs.
=== 480: SMEM_SMP2P_SENSOR_BASE ===
+
 
=== 488: SMEM_SMP2P_TZ_BASE ===
+
struct glink_desc {
=== 496: SMEM_IPA_FILTER_TABLE ===
+
  __le32 tx_read;
=== 497: SMEM_NUM_ITEMS ===
+
  __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.
 +
 
 +
=== 481: SMEM_SMP2P_SENSOR_BASE ===
 +
=== 489: SMEM_SMP2P_TZ_BASE ===
 +
=== 497: SMEM_IPA_FILTER_TABLE ===
 +
=== 505: SMEM_NUM_ITEMS ===
 +
Current number of defined SMEM items

Latest revision as of 17:58, 25 June 2018

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

Contents

0: SMEM_PROC_COMM

1: SMEM_HEAP_INFO

2: SMEM_ALLOCATION_TABLE

3: SMEM_VERSION_INFO

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

Known entries
7 Modem/Master SBL

4: SMEM_HW_RESET_DETECT

5: SMEM_AARM_WARM_BOOT

6: SMEM_DIAG_ERR_MESSAGE

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.

8: SMEM_MEMORY_BARRIER_LOCATION

8: SMEM_FIXED_ITEM_LAST

9: SMEM_AARM_PARTITION_TABLE

10: SMEM_AARM_BAD_BLOCK_TABLE

11: SMEM_RESERVE_BAD_BLOCKS

12: SMEM_WM_UUID

13: SMEM_CHANNEL_ALLOC_TBL

14: SMEM_SMD_BASE_ID

78: SMEM_SMEM_LOG_IDX

79: SMEM_SMEM_LOG_EVENTS

80: SMEM_SMEM_STATIC_LOG_IDX

81: SMEM_SMEM_STATIC_LOG_EVENTS

82: SMEM_SMEM_SLOW_CLOCK_SYNC

83: SMEM_SMEM_SLOW_CLOCK_VALUE

84: SMEM_BIO_LED_BUF

85: SMEM_SMSM_SHARED_STATE

86: SMEM_SMSM_INT_INFO

87: SMEM_SMSM_SLEEP_DELAY

88: SMEM_SMSM_LIMIT_SLEEP

89: SMEM_SLEEP_POWER_COLLAPSE_DISABLED

90: SMEM_KEYPAD_KEYS_PRESSED

91: SMEM_KEYPAD_STATE_UPDATED

92: SMEM_KEYPAD_STATE_IDX

93: SMEM_GPIO_INT

94: SMEM_MDDI_LCD_IDX

95: SMEM_MDDI_HOST_DRIVER_STATE

96: SMEM_MDDI_LCD_DISP_STATE

97: SMEM_LCD_CUR_PANEL

98: SMEM_MARM_BOOT_SEGMENT_INFO

99: SMEM_AARM_BOOT_SEGMENT_INFO

100: SMEM_SLEEP_STATIC

101: SMEM_SCORPION_FREQUENCY

102: SMEM_SMD_PROFILES

103: SMEM_TSSC_BUSY

104: SMEM_HS_SUSPEND_FILTER_INFO

105: SMEM_BATT_INFO

106: SMEM_APPS_BOOT_MODE

107: SMEM_VERSION_FIRST

107: SMEM_VERSION_SMD

131: SMEM_VERSION_LAST

132: SMEM_OSS_RRCASN1_BUF1

133: SMEM_OSS_RRCASN1_BUF2

134: SMEM_ID_VENDOR0

135: SMEM_ID_VENDOR1

136: SMEM_ID_VENDOR2

137: SMEM_HW_SW_BUILD_ID

138: SMEM_SMD_BASE_ID_2

202: SMEM_SMD_FIFO_BASE_ID_2

266: SMEM_CHANNEL_ALLOC_TBL_2

330: SMEM_I2C_MUTEX

331: SMEM_SCLK_CONVERSION

332: SMEM_SMD_SMSM_INTR_MUX

333: SMEM_SMSM_CPU_INTR_MASK

334: SMEM_APPS_DEM_SLAVE_DATA

335: SMEM_QDSP6_DEM_SLAVE_DATA

336: SMEM_CLKREGIM_BSP

337: SMEM_CLKREGIM_SOURCES

338: SMEM_SMD_FIFO_BASE_ID

402: SMEM_USABLE_RAM_PARTITION_TABLE

403: SMEM_POWER_ON_STATUS_INFO

404: SMEM_DAL_AREA

405: SMEM_SMEM_LOG_POWER_IDX

406: SMEM_SMEM_LOG_POWER_WRAP

407: SMEM_SMEM_LOG_POWER_EVENTS

408: SMEM_ERR_CRASH_LOG

409: SMEM_ERR_F3_TRACE_LOG

410: SMEM_SMD_BRIDGE_ALLOC_TABLE

411: SMEM_SMDLITE_TABLE

412: SMEM_SD_IMG_UPGRADE_STATUS

413: SMEM_SEFS_INFO

414: SMEM_RESET_LOG

415: SMEM_RESET_LOG_SYMBOLS

416: SMEM_MODEM_SW_BUILD_ID

417: SMEM_SMEM_LOG_MPROC_WRAP

418: SMEM_BOOT_INFO_FOR_APPS

419: SMEM_SMSM_SIZE_INFO

420: SMEM_SMD_LOOPBACK_REGISTER

421: SMEM_SSR_REASON_MSS0

422: SMEM_SSR_REASON_WCNSS0

423: SMEM_SSR_REASON_LPASS0

424: SMEM_SSR_REASON_DSPS0

425: SMEM_SSR_REASON_VCODEC0

427 - 434: SMEM_SMP2P_APPS_BASE

SMP2P Items
428 Apps Modem
429 Apps Audio
430 Apps Sensor
432 Apps Compute
94 Compute Apps
435 Modem Apps
443 Audio Apps
481 Sensor Apps

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.

435: SMEM_SMP2P_MODEM_BASE

443: SMEM_SMP2P_AUDIO_BASE

451: SMEM_SMP2P_WIRLESS_BASE

459: SMEM_SMP2P_POWER_BASE

467: SMEM_FLASH_DEVICE_INFO

468: SMEM_BAM_PIPE_MEMORY

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];
};
Known entries
0 Boot
1 TZ
3 RPM
10 Application subsystem
11 Modem subsystem
12 ADSP subsystem
13 Communication subsystem
14 Video subsystem

470: SMEM_LC_DEBUGGER

471: SMEM_FLASH_NAND_DEV_INFO

472: SMEM_A2_BAM_DESCRIPTOR_FIFO

473: SMEM_CPR_CONFIG

474: SMEM_CLOCK_INFO

475: SMEM_IPC_FIFO

476: SMEM_RF_EEPROM_DATA

477: SMEM_COEX_MDM_WCN

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.

481: SMEM_SMP2P_SENSOR_BASE

489: SMEM_SMP2P_TZ_BASE

497: SMEM_IPA_FILTER_TABLE

505: SMEM_NUM_ITEMS

Current number of defined SMEM items