Paul Burton | da61fa5 | 2013-09-09 15:30:26 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2008,2010 Freescale Semiconductor, Inc |
| 3 | * Andy Fleming |
| 4 | * |
| 5 | * Based (loosely) on the Linux code |
| 6 | * |
| 7 | * SPDX-License-Identifier: GPL-2.0+ |
| 8 | */ |
| 9 | |
| 10 | #ifndef _MMC_PRIVATE_H_ |
| 11 | #define _MMC_PRIVATE_H_ |
| 12 | |
| 13 | #include <mmc.h> |
| 14 | |
| 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); |
Yangbo Lu | 5a8dbdc | 2015-04-22 13:57:00 +0800 | [diff] [blame] | 19 | #ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT |
| 20 | void mmc_adapter_card_type_ident(void); |
| 21 | #endif |
Paul Burton | da61fa5 | 2013-09-09 15:30:26 +0100 | [diff] [blame] | 22 | |
| 23 | #ifndef CONFIG_SPL_BUILD |
| 24 | |
Simon Glass | 4101f68 | 2016-02-29 15:25:34 -0700 | [diff] [blame] | 25 | unsigned long mmc_berase(struct blk_desc *block_dev, lbaint_t start, |
Stephen Warren | 7c4213f | 2015-12-07 11:38:48 -0700 | [diff] [blame] | 26 | lbaint_t blkcnt); |
Paul Burton | da61fa5 | 2013-09-09 15:30:26 +0100 | [diff] [blame] | 27 | |
Simon Glass | 4101f68 | 2016-02-29 15:25:34 -0700 | [diff] [blame] | 28 | unsigned long mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, |
Stephen Warren | 7c4213f | 2015-12-07 11:38:48 -0700 | [diff] [blame] | 29 | lbaint_t blkcnt, const void *src); |
Paul Burton | da61fa5 | 2013-09-09 15:30:26 +0100 | [diff] [blame] | 30 | |
| 31 | #else /* CONFIG_SPL_BUILD */ |
| 32 | |
| 33 | /* SPL will never write or erase, declare dummies to reduce code size. */ |
| 34 | |
Simon Glass | 4101f68 | 2016-02-29 15:25:34 -0700 | [diff] [blame] | 35 | static inline unsigned long mmc_berase(struct blk_desc *block_dev, |
Stephen Warren | 7c4213f | 2015-12-07 11:38:48 -0700 | [diff] [blame] | 36 | lbaint_t start, lbaint_t blkcnt) |
Paul Burton | da61fa5 | 2013-09-09 15:30:26 +0100 | [diff] [blame] | 37 | { |
| 38 | return 0; |
| 39 | } |
| 40 | |
Simon Glass | 4101f68 | 2016-02-29 15:25:34 -0700 | [diff] [blame] | 41 | static inline ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, |
Stephen Warren | 7c4213f | 2015-12-07 11:38:48 -0700 | [diff] [blame] | 42 | lbaint_t blkcnt, const void *src) |
Paul Burton | da61fa5 | 2013-09-09 15:30:26 +0100 | [diff] [blame] | 43 | { |
| 44 | return 0; |
| 45 | } |
| 46 | |
| 47 | #endif /* CONFIG_SPL_BUILD */ |
| 48 | |
| 49 | #endif /* _MMC_PRIVATE_H_ */ |