Lines Matching +full:1 +full:- +full:sd
2 * SD Memory Card emulation. Mostly correct for MMC too.
10 * 1. Redistributions of source code must retain the above copyright
33 #include "hw/qdev-core.h"
36 #define OUT_OF_RANGE (1 << 31)
37 #define ADDRESS_ERROR (1 << 30)
38 #define BLOCK_LEN_ERROR (1 << 29)
39 #define ERASE_SEQ_ERROR (1 << 28)
40 #define ERASE_PARAM (1 << 27)
41 #define WP_VIOLATION (1 << 26)
42 #define CARD_IS_LOCKED (1 << 25)
43 #define LOCK_UNLOCK_FAILED (1 << 24)
44 #define COM_CRC_ERROR (1 << 23)
45 #define ILLEGAL_COMMAND (1 << 22)
46 #define CARD_ECC_FAILED (1 << 21)
47 #define CC_ERROR (1 << 20)
48 #define SD_ERROR (1 << 19)
49 #define CID_CSD_OVERWRITE (1 << 16)
50 #define WP_ERASE_SKIP (1 << 15)
51 #define CARD_ECC_DISABLED (1 << 14)
52 #define ERASE_RESET (1 << 13)
54 #define READY_FOR_DATA (1 << 8)
55 #define APP_CMD (1 << 5)
56 #define AKE_SEQ_ERROR (1 << 3)
59 SD_PHY_SPECv1_10_VERS = 1,
73 UHS_I = 1,
85 #define TYPE_SD_CARD "sd-card"
88 #define TYPE_SD_CARD_SPI "sd-card-spi"
99 int (*do_command)(SDState *sd, SDRequest *req, uint8_t *response);
101 * Write a byte to a SD card.
102 * @sd: card
105 * Write a byte on the data lines of a SD card.
107 void (*write_byte)(SDState *sd, uint8_t value);
109 * Read a byte from a SD card.
110 * @sd: card
112 * Read a byte from the data lines of a SD card.
116 uint8_t (*read_byte)(SDState *sd);
117 bool (*receive_ready)(SDState *sd);
118 bool (*data_ready)(SDState *sd);
119 void (*set_voltage)(SDState *sd, uint16_t millivolts);
120 uint8_t (*get_dat_lines)(SDState *sd);
121 bool (*get_cmd_line)(SDState *sd);
122 void (*enable)(SDState *sd, bool enable);
123 bool (*get_inserted)(SDState *sd);
124 bool (*get_readonly)(SDState *sd);
125 void (*set_cid)(SDState *sd);
126 void (*set_csd)(SDState *sd, uint64_t size);
131 #define TYPE_SD_BUS "sd-bus"
144 /* These methods are called by the SD device to notify the controller
157 int sdbus_do_command(SDBus *sd, SDRequest *req, uint8_t *response);
159 * Write a byte to a SD bus.
160 * @sd: bus
163 * Write a byte on the data lines of a SD bus.
165 void sdbus_write_byte(SDBus *sd, uint8_t value);
167 * Read a byte from a SD bus.
168 * @sd: bus
170 * Read a byte from the data lines of a SD bus.
174 uint8_t sdbus_read_byte(SDBus *sd);
176 * Write data to a SD bus.
181 * Write multiple bytes of data on the data lines of a SD bus.
185 * Read data from a SD bus.
190 * Read multiple bytes of data on the data lines of a SD bus.
193 bool sdbus_receive_ready(SDBus *sd);
194 bool sdbus_data_ready(SDBus *sd);
195 bool sdbus_get_inserted(SDBus *sd);
196 bool sdbus_get_readonly(SDBus *sd);
198 * sdbus_reparent_card: Reparent an SD card from one controller to another
202 * Reparent an SD card, effectively unplugging it from one controller
204 * bcm2835 which have two SD controllers and connect a single SD card
209 /* Functions to be used by SD devices to report back to qdevified controllers */
210 void sdbus_set_inserted(SDBus *sd, bool inserted);
211 void sdbus_set_readonly(SDBus *sd, bool inserted);