|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <stdbool.h>#include <stdint.h>Go to the source code of this file.
Classes | |
| struct | emmc_card_info_t |
Macros | |
| #define | EMMC_CARD_MID_KIOXIA 0x11U /* CID MID */ |
| #define | EMMC_CARD_PNM "004GA1" /* CID PNM */ |
| #define | EMMC_CARD_SEC_COUNT 0x00760000UL /* 3,959,422,976 B */ |
| #define | EMMC_CARD_EXT_CSD_REV_MIN 7U /* eMMC 5.0 */ |
| #define | EMMC_EXT_CSD_CACHE_CTRL 33U |
| #define | EMMC_EXT_CSD_RST_N_FUNCTION 162U |
| #define | EMMC_EXT_CSD_WR_REL_SET 167U |
| #define | EMMC_EXT_CSD_BUS_WIDTH 183U |
| #define | EMMC_EXT_CSD_HS_TIMING 185U |
| #define | EMMC_EXT_CSD_REV 192U |
| #define | EMMC_EXT_CSD_DEVICE_TYPE 196U |
| #define | EMMC_EXT_CSD_SEC_COUNT 212U /* 4 bytes, little-endian */ |
| #define | EMMC_EXT_CSD_PRE_EOL_INFO 267U |
| #define | EMMC_EXT_CSD_LIFE_TIME_A 268U |
| #define | EMMC_EXT_CSD_LIFE_TIME_B 269U |
Enumerations | |
| enum | emmc_card_issue_t { EMMC_CARD_OK = 0 , EMMC_CARD_WRONG_MAKER = 1U << 0 , EMMC_CARD_WRONG_PART = 1U << 1 , EMMC_CARD_WRONG_SIZE = 1U << 2 , EMMC_CARD_OLD_REVISION = 1U << 3 , EMMC_CARD_WEAR_WARNING = 1U << 4 , EMMC_CARD_NO_RELIABLE_WRITE = 1U << 5 , EMMC_CARD_CACHE_ON = 1U << 6 } |
Functions | |
| void | emmc_card_parse (const uint32_t cid[4], const uint8_t ext_csd[512], emmc_card_info_t *out) |
| uint32_t | emmc_card_check (const emmc_card_info_t *info) |
| #define EMMC_CARD_EXT_CSD_REV_MIN 7U /* eMMC 5.0 */ |
Definition at line 21 of file emmc_card.h.
Referenced by emmc_card_check().
| #define EMMC_CARD_MID_KIOXIA 0x11U /* CID MID */ |
Definition at line 18 of file emmc_card.h.
Referenced by emmc_card_check().
| #define EMMC_CARD_PNM "004GA1" /* CID PNM */ |
Definition at line 19 of file emmc_card.h.
Referenced by emmc_card_check().
| #define EMMC_CARD_SEC_COUNT 0x00760000UL /* 3,959,422,976 B */ |
Definition at line 20 of file emmc_card.h.
Referenced by emmc_card_check().
| #define EMMC_EXT_CSD_BUS_WIDTH 183U |
Definition at line 27 of file emmc_card.h.
| #define EMMC_EXT_CSD_CACHE_CTRL 33U |
Definition at line 24 of file emmc_card.h.
Referenced by datasheet_ext_csd(), emmc_card_parse(), and test_each_issue().
| #define EMMC_EXT_CSD_DEVICE_TYPE 196U |
Definition at line 30 of file emmc_card.h.
Referenced by datasheet_ext_csd(), and emmc_card_parse().
| #define EMMC_EXT_CSD_HS_TIMING 185U |
Definition at line 28 of file emmc_card.h.
| #define EMMC_EXT_CSD_LIFE_TIME_A 268U |
Definition at line 33 of file emmc_card.h.
Referenced by datasheet_ext_csd(), and emmc_card_parse().
| #define EMMC_EXT_CSD_LIFE_TIME_B 269U |
Definition at line 34 of file emmc_card.h.
Referenced by datasheet_ext_csd(), emmc_card_parse(), and test_each_issue().
| #define EMMC_EXT_CSD_PRE_EOL_INFO 267U |
Definition at line 32 of file emmc_card.h.
Referenced by datasheet_ext_csd(), emmc_card_parse(), and test_each_issue().
| #define EMMC_EXT_CSD_REV 192U |
Definition at line 29 of file emmc_card.h.
Referenced by datasheet_ext_csd(), emmc_card_parse(), and test_each_issue().
| #define EMMC_EXT_CSD_RST_N_FUNCTION 162U |
Definition at line 25 of file emmc_card.h.
Referenced by datasheet_ext_csd(), and emmc_card_parse().
| #define EMMC_EXT_CSD_SEC_COUNT 212U /* 4 bytes, little-endian */ |
Definition at line 31 of file emmc_card.h.
Referenced by datasheet_ext_csd(), emmc_card_parse(), and test_each_issue().
| #define EMMC_EXT_CSD_WR_REL_SET 167U |
Definition at line 26 of file emmc_card.h.
Referenced by datasheet_ext_csd(), emmc_card_parse(), and test_each_issue().
| enum emmc_card_issue_t |
| Enumerator | |
|---|---|
| EMMC_CARD_OK | |
| EMMC_CARD_WRONG_MAKER | |
| EMMC_CARD_WRONG_PART | |
| EMMC_CARD_WRONG_SIZE | |
| EMMC_CARD_OLD_REVISION | |
| EMMC_CARD_WEAR_WARNING | |
| EMMC_CARD_NO_RELIABLE_WRITE | |
| EMMC_CARD_CACHE_ON | |
Definition at line 53 of file emmc_card.h.
| uint32_t emmc_card_check | ( | const emmc_card_info_t * | info | ) |
Definition at line 34 of file emmc_card.c.
References EMMC_CARD_CACHE_ON, EMMC_CARD_EXT_CSD_REV_MIN, EMMC_CARD_MID_KIOXIA, EMMC_CARD_NO_RELIABLE_WRITE, EMMC_CARD_OK, EMMC_CARD_OLD_REVISION, EMMC_CARD_PNM, EMMC_CARD_SEC_COUNT, EMMC_CARD_WEAR_WARNING, EMMC_CARD_WRONG_MAKER, EMMC_CARD_WRONG_PART, EMMC_CARD_WRONG_SIZE, and info.
Referenced by port_start(), test_datasheet_part(), and test_each_issue().
| void emmc_card_parse | ( | const uint32_t | cid[4], |
| const uint8_t | ext_csd[512], | ||
| emmc_card_info_t * | out ) |
Definition at line 5 of file emmc_card.c.
References EMMC_EXT_CSD_CACHE_CTRL, EMMC_EXT_CSD_DEVICE_TYPE, EMMC_EXT_CSD_LIFE_TIME_A, EMMC_EXT_CSD_LIFE_TIME_B, EMMC_EXT_CSD_PRE_EOL_INFO, EMMC_EXT_CSD_REV, EMMC_EXT_CSD_RST_N_FUNCTION, EMMC_EXT_CSD_SEC_COUNT, and EMMC_EXT_CSD_WR_REL_SET.
Referenced by port_start(), test_datasheet_part(), and test_each_issue().