Lines Matching +full:mmc +full:- +full:hs400 +full:- +full:enhanced +full:- +full:strobe

7  * SPDX-License-Identifier:	GPL-2.0+
18 /* SD/MMC version bits; 8 flags, 8 major, 8 minor, 8 change */
67 #define IS_SD(x) ((x)->version & SD_VERSION_SD)
68 #define IS_MMC(x) ((x)->version & MMC_VERSION_MMC)
142 #define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */
236 #define EXT_CSD_BUS_WIDTH_STROBE BIT(7) /* Enhanced strobe mode */
241 #define EXT_CSD_TIMING_HS400 3 /* HS400 */
263 #define EXT_CSD_ENH_USR (1 << 0) /* user data area is enhanced */
264 #define EXT_CSD_ENH_GP(x) (1 << ((x)+1)) /* GP part (x+1) is enhanced */
302 /* Maximum block size for MMC */
305 /* The number of MMC physical partitions. These consist of:
306 * boot partitions (2), general purpose partitions (4) in MMC v4.4.
346 struct mmc *do_returnmmc(void);
348 int read_counter(struct mmc *mmc, struct s_rpmb *requestpackets);
349 int program_key(struct mmc *mmc, struct s_rpmb *requestpackets);
351 (struct mmc *mmc, struct s_rpmb *requestpackets, uint16_t block_count);
352 int authenticated_write(struct mmc *mmc, struct s_rpmb *requestpackets);
357 * struct mmc_uclass_priv - Holds information about a device used by the uclass
360 struct mmc *mmc; member
368 * mmc_get_mmc_dev() - get the MMC struct pointer for a device
374 * @return associated mmc struct pointer if available, else NULL
376 struct mmc *mmc_get_mmc_dev(struct udevice *dev);
407 struct mmc;
412 * send_cmd() - Send a command to the MMC device
417 * @return 0 if OK, -ve on error
423 * send_cmd_prepare() - Send a command to the MMC device
428 * @return 0 if OK, -ve on error
435 * card_busy() - Query the card device status
443 * set_ios() - Set the I/O speed/width for an MMC device
446 * @return 0 if OK, -ve on error
451 * get_cd() - See whether a card is present
454 * @return 0 if not present, 1 if present, -ve on error
459 * get_wp() - See whether a card has write-protect enabled
462 * @return 0 if write-enabled, 1 if write-protected, -ve on error
467 * execute_tuning() - Find the optimal sampling point of a data
473 * @return 0 if write-enabled, 1 if write-protected, -ve on error
476 /* set_enhanced_strobe() - set HS400 enhanced strobe */
480 #define mmc_get_ops(dev) ((struct dm_mmc_ops *)(dev)->driver->ops)
489 bool mmc_card_busy(struct mmc *mmc);
490 bool mmc_can_card_busy(struct mmc *mmc);
491 int mmc_set_ios(struct mmc *mmc);
492 int mmc_getcd(struct mmc *mmc);
493 int mmc_getwp(struct mmc *mmc);
495 int mmc_set_enhanced_strobe(struct mmc *mmc);
498 bool (*card_busy)(struct mmc *mmc);
499 int (*send_cmd)(struct mmc *mmc,
501 int (*set_ios)(struct mmc *mmc);
502 int (*init)(struct mmc *mmc);
503 int (*getcd)(struct mmc *mmc);
504 int (*getwp)(struct mmc *mmc);
530 * With CONFIG_DM_MMC enabled, struct mmc can be accessed from the MMC device
533 * TODO struct mmc should be in mmc_private but it's hard to fix right now
535 struct mmc { struct
586 uint erase_grp_size; /* in 512-byte sectors */
587 uint hc_wp_grp_size; /* in 512-byte sectors */
589 uint init_retry; /* re-init mmc when error occur */ argument
606 struct udevice *dev; /* Device for this MMC controller */
613 uint enh_start; /* in 512-byte sectors */
614 uint enh_size; /* in 512-byte sectors, if 0 no enh area */
619 uint size; /* in 512-byte sectors */
620 unsigned enhanced : 1; member
632 static inline bool mmc_card_hs(struct mmc *mmc) in mmc_card_hs() argument
634 return (mmc->timing == MMC_TIMING_MMC_HS) || in mmc_card_hs()
635 (mmc->timing == MMC_TIMING_SD_HS); in mmc_card_hs()
638 static inline bool mmc_card_ddr(struct mmc *mmc) in mmc_card_ddr() argument
640 return (mmc->timing == MMC_TIMING_UHS_DDR50) || in mmc_card_ddr()
641 (mmc->timing == MMC_TIMING_MMC_DDR52) || in mmc_card_ddr()
642 (mmc->timing == MMC_TIMING_MMC_HS400) || in mmc_card_ddr()
643 (mmc->timing == MMC_TIMING_MMC_HS400ES); in mmc_card_ddr()
646 static inline bool mmc_card_hs200(struct mmc *mmc) in mmc_card_hs200() argument
648 return mmc->timing == MMC_TIMING_MMC_HS200; in mmc_card_hs200()
651 static inline bool mmc_card_ddr52(struct mmc *mmc) in mmc_card_ddr52() argument
653 return mmc->timing == MMC_TIMING_MMC_DDR52; in mmc_card_ddr52()
656 static inline bool mmc_card_hs400(struct mmc *mmc) in mmc_card_hs400() argument
658 return mmc->timing == MMC_TIMING_MMC_HS400; in mmc_card_hs400()
661 static inline bool mmc_card_hs400es(struct mmc *mmc) in mmc_card_hs400es() argument
663 return mmc->timing == MMC_TIMING_MMC_HS400ES; in mmc_card_hs400es()
666 int mmc_send_tuning(struct mmc *mmc, u32 opcode);
668 struct mmc *mmc_create(const struct mmc_config *cfg, void *priv);
671 * mmc_bind() - Set up a new MMC device ready for probing
676 * @dev: MMC device to set up
677 * @mmc: MMC struct
678 * @cfg: MMC configuration
679 * @return 0 if OK, -ve on error
681 int mmc_bind(struct udevice *dev, struct mmc *mmc,
683 void mmc_destroy(struct mmc *mmc);
686 * mmc_unbind() - Unbind a MMC device's child block device
688 * @dev: MMC device
689 * @return 0 if OK, -ve on error
693 int mmc_init(struct mmc *mmc);
694 int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size);
695 void mmc_set_clock(struct mmc *mmc, uint clock);
696 struct mmc *find_mmc_device(int dev_num);
701 * get_mmc_num() - get the total MMC device number
703 * @return 0 if there is no MMC device, else the number of devices
706 int mmc_switch_part(struct mmc *mmc, unsigned int part_num);
707 int mmc_hwpart_config(struct mmc *mmc, const struct mmc_hwpart_conf *conf,
711 int mmc_getcd(struct mmc *mmc);
712 int board_mmc_getcd(struct mmc *mmc);
713 int mmc_getwp(struct mmc *mmc);
714 int board_mmc_getwp(struct mmc *mmc);
717 int mmc_set_dsr(struct mmc *mmc, u16 val);
719 int mmc_boot_partition_size_change(struct mmc *mmc, unsigned long bootsize,
722 int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access);
724 int mmc_set_boot_bus_width(struct mmc *mmc, u8 width, u8 reset, u8 mode);
726 int mmc_set_rst_n_function(struct mmc *mmc, u8 enable);
728 int mmc_rpmb_set_key(struct mmc *mmc, void *key);
729 int mmc_rpmb_get_counter(struct mmc *mmc, unsigned long *counter);
730 int mmc_rpmb_read(struct mmc *mmc, void *addr, unsigned short blk,
732 int mmc_rpmb_write(struct mmc *mmc, void *addr, unsigned short blk,
735 int mmc_set_bkops_enable(struct mmc *mmc);
744 * @param mmc Pointer to a MMC device struct
747 int mmc_start_init(struct mmc *mmc);
750 * Set preinit flag of mmc device.
752 * This will cause the device to be pre-inited during mmc_initialize(),
754 * Some eMMC devices take 200-300ms to init, but unfortunately they
758 * @param mmc Pointer to a MMC device struct
761 void mmc_set_preinit(struct mmc *mmc, int preinit);
764 #define mmc_host_is_spi(mmc) ((mmc)->cfg->host_caps & MMC_MODE_SPI) argument
766 #define mmc_host_is_spi(mmc) 0 argument
768 struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode);
773 int mmc_get_env_addr(struct mmc *mmc, int copy, u32 *env_addr);
782 * mmc_get_blk_desc() - Get the block descriptor for an MMC device
784 * @mmc: MMC device
787 struct blk_desc *mmc_get_blk_desc(struct mmc *mmc);