summaryrefslogtreecommitdiff
path: root/components/drivers/include
diff options
context:
space:
mode:
authorCYFS <[email protected]>2026-09-07 11:18:41 +0800
committerGitHub <[email protected]>2026-09-07 11:18:41 +0800
commit280bcfeec362f2164140606860b22026e5031c3d (patch)
tree70567c4bf1a10a35ad660982b2da832ad9d7e53a /components/drivers/include
parent163d178e29dfc72a30ed837267a8249f2a5771a1 (diff)
[device][mmcsd] Fix Arm Compiler 5 build compatibility #11690
Diffstat (limited to 'components/drivers/include')
-rw-r--r--components/drivers/include/drivers/blk.h23
-rw-r--r--components/drivers/include/drivers/mmcsd_card.h238
-rw-r--r--components/drivers/include/drivers/mmcsd_cmd.h130
3 files changed, 210 insertions, 181 deletions
diff --git a/components/drivers/include/drivers/blk.h b/components/drivers/include/drivers/blk.h
index 95c1932456..cec39e33b8 100644
--- a/components/drivers/include/drivers/blk.h
+++ b/components/drivers/include/drivers/blk.h
@@ -40,9 +40,9 @@ struct rt_blk_disk
struct rt_dm_ida *ida;
#endif
- rt_uint32_t read_only:1;
- rt_uint32_t parallel_io:1;
- rt_uint32_t removable:1;
+ rt_uint32_t read_only : 1;
+ rt_uint32_t parallel_io : 1;
+ rt_uint32_t removable : 1;
#define RT_BLK_DISK_MAGIC 0xbdaabdaa
rt_uint32_t __magic;
@@ -62,9 +62,9 @@ struct rt_blk_disk
struct rt_blk_disk_ops
{
rt_ssize_t (*read)(struct rt_blk_disk *disk, rt_off_t sector, void *buffer,
- rt_size_t sector_count);
+ rt_size_t sector_count);
rt_ssize_t (*write)(struct rt_blk_disk *disk, rt_off_t sector, const void *buffer,
- rt_size_t sector_count);
+ rt_size_t sector_count);
rt_err_t (*getgeome)(struct rt_blk_disk *disk, struct rt_device_blk_geometry *geometry);
rt_err_t (*sync)(struct rt_blk_disk *disk);
rt_err_t (*erase)(struct rt_blk_disk *disk);
@@ -73,7 +73,18 @@ struct rt_blk_disk_ops
};
#ifndef __DFS_H__
+#ifdef RT_USING_DFS
#include <dfs_fs.h>
+#else
+/* Keep the legacy name available when the block layer is used without DFS. */
+struct dfs_partition
+{
+ rt_uint8_t type;
+ rt_off_t offset;
+ rt_size_t size;
+ rt_sem_t lock;
+};
+#endif /* RT_USING_DFS */
/**
* @brief Logical blk device, if you don't used DFS it will be defined by default.
@@ -132,4 +143,4 @@ rt_ssize_t rt_blk_disk_get_logical_block_size(struct rt_blk_disk *disk);
/*! @}*/
-#endif /* __BLK_H__ */ \ No newline at end of file
+#endif /* __BLK_H__ */
diff --git a/components/drivers/include/drivers/mmcsd_card.h b/components/drivers/include/drivers/mmcsd_card.h
index 6d86760a78..feab5a5724 100644
--- a/components/drivers/include/drivers/mmcsd_card.h
+++ b/components/drivers/include/drivers/mmcsd_card.h
@@ -19,128 +19,144 @@
extern "C" {
#endif
-#define SD_SCR_BUS_WIDTH_1 (1 << 0)
-#define SD_SCR_BUS_WIDTH_4 (1 << 2)
+#define SD_SCR_BUS_WIDTH_1 (1 << 0)
+#define SD_SCR_BUS_WIDTH_4 (1 << 2)
-struct rt_mmcsd_cid {
- rt_uint8_t mid; /* ManufacturerID */
- rt_uint8_t prv; /* Product Revision */
+struct rt_mmcsd_cid
+{
+ rt_uint8_t mid; /* ManufacturerID */
+ rt_uint8_t prv; /* Product Revision */
rt_uint16_t oid; /* OEM/Application ID */
rt_uint32_t psn; /* Product Serial Number */
- rt_uint8_t pnm[5]; /* Product Name */
- rt_uint8_t reserved1;/* reserved */
+ rt_uint8_t pnm[5]; /* Product Name */
+ rt_uint8_t reserved1;/* reserved */
rt_uint16_t mdt; /* Manufacturing Date */
- rt_uint8_t crc; /* CID CRC */
- rt_uint8_t reserved2;/* not used, always 1 */
+ rt_uint8_t crc; /* CID CRC */
+ rt_uint8_t reserved2;/* not used, always 1 */
};
-struct rt_mmcsd_csd {
- rt_uint8_t csd_structure; /* CSD register version */
- rt_uint8_t taac;
- rt_uint8_t nsac;
- rt_uint8_t tran_speed; /* max data transfer rate */
- rt_uint16_t card_cmd_class; /* card command classes */
- rt_uint8_t rd_blk_len; /* max read data block length */
- rt_uint8_t rd_blk_part;
- rt_uint8_t wr_blk_misalign;
- rt_uint8_t rd_blk_misalign;
- rt_uint8_t dsr_imp; /* DSR implemented */
- rt_uint8_t c_size_mult; /* CSD 1.0 , device size multiplier */
- rt_uint32_t c_size; /* device size */
- rt_uint8_t r2w_factor;
- rt_uint8_t wr_blk_len; /* max wtire data block length */
- rt_uint8_t wr_blk_partial;
- rt_uint8_t csd_crc;
-
+struct rt_mmcsd_csd
+{
+ rt_uint8_t csd_structure; /* CSD register version */
+ rt_uint8_t taac;
+ rt_uint8_t nsac;
+ rt_uint8_t tran_speed; /* max data transfer rate */
+ rt_uint16_t card_cmd_class; /* card command classes */
+ rt_uint8_t rd_blk_len; /* max read data block length */
+ rt_uint8_t rd_blk_part;
+ rt_uint8_t wr_blk_misalign;
+ rt_uint8_t rd_blk_misalign;
+ rt_uint8_t dsr_imp; /* DSR implemented */
+ rt_uint8_t c_size_mult; /* CSD 1.0 , device size multiplier */
+ rt_uint32_t c_size; /* device size */
+ rt_uint8_t r2w_factor;
+ rt_uint8_t wr_blk_len; /* max wtire data block length */
+ rt_uint8_t wr_blk_partial;
+ rt_uint8_t csd_crc;
};
-struct rt_sd_scr {
- rt_uint8_t sd_version;
- rt_uint8_t sd_bus_widths;
+struct rt_sd_scr
+{
+ rt_uint8_t sd_version;
+ rt_uint8_t sd_bus_widths;
};
-struct rt_sdio_cccr {
- rt_uint8_t sdio_version;
- rt_uint8_t sd_version;
- rt_uint8_t direct_cmd:1, /* Card Supports Direct Commands during data transfer
+struct rt_sdio_cccr
+{
+ rt_uint8_t sdio_version;
+ rt_uint8_t sd_version;
+ rt_uint8_t direct_cmd : 1, /* Card Supports Direct Commands during data transfer
only SD mode, not used for SPI mode */
- multi_block:1, /* Card Supports Multi-Block */
- read_wait:1, /* Card Supports Read Wait
+ multi_block : 1, /* Card Supports Multi-Block */
+ read_wait : 1, /* Card Supports Read Wait
only SD mode, not used for SPI mode */
- suspend_resume:1, /* Card supports Suspend/Resume
+ suspend_resume : 1, /* Card supports Suspend/Resume
only SD mode, not used for SPI mode */
- s4mi:1, /* generate interrupts during a 4-bit
+ s4mi : 1, /* generate interrupts during a 4-bit
multi-block data transfer */
- e4mi:1, /* Enable the multi-block IRQ during
+ e4mi : 1, /* Enable the multi-block IRQ during
4-bit transfer for the SDIO card */
- low_speed:1, /* Card is a Low-Speed card */
- low_speed_4:1; /* 4-bit support for Low-Speed cards */
+ low_speed : 1, /* Card is a Low-Speed card */
+ low_speed_4 : 1; /* 4-bit support for Low-Speed cards */
- rt_uint8_t bus_width:1, /* Support SDIO bus width, 1:4bit, 0:1bit */
- cd_disable:1, /* Connect[0]/Disconnect[1] the 10K-90K ohm pull-up
+ rt_uint8_t bus_width : 1, /* Support SDIO bus width, 1:4bit, 0:1bit */
+ cd_disable : 1, /* Connect[0]/Disconnect[1] the 10K-90K ohm pull-up
resistor on CD/DAT[3] (pin 1) of the card */
- power_ctrl:1, /* Support Master Power Control */
- high_speed:1; /* Support High-Speed */
-
-
+ power_ctrl : 1, /* Support Master Power Control */
+ high_speed : 1; /* Support High-Speed */
};
/*
* SD Status
*/
-union rt_sd_status {
+union rt_sd_status
+{
rt_uint32_t status_words[16];
- struct {
+ struct
+ {
rt_uint32_t reserved[12];
- rt_uint64_t : 8;
- rt_uint64_t uhs_au_size: 4;
- rt_uint64_t uhs_speed_grade: 4;
- rt_uint64_t erase_offset: 2;
- rt_uint64_t erase_timeout: 6;
- rt_uint64_t erase_size: 16;
- rt_uint64_t : 4;
- rt_uint64_t au_size: 4;
- rt_uint64_t performance_move: 8;
- rt_uint64_t speed_class: 8;
+ rt_uint64_t : 8;
+ rt_uint64_t uhs_au_size : 4;
+ rt_uint64_t uhs_speed_grade : 4;
+ rt_uint64_t erase_offset : 2;
+ rt_uint64_t erase_timeout : 6;
+ rt_uint64_t erase_size : 16;
+ rt_uint64_t : 4;
+ rt_uint64_t au_size : 4;
+ rt_uint64_t performance_move : 8;
+ rt_uint64_t speed_class : 8;
rt_uint32_t size_of_protected_area;
- rt_uint32_t sd_card_type: 16;
- rt_uint32_t : 6;
- rt_uint32_t : 7;
- rt_uint32_t secured_mode: 1;
- rt_uint32_t data_bus_width: 2;
+ rt_uint32_t sd_card_type : 16;
+ rt_uint32_t : 6;
+ rt_uint32_t : 7;
+ rt_uint32_t secured_mode : 1;
+ rt_uint32_t data_bus_width : 2;
+ /* Arm Compiler 5 does not support anonymous structs in strict C99 mode. */
+#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 6000000)
+ } fields;
+#else
};
+#endif
};
+#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 6000000)
+#define RT_SD_STATUS_FIELD(status, field) ((status).fields.field)
+#else
+#define RT_SD_STATUS_FIELD(status, field) ((status).field)
+#endif
+
/*
* SD Speed Class
*/
-#define SD_SPEED_CLASS_0 0
-#define SD_SPEED_CLASS_2 1
-#define SD_SPEED_CLASS_4 2
-#define SD_SPEED_CLASS_6 3
-#define SD_SPEED_CLASS_10 4
+#define SD_SPEED_CLASS_0 0
+#define SD_SPEED_CLASS_2 1
+#define SD_SPEED_CLASS_4 2
+#define SD_SPEED_CLASS_6 3
+#define SD_SPEED_CLASS_10 4
/*
* UHS Speed Grade
*/
-#define UHS_SPEED_GRADE_0 0
-#define UHS_SPEED_GRADE_1 1
-#define UHS_SPEED_GRADE_3 3
+#define UHS_SPEED_GRADE_0 0
+#define UHS_SPEED_GRADE_1 1
+#define UHS_SPEED_GRADE_3 3
-struct rt_sdio_cis {
- rt_uint16_t manufacturer;
- rt_uint16_t product;
- rt_uint16_t func0_blk_size;
- rt_uint32_t max_tran_speed;
+struct rt_sdio_cis
+{
+ rt_uint16_t manufacturer;
+ rt_uint16_t product;
+ rt_uint16_t func0_blk_size;
+ rt_uint32_t max_tran_speed;
};
/*
* SDIO function CIS tuple (unknown to the core)
*/
-struct rt_sdio_function_tuple {
+struct rt_sdio_function_tuple
+{
struct rt_sdio_function_tuple *next;
rt_uint8_t code;
rt_uint8_t size;
@@ -148,31 +164,32 @@ struct rt_sdio_function_tuple {
};
struct rt_sdio_function;
-typedef void (rt_sdio_irq_handler_t)(struct rt_sdio_function *);
+typedef void(rt_sdio_irq_handler_t)(struct rt_sdio_function *);
/*
* SDIO function devices
*/
-struct rt_sdio_function {
- struct rt_mmcsd_card *card; /* the card this device belongs to */
- rt_sdio_irq_handler_t *irq_handler; /* IRQ callback */
- rt_uint8_t num; /* function number */
+struct rt_sdio_function
+{
+ struct rt_mmcsd_card *card; /* the card this device belongs to */
+ rt_sdio_irq_handler_t *irq_handler; /* IRQ callback */
+ rt_uint8_t num; /* function number */
- rt_uint8_t func_code; /* Standard SDIO Function interface code */
- rt_uint16_t manufacturer; /* manufacturer id */
- rt_uint16_t product; /* product id */
+ rt_uint8_t func_code; /* Standard SDIO Function interface code */
+ rt_uint16_t manufacturer; /* manufacturer id */
+ rt_uint16_t product; /* product id */
- rt_uint32_t max_blk_size; /* maximum block size */
- rt_uint32_t cur_blk_size; /* current block size */
+ rt_uint32_t max_blk_size; /* maximum block size */
+ rt_uint32_t cur_blk_size; /* current block size */
- rt_uint32_t enable_timeout_val; /* max enable timeout in msec */
+ rt_uint32_t enable_timeout_val; /* max enable timeout in msec */
struct rt_sdio_function_tuple *tuples;
- void *priv;
+ void *priv;
};
-#define SDIO_MAX_FUNCTIONS 7
+#define SDIO_MAX_FUNCTIONS 7
struct rt_mmc_ext_csd
{
@@ -180,7 +197,8 @@ struct rt_mmc_ext_csd
rt_uint32_t enhanced_data_strobe;
};
-struct rt_mmcsd_card {
+struct rt_mmcsd_card
+{
struct rt_mmcsd_host *host;
rt_uint32_t rca; /* card addr */
rt_uint32_t resp_cid[4]; /* card CID register */
@@ -195,28 +213,28 @@ struct rt_mmcsd_card {
rt_uint32_t card_sec_cnt; /* card sector count*/
rt_uint32_t erase_size; /* erase size in sectors */
rt_uint16_t card_type;
-#define CARD_TYPE_MMC 0 /* MMC card */
-#define CARD_TYPE_SD 1 /* SD card */
-#define CARD_TYPE_SDIO 2 /* SDIO card */
-#define CARD_TYPE_SDIO_COMBO 3 /* SD combo (IO+mem) card */
+#define CARD_TYPE_MMC 0 /* MMC card */
+#define CARD_TYPE_SD 1 /* SD card */
+#define CARD_TYPE_SDIO 2 /* SDIO card */
+#define CARD_TYPE_SDIO_COMBO 3 /* SD combo (IO+mem) card */
rt_uint16_t flags;
-#define CARD_FLAG_HIGHSPEED (1 << 0) /* SDIO bus speed 50MHz */
-#define CARD_FLAG_SDHC (1 << 1) /* SDHC card */
-#define CARD_FLAG_SDXC (1 << 2) /* SDXC card */
-#define CARD_FLAG_HIGHSPEED_DDR (1 << 3) /* HIGH SPEED DDR */
-#define CARD_FLAG_HS200 (1 << 4) /* BUS SPEED 200MHz */
-#define CARD_FLAG_HS400 (1 << 5) /* BUS SPEED 400MHz */
-#define CARD_FLAG_SDR50 (1 << 6) /* BUS SPEED 100MHz */
-#define CARD_FLAG_SDR104 (1 << 7) /* BUS SPEED 200MHz */
-#define CARD_FLAG_DDR50 (1 << 8) /* DDR50, works on 1.8V only */
- struct rt_sd_scr scr;
+#define CARD_FLAG_HIGHSPEED (1 << 0) /* SDIO bus speed 50MHz */
+#define CARD_FLAG_SDHC (1 << 1) /* SDHC card */
+#define CARD_FLAG_SDXC (1 << 2) /* SDXC card */
+#define CARD_FLAG_HIGHSPEED_DDR (1 << 3) /* HIGH SPEED DDR */
+#define CARD_FLAG_HS200 (1 << 4) /* BUS SPEED 200MHz */
+#define CARD_FLAG_HS400 (1 << 5) /* BUS SPEED 400MHz */
+#define CARD_FLAG_SDR50 (1 << 6) /* BUS SPEED 100MHz */
+#define CARD_FLAG_SDR104 (1 << 7) /* BUS SPEED 200MHz */
+#define CARD_FLAG_DDR50 (1 << 8) /* DDR50, works on 1.8V only */
+ struct rt_sd_scr scr;
struct rt_mmcsd_csd csd;
- rt_uint32_t hs_max_data_rate; /* max data transfer rate in high speed mode */
+ rt_uint32_t hs_max_data_rate; /* max data transfer rate in high speed mode */
- rt_uint8_t sdio_function_num; /* total number of SDIO functions */
- struct rt_sdio_cccr cccr; /* common card info */
- struct rt_sdio_cis cis; /* common tuple info */
+ rt_uint8_t sdio_function_num; /* total number of SDIO functions */
+ struct rt_sdio_cccr cccr; /* common card info */
+ struct rt_sdio_cis cis; /* common tuple info */
struct rt_sdio_function *sdio_function[SDIO_MAX_FUNCTIONS + 1]; /* SDIO functions (devices) */
void *blk_dev;
diff --git a/components/drivers/include/drivers/mmcsd_cmd.h b/components/drivers/include/drivers/mmcsd_cmd.h
index 06212c5162..d8cd28db41 100644
--- a/components/drivers/include/drivers/mmcsd_cmd.h
+++ b/components/drivers/include/drivers/mmcsd_cmd.h
@@ -17,28 +17,28 @@ extern "C" {
#endif
/* class 1 */
-#define GO_IDLE_STATE 0 /* bc */
-#define SEND_OP_COND 1 /* bcr [31:0] OCR R3 */
-#define ALL_SEND_CID 2 /* bcr R2 */
-#define SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */
-#define SET_DSR 4 /* bc [31:16] RCA */
-#define SWITCH 6 /* ac [31:0] See below R1b */
-#define SELECT_CARD 7 /* ac [31:16] RCA R1 */
-#define SEND_EXT_CSD 8 /* adtc R1 */
-#define SEND_CSD 9 /* ac [31:16] RCA R2 */
-#define SEND_CID 10 /* ac [31:16] RCA R2 */
-#define VOLTAGE_SWITCH 11 /* ac [31:0] R1 */
-#define STOP_TRANSMISSION 12 /* ac R1b */
-#define SEND_STATUS 13 /* ac [31:16] RCA R1 */
-#define GO_INACTIVE_STATE 15 /* ac [31:16] RCA */
-#define SPI_READ_OCR 58 /* spi spi_R3 */
-#define SPI_CRC_ON_OFF 59 /* spi [0:0] flag spi_R1 */
+#define GO_IDLE_STATE 0 /* bc */
+#define SEND_OP_COND 1 /* bcr [31:0] OCR R3 */
+#define ALL_SEND_CID 2 /* bcr R2 */
+#define SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */
+#define SET_DSR 4 /* bc [31:16] RCA */
+#define MMC_SWITCH 6 /* ac [31:0] See below R1b */
+#define SELECT_CARD 7 /* ac [31:16] RCA R1 */
+#define SEND_EXT_CSD 8 /* adtc R1 */
+#define SEND_CSD 9 /* ac [31:16] RCA R2 */
+#define SEND_CID 10 /* ac [31:16] RCA R2 */
+#define VOLTAGE_SWITCH 11 /* ac [31:0] R1 */
+#define STOP_TRANSMISSION 12 /* ac R1b */
+#define SEND_STATUS 13 /* ac [31:16] RCA R1 */
+#define GO_INACTIVE_STATE 15 /* ac [31:16] RCA */
+#define SPI_READ_OCR 58 /* spi spi_R3 */
+#define SPI_CRC_ON_OFF 59 /* spi [0:0] flag spi_R1 */
/* class 2 */
-#define SET_BLOCKLEN 16 /* ac [31:0] block len R1 */
-#define READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */
-#define READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */
-#define SEND_TUNING_BLOCK 19 /* adtc R1 */
+#define SET_BLOCKLEN 16 /* ac [31:0] block len R1 */
+#define READ_SINGLE_BLOCK 17 /* adtc [31:0] data addr R1 */
+#define READ_MULTIPLE_BLOCK 18 /* adtc [31:0] data addr R1 */
+#define SEND_TUNING_BLOCK 19 /* adtc R1 */
#define SEND_TUNING_BLOCK_HS200 21 /* adtc R1*/
/* class 3 */
#define WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */
@@ -51,77 +51,77 @@ extern "C" {
#define PROGRAM_CSD 27 /* adtc R1 */
/* class 6 */
-#define SET_WRITE_PROT 28 /* ac [31:0] data addr R1b */
-#define CLR_WRITE_PROT 29 /* ac [31:0] data addr R1b */
-#define SEND_WRITE_PROT 30 /* adtc [31:0] wpdata addr R1 */
+#define SET_WRITE_PROT 28 /* ac [31:0] data addr R1b */
+#define CLR_WRITE_PROT 29 /* ac [31:0] data addr R1b */
+#define SEND_WRITE_PROT 30 /* adtc [31:0] wpdata addr R1 */
/* class 5 */
-#define ERASE_GROUP_START 35 /* ac [31:0] data addr R1 */
-#define ERASE_GROUP_END 36 /* ac [31:0] data addr R1 */
-#define ERASE 38 /* ac R1b */
+#define ERASE_GROUP_START 35 /* ac [31:0] data addr R1 */
+#define ERASE_GROUP_END 36 /* ac [31:0] data addr R1 */
+#define ERASE 38 /* ac R1b */
/* class 9 */
-#define FAST_IO 39 /* ac <Complex> R4 */
-#define GO_IRQ_STATE 40 /* bcr R5 */
+#define FAST_IO 39 /* ac <Complex> R4 */
+#define GO_IRQ_STATE 40 /* bcr R5 */
/* class 7 */
-#define LOCK_UNLOCK 42 /* adtc R1b */
+#define LOCK_UNLOCK 42 /* adtc R1b */
/* class 8 */
-#define APP_CMD 55 /* ac [31:16] RCA R1 */
-#define GEN_CMD 56 /* adtc [0] RD/WR R1 */
+#define APP_CMD 55 /* ac [31:16] RCA R1 */
+#define GEN_CMD 56 /* adtc [0] RD/WR R1 */
/* SD commands type argument response */
/* class 0 */
/* This is basically the same command as for MMC with some quirks. */
-#define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */
-#define SD_SEND_IF_COND 8 /* bcr [11:0] See below R7 */
+#define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */
+#define SD_SEND_IF_COND 8 /* bcr [11:0] See below R7 */
/* class 10 */
-#define SD_SWITCH 6 /* adtc [31:0] See below R1 */
+#define SD_SWITCH 6 /* adtc [31:0] See below R1 */
/* Application commands */
-#define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */
-#define SD_APP_SEND_NUM_WR_BLKS 22 /* adtc R1 */
-#define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */
-#define SD_APP_SEND_SCR 51 /* adtc R1 */
+#define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */
+#define SD_APP_SEND_NUM_WR_BLKS 22 /* adtc R1 */
+#define SD_APP_OP_COND 41 /* bcr [31:0] OCR R3 */
+#define SD_APP_SEND_SCR 51 /* adtc R1 */
-#define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */
-#define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */
-#define SCR_SPEC_VER_2 2 /* Implements system specification 2.00 */
+#define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */
+#define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */
+#define SCR_SPEC_VER_2 2 /* Implements system specification 2.00 */
/* SDIO commands type argument response */
-#define SD_IO_SEND_OP_COND 5 /* bcr [23:0] OCR R4 */
-#define SD_IO_RW_DIRECT 52 /* ac [31:0] See below R5 */
-#define SD_IO_RW_EXTENDED 53 /* adtc [31:0] See below R5 */
+#define SD_IO_SEND_OP_COND 5 /* bcr [23:0] OCR R4 */
+#define SD_IO_RW_DIRECT 52 /* ac [31:0] See below R5 */
+#define SD_IO_RW_EXTENDED 53 /* adtc [31:0] See below R5 */
/* CMD52 arguments */
-#define SDIO_ARG_CMD52_READ (0<<31)
-#define SDIO_ARG_CMD52_WRITE (1u<<31)
-#define SDIO_ARG_CMD52_FUNC_SHIFT 28
-#define SDIO_ARG_CMD52_FUNC_MASK 0x7
-#define SDIO_ARG_CMD52_RAW_FLAG (1u<<27)
-#define SDIO_ARG_CMD52_REG_SHIFT 9
-#define SDIO_ARG_CMD52_REG_MASK 0x1ffff
-#define SDIO_ARG_CMD52_DATA_SHIFT 0
-#define SDIO_ARG_CMD52_DATA_MASK 0xff
-#define SDIO_R5_DATA(resp) ((resp)[0] & 0xff)
+#define SDIO_ARG_CMD52_READ (0 << 31)
+#define SDIO_ARG_CMD52_WRITE (1u << 31)
+#define SDIO_ARG_CMD52_FUNC_SHIFT 28
+#define SDIO_ARG_CMD52_FUNC_MASK 0x7
+#define SDIO_ARG_CMD52_RAW_FLAG (1u << 27)
+#define SDIO_ARG_CMD52_REG_SHIFT 9
+#define SDIO_ARG_CMD52_REG_MASK 0x1ffff
+#define SDIO_ARG_CMD52_DATA_SHIFT 0
+#define SDIO_ARG_CMD52_DATA_MASK 0xff
+#define SDIO_R5_DATA(resp) ((resp)[0] & 0xff)
/* CMD53 arguments */
-#define SDIO_ARG_CMD53_READ (0<<31)
-#define SDIO_ARG_CMD53_WRITE (1u<<31)
-#define SDIO_ARG_CMD53_FUNC_SHIFT 28
-#define SDIO_ARG_CMD53_FUNC_MASK 0x7
-#define SDIO_ARG_CMD53_BLOCK_MODE (1u<<27)
-#define SDIO_ARG_CMD53_INCREMENT (1u<<26)
-#define SDIO_ARG_CMD53_REG_SHIFT 9
-#define SDIO_ARG_CMD53_REG_MASK 0x1ffff
-#define SDIO_ARG_CMD53_LENGTH_SHIFT 0
-#define SDIO_ARG_CMD53_LENGTH_MASK 0x1ff
-#define SDIO_ARG_CMD53_LENGTH_MAX 511
+#define SDIO_ARG_CMD53_READ (0 << 31)
+#define SDIO_ARG_CMD53_WRITE (1u << 31)
+#define SDIO_ARG_CMD53_FUNC_SHIFT 28
+#define SDIO_ARG_CMD53_FUNC_MASK 0x7
+#define SDIO_ARG_CMD53_BLOCK_MODE (1u << 27)
+#define SDIO_ARG_CMD53_INCREMENT (1u << 26)
+#define SDIO_ARG_CMD53_REG_SHIFT 9
+#define SDIO_ARG_CMD53_REG_MASK 0x1ffff
+#define SDIO_ARG_CMD53_LENGTH_SHIFT 0
+#define SDIO_ARG_CMD53_LENGTH_MASK 0x1ff
+#define SDIO_ARG_CMD53_LENGTH_MAX 511
#ifdef __cplusplus