hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/include/linux/mmc/mmc.h
....@@ -161,6 +161,16 @@
161161 #define R1_STATE_PRG 7
162162 #define R1_STATE_DIS 8
163163
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
+
164174 /*
165175 * MMC/SD in SPI mode reports R1 status always, and R2 for SEND_STATUS
166176 * R1 is the low order byte; R2 is the next highest byte, when present.
....@@ -315,6 +325,7 @@
315325 */
316326
317327 #define EXT_CSD_WR_REL_PARAM_EN (1<<2)
328
+#define EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR (1<<4)
318329
319330 #define EXT_CSD_BOOT_WP_B_PWR_WP_DIS (0x40)
320331 #define EXT_CSD_BOOT_WP_B_PERM_WP_DIS (0x10)
....@@ -434,8 +445,17 @@
434445 #define MMC_SECURE_TRIM1_ARG 0x80000001
435446 #define MMC_SECURE_TRIM2_ARG 0x80008000
436447 #define MMC_SECURE_ARGS 0x80000000
437
-#define MMC_TRIM_ARGS 0x00008001
448
+#define MMC_TRIM_OR_DISCARD_ARGS 0x00008003
438449
439450 #define mmc_driver_type_mask(n) (1 << (n))
440451
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
+
441461 #endif /* LINUX_MMC_MMC_H */