1
2
3
4
5
6
7
8
9
10#ifndef _MMC_PRIVATE_H_
11#define _MMC_PRIVATE_H_
12
13#include <mmc.h>
14
15extern int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
16 struct mmc_data *data);
17extern int mmc_send_status(struct mmc *mmc, int timeout);
18extern int mmc_set_blocklen(struct mmc *mmc, int len);
19#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT
20void mmc_adapter_card_type_ident(void);
21#endif
22
23#ifdef CONFIG_BLK
24ulong mmc_bread(struct udevice *dev, lbaint_t start, lbaint_t blkcnt,
25 void *dst);
26#else
27ulong mmc_bread(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt,
28 void *dst);
29#endif
30
31#if !(defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SAVEENV))
32
33#ifdef CONFIG_BLK
34ulong mmc_bwrite(struct udevice *dev, lbaint_t start, lbaint_t blkcnt,
35 const void *src);
36ulong mmc_berase(struct udevice *dev, lbaint_t start, lbaint_t blkcnt);
37#else
38ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt,
39 const void *src);
40ulong mmc_berase(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt);
41#endif
42
43#else
44
45
46
47#ifdef CONFIG_BLK
48static inline unsigned long mmc_berase(struct udevice *dev,
49 lbaint_t start, lbaint_t blkcnt)
50{
51 return 0;
52}
53
54static inline ulong mmc_bwrite(struct udevice *dev, lbaint_t start,
55 lbaint_t blkcnt, const void *src)
56{
57 return 0;
58}
59#else
60static inline unsigned long mmc_berase(struct blk_desc *block_dev,
61 lbaint_t start, lbaint_t blkcnt)
62{
63 return 0;
64}
65
66static inline ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start,
67 lbaint_t blkcnt, const void *src)
68{
69 return 0;
70}
71#endif
72
73#endif
74
75#ifdef CONFIG_MMC_TRACE
76void mmmc_trace_before_send(struct mmc *mmc, struct mmc_cmd *cmd);
77void mmmc_trace_after_send(struct mmc *mmc, struct mmc_cmd *cmd, int ret);
78void mmc_trace_state(struct mmc *mmc, struct mmc_cmd *cmd);
79#else
80static inline void mmmc_trace_before_send(struct mmc *mmc, struct mmc_cmd *cmd)
81{
82}
83
84static inline void mmmc_trace_after_send(struct mmc *mmc, struct mmc_cmd *cmd,
85 int ret)
86{
87}
88
89static inline void mmc_trace_state(struct mmc *mmc, struct mmc_cmd *cmd)
90{
91}
92#endif
93
94
95
96
97
98
99int mmc_get_next_devnum(void);
100
101
102
103
104void mmc_do_preinit(void);
105
106
107
108
109void mmc_list_init(void);
110
111
112
113
114
115
116void mmc_list_add(struct mmc *mmc);
117
118
119
120
121
122
123
124
125int mmc_switch_part(struct mmc *mmc, unsigned int part_num);
126
127
128
129
130
131
132
133
134
135
136int mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value);
137
138#endif
139