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