MCCI Trusted Bootloader
Simple trusted bootloader and tools for small embedded systems
mcci_flash_sfdp.h File Reference
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  mcci_flash_sfdp_header_t
 the SFTD header More...
 
struct  mcci_flash_sfdp_param_t
 the SFDP parameter header More...
 

Macros

#define _mcci_flash_sfdp_h_   /* prevent multiple includes */
 
#define MCCI_FLASH_SFDP_HEADER_SIGNATURE    ((UINT32_C(0x50) << 24) | (UINT32_C(0x44) << 16) | (UINT32_C(0x46) << 8) | 0x53)
 signature of a SFDP header
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND1_216B   0xF4
 NAND class 1 from JESD216B.
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND1_216D   0xF0
 SFDP access protocol values.
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND2_216B   0xF5
 NAND class 2 from JESD216B.
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND2_216D   0xF1
 NAND class 2 from JESD216D.
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND3_CLASS1_D   0xF2
 reserved for NOR + NAND1
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND3_CLASS2_D   0xF3
 reserved for NOR + NAND2
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND3_RSV1   0xF6
 reserved for NOR + NAND1
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND3_RSV2   0xF7
 reserved for NOR + NAND2
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR   0xFF
 Legacy NOR, JESD216B, 3-byte SFDP command w/ 8 wait states.
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR1_3_8W   0xFC
 NOR xSPI profile 1, 3-byte, 8 wait.
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR1_4_20W   0xFD
 NOR xSPI profile 1, 4 byte, 20 wait.
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR1_4_8W   0xFE
 NOR xSPI profile 1, 4 byte, 8 wait.
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR2   0xFA
 NOR xSPI profile 2, 5-byte addressing SFDP cmd.
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_RSV248   0xF8
 reserved
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_RSV249   0xF9
 reserved
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_RSV251   0xFB
 reserved
 

Functions

static uint32_t McciFlashSfdp_get32 (const uint8_t pValue[4])
 get value of a 32-bit SFDP entry
 
static uint8_t McciFlashSfdpHeader_getProtocol (const mcci_flash_sfdp_header_t *p)
 return the access protocol value from an SFDP header
 
static uint32_t McciFlashSfdpHeader_getSignature (const mcci_flash_sfdp_header_t *p)
 return the signature value from an SFDP header
 
static uint8_t McciFlashSfdpParam_getLength (const mcci_flash_sfdp_param_t *p)
 return length of parameter table in dwords.
 
static uint32_t McciFlashSfdpParam_getPTP (const mcci_flash_sfdp_param_t *p)
 return pointer to parameter table (PTP)
 
static uint16_t McciFlashSfdpParam_getVersion (const mcci_flash_sfdp_param_t *p)
 return version of parameter table
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_VERSION_JES216A   UINT16_C(0x0105)
 version for JESD216A
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_VERSION_JES216B   UINT16_C(0x0106)
 version for JESD216B
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_VERSION_JES216C   UINT16_C(0x0107)
 version for JESD216C
 
#define MCCI_FLASH_SFDP_HEADER_PROPERTY_VERSION_JES216D   UINT16_C(0x0108)
 Major and minor version codes.
 
static uint16_t McciFlashSfdpHeader_getVersion (const mcci_flash_sfdp_header_t *p)
 Get SFDP version compliance claimed by header.
 
#define MCCI_FLASH_SFDP_ID_4BA_INSTR   UINT16_C(0xFF84)
 4-byte Address Instruction Table
 
#define MCCI_FLASH_SFDP_ID_BASIC_SPI   UINT16_C(0xFF00)
 well-known parameter table IDs
 
#define MCCI_FLASH_SFDP_ID_LL_MSPT   UINT16_C(0xFF8B)
 Long Latency NVM Media Specific Parameter Table (MSPT)
 
#define MCCI_FLASH_SFDP_ID_OCTAL_DDR   UINT16_C(0xFF0A)
 Command Sequences to change to Octal DDR (8D-8D-8D) mode.
 
#define MCCI_FLASH_SFDP_ID_QUAD_DDR   UINT16_C(0xFF8D)
 Command Sequences to change to Quad DDR (4S-4D-4D) mode.
 
#define MCCI_FLASH_SFDP_ID_QUAD_IO   UINT16_C(0xFF0C)
 x4 Quad IO with DS
 
#define MCCI_FLASH_SFDP_ID_RPMC   UINT16_C(0xFF03)
 Replay Protected Monotonic Counters (RPMC)
 
#define MCCI_FLASH_SFDP_ID_RSV8E   UINT16_C(0xFF8E)
 Reserved for next Function Specific Table assignment.
 
#define MCCI_FLASH_SFDP_ID_SCCR_MAP   UINT16_C(0xFF87)
 Status, Control and Configuration Register Map.
 
#define MCCI_FLASH_SFDP_ID_SCCR_OFFSETS   UINT16_C(0xFF88)
 Status, Control and Configuration Register Map Offsets for Multi-Chip SPI Memory Devices.
 
#define MCCI_FLASH_SFDP_ID_SCCR_xSPI2   UINT16_C(0xFF09)
 Status, Control and Configuration Register Map for xSPI Profile 2.0.
 
#define MCCI_FLASH_SFDP_ID_SECTOR_MAP   UINT16_C(0xFF81)
 Sector map.
 
#define MCCI_FLASH_SFDP_ID_xSPI1   UINT16_C(0xFF05)
 eXtended Serial Peripheral Interface (xSPI) Profile 1.0
 
#define MCCI_FLASH_SFDP_ID_xSPI2   UINT16_C(0xFF06)
 eXtended Serial Peripheral Interface (xSPI) Profile 2.0
 
static uint16_t McciFlashSfdpParam_getID (const mcci_flash_sfdp_param_t *p)
 return ID of parameter table
 

Macro Definition Documentation

◆ _mcci_flash_sfdp_h_

#define _mcci_flash_sfdp_h_   /* prevent multiple includes */

Definition at line 23 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND1_216B

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND1_216B   0xF4

NAND class 1 from JESD216B.

Definition at line 88 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND1_216D

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND1_216D   0xF0

SFDP access protocol values.

NAND class 1 from JESD216D

Definition at line 84 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND2_216B

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND2_216B   0xF5

NAND class 2 from JESD216B.

Definition at line 89 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND2_216D

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND2_216D   0xF1

NAND class 2 from JESD216D.

Definition at line 85 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND3_CLASS1_D

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND3_CLASS1_D   0xF2

reserved for NOR + NAND1

Definition at line 86 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND3_CLASS2_D

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND3_CLASS2_D   0xF3

reserved for NOR + NAND2

Definition at line 87 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND3_RSV1

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND3_RSV1   0xF6

reserved for NOR + NAND1

Definition at line 90 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND3_RSV2

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NAND3_RSV2   0xF7

reserved for NOR + NAND2

Definition at line 91 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR   0xFF

Legacy NOR, JESD216B, 3-byte SFDP command w/ 8 wait states.

Definition at line 99 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR1_3_8W

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR1_3_8W   0xFC

NOR xSPI profile 1, 3-byte, 8 wait.

Definition at line 96 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR1_4_20W

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR1_4_20W   0xFD

NOR xSPI profile 1, 4 byte, 20 wait.

Definition at line 97 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR1_4_8W

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR1_4_8W   0xFE

NOR xSPI profile 1, 4 byte, 8 wait.

Definition at line 98 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR2

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_NOR2   0xFA

NOR xSPI profile 2, 5-byte addressing SFDP cmd.

Definition at line 94 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_RSV248

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_RSV248   0xF8

reserved

Definition at line 92 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_RSV249

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_RSV249   0xF9

reserved

Definition at line 93 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_RSV251

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_PROTOCOL_RSV251   0xFB

reserved

Definition at line 95 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_VERSION_JES216A

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_VERSION_JES216A   UINT16_C(0x0105)

version for JESD216A

Definition at line 116 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_VERSION_JES216B

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_VERSION_JES216B   UINT16_C(0x0106)

version for JESD216B

Definition at line 115 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_VERSION_JES216C

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_VERSION_JES216C   UINT16_C(0x0107)

version for JESD216C

Definition at line 114 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_PROPERTY_VERSION_JES216D

#define MCCI_FLASH_SFDP_HEADER_PROPERTY_VERSION_JES216D   UINT16_C(0x0108)

Major and minor version codes.

version for JESD216D

Definition at line 113 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_HEADER_SIGNATURE

#define MCCI_FLASH_SFDP_HEADER_SIGNATURE    ((UINT32_C(0x50) << 24) | (UINT32_C(0x44) << 16) | (UINT32_C(0x46) << 8) | 0x53)

signature of a SFDP header

This is the same as 'S', 'F', 'D', 'P' considered as a little-endian value.

Definition at line 71 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_ID_4BA_INSTR

#define MCCI_FLASH_SFDP_ID_4BA_INSTR   UINT16_C(0xFF84)

4-byte Address Instruction Table

Definition at line 157 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_ID_BASIC_SPI

#define MCCI_FLASH_SFDP_ID_BASIC_SPI   UINT16_C(0xFF00)

well-known parameter table IDs

Basic SPI protocol

Definition at line 154 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_ID_LL_MSPT

#define MCCI_FLASH_SFDP_ID_LL_MSPT   UINT16_C(0xFF8B)

Long Latency NVM Media Specific Parameter Table (MSPT)

Definition at line 164 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_ID_OCTAL_DDR

#define MCCI_FLASH_SFDP_ID_OCTAL_DDR   UINT16_C(0xFF0A)

Command Sequences to change to Octal DDR (8D-8D-8D) mode.

Definition at line 163 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_ID_QUAD_DDR

#define MCCI_FLASH_SFDP_ID_QUAD_DDR   UINT16_C(0xFF8D)

Command Sequences to change to Quad DDR (4S-4D-4D) mode.

Definition at line 166 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_ID_QUAD_IO

#define MCCI_FLASH_SFDP_ID_QUAD_IO   UINT16_C(0xFF0C)

x4 Quad IO with DS

Definition at line 165 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_ID_RPMC

#define MCCI_FLASH_SFDP_ID_RPMC   UINT16_C(0xFF03)

Replay Protected Monotonic Counters (RPMC)

Definition at line 156 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_ID_RSV8E

#define MCCI_FLASH_SFDP_ID_RSV8E   UINT16_C(0xFF8E)

Reserved for next Function Specific Table assignment.

Definition at line 167 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_ID_SCCR_MAP

#define MCCI_FLASH_SFDP_ID_SCCR_MAP   UINT16_C(0xFF87)

Status, Control and Configuration Register Map.

Definition at line 160 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_ID_SCCR_OFFSETS

#define MCCI_FLASH_SFDP_ID_SCCR_OFFSETS   UINT16_C(0xFF88)

Status, Control and Configuration Register Map Offsets for Multi-Chip SPI Memory Devices.

Definition at line 161 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_ID_SCCR_xSPI2

#define MCCI_FLASH_SFDP_ID_SCCR_xSPI2   UINT16_C(0xFF09)

Status, Control and Configuration Register Map for xSPI Profile 2.0.

Definition at line 162 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_ID_SECTOR_MAP

#define MCCI_FLASH_SFDP_ID_SECTOR_MAP   UINT16_C(0xFF81)

Sector map.

Definition at line 155 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_ID_xSPI1

#define MCCI_FLASH_SFDP_ID_xSPI1   UINT16_C(0xFF05)

eXtended Serial Peripheral Interface (xSPI) Profile 1.0

Definition at line 158 of file mcci_flash_sfdp.h.

◆ MCCI_FLASH_SFDP_ID_xSPI2

#define MCCI_FLASH_SFDP_ID_xSPI2   UINT16_C(0xFF06)

eXtended Serial Peripheral Interface (xSPI) Profile 2.0

Definition at line 159 of file mcci_flash_sfdp.h.

Function Documentation

◆ McciFlashSfdp_get32()

static uint32_t McciFlashSfdp_get32 ( const uint8_t  pValue[4])
inlinestatic

get value of a 32-bit SFDP entry

Parameters
[in]pValuepoints to a 4-byte field to be fetched.

Definition at line 48 of file mcci_flash_sfdp.h.

Referenced by McciFlashSfdpHeader_getSignature().

◆ McciFlashSfdpHeader_getProtocol()

static uint8_t McciFlashSfdpHeader_getProtocol ( const mcci_flash_sfdp_header_t p)
inlinestatic

return the access protocol value from an SFDP header

Definition at line 76 of file mcci_flash_sfdp.h.

References mcci_flash_sfdp_header_t::properties.

Referenced by McciBootloaderFlash_Mx25v8035f_storageInit().

◆ McciFlashSfdpHeader_getSignature()

static uint32_t McciFlashSfdpHeader_getSignature ( const mcci_flash_sfdp_header_t p)
inlinestatic

return the signature value from an SFDP header

Definition at line 60 of file mcci_flash_sfdp.h.

References McciFlashSfdp_get32(), and mcci_flash_sfdp_header_t::signature.

Referenced by McciBootloaderFlash_Mx25v8035f_storageInit().

◆ McciFlashSfdpHeader_getVersion()

static uint16_t McciFlashSfdpHeader_getVersion ( const mcci_flash_sfdp_header_t p)
inlinestatic

Get SFDP version compliance claimed by header.

Definition at line 106 of file mcci_flash_sfdp.h.

References mcci_flash_sfdp_header_t::properties.

Referenced by McciBootloaderFlash_Mx25v8035f_storageInit().

◆ McciFlashSfdpParam_getID()

static uint16_t McciFlashSfdpParam_getID ( const mcci_flash_sfdp_param_t p)
inlinestatic

return ID of parameter table

Definition at line 147 of file mcci_flash_sfdp.h.

References mcci_flash_sfdp_param_t::dword1, and mcci_flash_sfdp_param_t::dword2.

◆ McciFlashSfdpParam_getLength()

static uint8_t McciFlashSfdpParam_getLength ( const mcci_flash_sfdp_param_t p)
inlinestatic

return length of parameter table in dwords.

Definition at line 131 of file mcci_flash_sfdp.h.

References mcci_flash_sfdp_param_t::dword1.

◆ McciFlashSfdpParam_getPTP()

static uint32_t McciFlashSfdpParam_getPTP ( const mcci_flash_sfdp_param_t p)
inlinestatic

return pointer to parameter table (PTP)

Definition at line 173 of file mcci_flash_sfdp.h.

References mcci_flash_sfdp_param_t::dword2.

◆ McciFlashSfdpParam_getVersion()

static uint16_t McciFlashSfdpParam_getVersion ( const mcci_flash_sfdp_param_t p)
inlinestatic

return version of parameter table

Definition at line 138 of file mcci_flash_sfdp.h.

References mcci_flash_sfdp_param_t::dword1.