2 * Copyright 2008,2010 Freescale Semiconductor, Inc
5 * Based (loosely) on the Linux code
7 * SPDX-License-Identifier: GPL-2.0+
10 #ifndef _MMC_PRIVATE_H_
11 #define _MMC_PRIVATE_H_
15 extern int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
16 struct mmc_data *data);
17 extern int mmc_send_status(struct mmc *mmc, int timeout);
18 extern int mmc_set_blocklen(struct mmc *mmc, int len);
19 #ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT
20 void mmc_adapter_card_type_ident(void);
23 #ifndef CONFIG_SPL_BUILD
25 unsigned long mmc_berase(struct blk_desc *block_dev, lbaint_t start,
29 ulong mmc_bwrite(struct udevice *dev, lbaint_t start, lbaint_t blkcnt,
32 ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt,
36 #else /* CONFIG_SPL_BUILD */
38 /* SPL will never write or erase, declare dummies to reduce code size. */
41 static inline unsigned long mmc_berase(struct udevice *dev,
42 lbaint_t start, lbaint_t blkcnt)
47 static inline ulong mmc_bwrite(struct udevice *dev, lbaint_t start,
48 lbaint_t blkcnt, const void *src)
53 static inline unsigned long mmc_berase(struct blk_desc *block_dev,
54 lbaint_t start, lbaint_t blkcnt)
59 static inline ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start,
60 lbaint_t blkcnt, const void *src)
66 #endif /* CONFIG_SPL_BUILD */
69 * mmc_get_next_devnum() - Get the next available MMC device number
71 * @return next available device number (0 = first), or -ve on error
73 int mmc_get_next_devnum(void);
76 * mmc_do_preinit() - Get an MMC device ready for use
78 void mmc_do_preinit(void);
81 * mmc_list_init() - Set up the list of MMC devices
83 void mmc_list_init(void);
86 * mmc_list_add() - Add a new MMC device to the list of devices
90 void mmc_list_add(struct mmc *mmc);
92 #endif /* _MMC_PRIVATE_H_ */