.. | .. |
---|
161 | 161 | #define R1_STATE_PRG 7 |
---|
162 | 162 | #define R1_STATE_DIS 8 |
---|
163 | 163 | |
---|
| 164 | +static inline bool mmc_ready_for_data(u32 status) |
---|
| 165 | +{ |
---|
| 166 | + /* |
---|
| 167 | + * Some cards mishandle the status bits, so make sure to check both the |
---|
| 168 | + * busy indication and the card state. |
---|
| 169 | + */ |
---|
| 170 | + return status & R1_READY_FOR_DATA && |
---|
| 171 | + R1_CURRENT_STATE(status) == R1_STATE_TRAN; |
---|
| 172 | +} |
---|
| 173 | + |
---|
164 | 174 | /* |
---|
165 | 175 | * MMC/SD in SPI mode reports R1 status always, and R2 for SEND_STATUS |
---|
166 | 176 | * R1 is the low order byte; R2 is the next highest byte, when present. |
---|
.. | .. |
---|
315 | 325 | */ |
---|
316 | 326 | |
---|
317 | 327 | #define EXT_CSD_WR_REL_PARAM_EN (1<<2) |
---|
| 328 | +#define EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR (1<<4) |
---|
318 | 329 | |
---|
319 | 330 | #define EXT_CSD_BOOT_WP_B_PWR_WP_DIS (0x40) |
---|
320 | 331 | #define EXT_CSD_BOOT_WP_B_PERM_WP_DIS (0x10) |
---|
.. | .. |
---|
434 | 445 | #define MMC_SECURE_TRIM1_ARG 0x80000001 |
---|
435 | 446 | #define MMC_SECURE_TRIM2_ARG 0x80008000 |
---|
436 | 447 | #define MMC_SECURE_ARGS 0x80000000 |
---|
437 | | -#define MMC_TRIM_ARGS 0x00008001 |
---|
| 448 | +#define MMC_TRIM_OR_DISCARD_ARGS 0x00008003 |
---|
438 | 449 | |
---|
439 | 450 | #define mmc_driver_type_mask(n) (1 << (n)) |
---|
440 | 451 | |
---|
| 452 | +struct mmc_card; |
---|
| 453 | + |
---|
| 454 | +extern int mmc_select_bus_width(struct mmc_card *card); |
---|
| 455 | +extern int mmc_select_hs(struct mmc_card *card); |
---|
| 456 | +extern int mmc_select_hs_ddr(struct mmc_card *card); |
---|
| 457 | +extern int mmc_select_hs400(struct mmc_card *card); |
---|
| 458 | +extern int mmc_hs200_tuning(struct mmc_card *card); |
---|
| 459 | +extern int mmc_select_timing(struct mmc_card *card); |
---|
| 460 | + |
---|
441 | 461 | #endif /* LINUX_MMC_MMC_H */ |
---|