Home
last modified time | relevance | path

Searched refs:mmc (Results 1 – 25 of 505) sorted by relevance

12345678910>>...21

/external/u-boot/drivers/mmc/
Dmmc.c24 static int mmc_set_signal_voltage(struct mmc *mmc, uint signal_voltage);
25 static int mmc_power_cycle(struct mmc *mmc);
27 static int mmc_select_mode_and_width(struct mmc *mmc, uint card_caps);
33 static int mmc_wait_dat0(struct mmc *mmc, int state, int timeout) in mmc_wait_dat0() argument
39 __weak int board_mmc_getwp(struct mmc *mmc) in board_mmc_getwp() argument
44 int mmc_getwp(struct mmc *mmc) in mmc_getwp() argument
48 wp = board_mmc_getwp(mmc); in mmc_getwp()
51 if (mmc->cfg->ops->getwp) in mmc_getwp()
52 wp = mmc->cfg->ops->getwp(mmc); in mmc_getwp()
60 __weak int board_mmc_getcd(struct mmc *mmc) in board_mmc_getcd() argument
[all …]
Dmmc_legacy.c16 static struct mmc mmc_static;
17 struct mmc *find_mmc_device(int dev_num) in find_mmc_device()
24 struct mmc *m = &mmc_static; in mmc_do_preinit()
32 struct blk_desc *mmc_get_blk_desc(struct mmc *mmc) in mmc_get_blk_desc() argument
34 return &mmc->block_dev; in mmc_get_blk_desc()
37 struct mmc *find_mmc_device(int dev_num) in find_mmc_device()
39 struct mmc *m; in find_mmc_device()
43 m = list_entry(entry, struct mmc, link); in find_mmc_device()
61 struct blk_desc *mmc_get_blk_desc(struct mmc *mmc) in mmc_get_blk_desc() argument
63 return &mmc->block_dev; in mmc_get_blk_desc()
[all …]
Dmeson_gx_mmc.c15 static inline void *get_regbase(const struct mmc *mmc) in get_regbase() argument
17 struct meson_mmc_platdata *pdata = mmc->priv; in get_regbase()
22 static inline uint32_t meson_read(struct mmc *mmc, int offset) in meson_read() argument
24 return readl(get_regbase(mmc) + offset); in meson_read()
27 static inline void meson_write(struct mmc *mmc, uint32_t val, int offset) in meson_write() argument
29 writel(val, get_regbase(mmc) + offset); in meson_write()
32 static void meson_mmc_config_clock(struct mmc *mmc) in meson_mmc_config_clock() argument
37 if (!mmc->clock) in meson_mmc_config_clock()
41 if (mmc->clock > 16000000) { in meson_mmc_config_clock()
48 clk_div = DIV_ROUND_UP(clk, mmc->clock); in meson_mmc_config_clock()
[all …]
Dmmc_write.c17 static ulong mmc_erase_t(struct mmc *mmc, ulong start, lbaint_t blkcnt) in mmc_erase_t() argument
23 if (mmc->high_capacity) { in mmc_erase_t()
26 end = (start + blkcnt - 1) * mmc->write_bl_len; in mmc_erase_t()
27 start *= mmc->write_bl_len; in mmc_erase_t()
30 if (IS_SD(mmc)) { in mmc_erase_t()
42 err = mmc_send_cmd(mmc, &cmd, NULL); in mmc_erase_t()
49 err = mmc_send_cmd(mmc, &cmd, NULL); in mmc_erase_t()
57 err = mmc_send_cmd(mmc, &cmd, NULL); in mmc_erase_t()
80 struct mmc *mmc = find_mmc_device(dev_num); in mmc_berase() local
84 if (!mmc) in mmc_berase()
[all …]
Dmmc-uclass.c17 struct mmc *mmc = mmc_get_mmc_dev(dev); in dm_mmc_send_cmd() local
21 mmmc_trace_before_send(mmc, cmd); in dm_mmc_send_cmd()
26 mmmc_trace_after_send(mmc, cmd, ret); in dm_mmc_send_cmd()
31 int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) in mmc_send_cmd() argument
33 return dm_mmc_send_cmd(mmc->dev, cmd, data); in mmc_send_cmd()
45 int mmc_set_ios(struct mmc *mmc) in mmc_set_ios() argument
47 return dm_mmc_set_ios(mmc->dev); in mmc_set_ios()
58 void mmc_send_init_stream(struct mmc *mmc) in mmc_send_init_stream() argument
60 dm_mmc_send_init_stream(mmc->dev); in mmc_send_init_stream()
73 int mmc_wait_dat0(struct mmc *mmc, int state, int timeout) in mmc_wait_dat0() argument
[all …]
Dpxa_mmc_gen.c50 static int pxa_mmc_wait(struct mmc *mmc, uint32_t mask) in pxa_mmc_wait() argument
52 struct pxa_mmc_priv *priv = mmc->priv; in pxa_mmc_wait()
69 static int pxa_mmc_stop_clock(struct mmc *mmc) in pxa_mmc_stop_clock() argument
71 struct pxa_mmc_priv *priv = mmc->priv; in pxa_mmc_stop_clock()
97 static int pxa_mmc_start_cmd(struct mmc *mmc, struct mmc_cmd *cmd, in pxa_mmc_start_cmd() argument
100 struct pxa_mmc_priv *priv = mmc->priv; in pxa_mmc_start_cmd()
133 ret = pxa_mmc_wait(mmc, MMC_STAT_CLK_EN); in pxa_mmc_start_cmd()
141 static int pxa_mmc_cmd_done(struct mmc *mmc, struct mmc_cmd *cmd) in pxa_mmc_cmd_done() argument
143 struct pxa_mmc_priv *priv = mmc->priv; in pxa_mmc_cmd_done()
183 static int pxa_mmc_do_read_xfer(struct mmc *mmc, struct mmc_data *data) in pxa_mmc_do_read_xfer() argument
[all …]
Dmmc_private.h14 extern int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
16 extern int mmc_send_status(struct mmc *mmc, int timeout);
17 extern int mmc_set_blocklen(struct mmc *mmc, int len);
75 void mmmc_trace_before_send(struct mmc *mmc, struct mmc_cmd *cmd);
76 void mmmc_trace_after_send(struct mmc *mmc, struct mmc_cmd *cmd, int ret);
77 void mmc_trace_state(struct mmc *mmc, struct mmc_cmd *cmd);
79 static inline void mmmc_trace_before_send(struct mmc *mmc, struct mmc_cmd *cmd) in mmmc_trace_before_send() argument
83 static inline void mmmc_trace_after_send(struct mmc *mmc, struct mmc_cmd *cmd, in mmmc_trace_after_send() argument
88 static inline void mmc_trace_state(struct mmc *mmc, struct mmc_cmd *cmd) in mmc_trace_state() argument
115 void mmc_list_add(struct mmc *mmc);
[all …]
Domap_hsmmc.c163 static inline struct omap_hsmmc_data *omap_hsmmc_get_data(struct mmc *mmc) in omap_hsmmc_get_data() argument
166 return dev_get_priv(mmc->dev); in omap_hsmmc_get_data()
168 return (struct omap_hsmmc_data *)mmc->priv; in omap_hsmmc_get_data()
171 static inline struct mmc_config *omap_hsmmc_get_cfg(struct mmc *mmc) in omap_hsmmc_get_cfg() argument
174 struct omap_hsmmc_plat *plat = dev_get_platdata(mmc->dev); in omap_hsmmc_get_cfg()
177 return &((struct omap_hsmmc_data *)mmc->priv)->cfg; in omap_hsmmc_get_cfg()
202 static unsigned char mmc_board_init(struct mmc *mmc) in mmc_board_init() argument
205 struct mmc_config *cfg = omap_hsmmc_get_cfg(mmc); in mmc_board_init()
262 if (mmc_get_blk_desc(mmc)->devnum == 0) in mmc_board_init()
299 static void omap_hsmmc_io_recalibrate(struct mmc *mmc) in omap_hsmmc_io_recalibrate() argument
[all …]
Dfsl_esdhc_spl.c26 struct mmc *mmc = find_mmc_device(0); in mmc_spl_load_image() local
27 if (!mmc) { in mmc_spl_load_image()
32 if (mmc_init(mmc)) { in mmc_spl_load_image()
37 blk_start = ALIGN(offs, mmc->read_bl_len) / mmc->read_bl_len; in mmc_spl_load_image()
38 blk_cnt = ALIGN(size, mmc->read_bl_len) / mmc->read_bl_len; in mmc_spl_load_image()
40 err = mmc->block_dev.block_read(&mmc->block_dev, blk_start, blk_cnt, in mmc_spl_load_image()
65 struct mmc *mmc; in mmc_boot() local
67 mmc = find_mmc_device(0); in mmc_boot()
68 if (!mmc) { in mmc_boot()
77 blklen = mmc->read_bl_len; in mmc_boot()
[all …]
Drpmb.c76 static int mmc_set_blockcount(struct mmc *mmc, unsigned int blockcount, in mmc_set_blockcount() argument
87 return mmc_send_cmd(mmc, &cmd, NULL); in mmc_set_blockcount()
89 static int mmc_rpmb_request(struct mmc *mmc, const struct s_rpmb *s, in mmc_rpmb_request() argument
96 ret = mmc_set_blockcount(mmc, count, is_rel_write); in mmc_rpmb_request()
113 ret = mmc_send_cmd(mmc, &cmd, &data); in mmc_rpmb_request()
122 static int mmc_rpmb_response(struct mmc *mmc, struct s_rpmb *s, in mmc_rpmb_response() argument
129 ret = mmc_set_blockcount(mmc, 1, false); in mmc_rpmb_response()
145 ret = mmc_send_cmd(mmc, &cmd, &data); in mmc_rpmb_response()
170 static int mmc_rpmb_status(struct mmc *mmc, unsigned short expected) in mmc_rpmb_status() argument
176 if (mmc_rpmb_request(mmc, rpmb_frame, 1, false)) in mmc_rpmb_status()
[all …]
Dmmc_spi.c53 static uint mmc_spi_sendcmd(struct mmc *mmc, ushort cmdidx, u32 cmdarg) in mmc_spi_sendcmd() argument
55 struct spi_slave *spi = mmc->priv; in mmc_spi_sendcmd()
76 static uint mmc_spi_readdata(struct mmc *mmc, void *xbuf, in mmc_spi_readdata() argument
79 struct spi_slave *spi = mmc->priv; in mmc_spi_readdata()
96 debug("%s: CRC error\n", mmc->cfg->name); in mmc_spi_readdata()
111 static uint mmc_spi_writedata(struct mmc *mmc, const void *xbuf, in mmc_spi_writedata() argument
114 struct spi_slave *spi = mmc->priv; in mmc_spi_writedata()
173 static int mmc_spi_request(struct mmc *mmc, struct mmc_cmd *cmd, in mmc_spi_request() argument
176 struct spi_slave *spi = mmc->priv; in mmc_spi_request()
184 r1 = mmc_spi_sendcmd(mmc, cmd->cmdidx, cmd->cmdarg); in mmc_spi_request()
[all …]
Dzynq_sdhci.c22 struct mmc mmc; member
76 dev_err(mmc_dev(host->mmc), in arasan_zynqmp_dll_reset()
88 static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) in arasan_sdhci_execute_tuning() argument
94 struct arasan_sdhci_priv *priv = dev_get_priv(mmc->dev); in arasan_sdhci_execute_tuning()
127 mmc->bus_width == 8) in arasan_sdhci_execute_tuning()
136 mmc_send_cmd(mmc, &cmd, NULL); in arasan_sdhci_execute_tuning()
168 struct arasan_sdhci_priv *priv = dev_get_priv(host->mmc->dev); in arasan_sdhci_set_tapdelay()
169 struct mmc *mmc = (struct mmc *)host->mmc; in arasan_sdhci_set_tapdelay() local
172 uhsmode = mode2timing[mmc->selected_mode]; in arasan_sdhci_set_tapdelay()
181 struct mmc *mmc = (struct mmc *)host->mmc; in arasan_sdhci_set_control_reg() local
[all …]
Dfsl_esdhc.c91 struct mmc mmc; member
128 struct mmc *mmc; member
254 static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, in esdhc_setup_data() argument
340 timeout = fls(mmc->clock/2); in esdhc_setup_data()
389 static int esdhc_send_cmd_common(struct fsl_esdhc_priv *priv, struct mmc *mmc, in esdhc_send_cmd_common() argument
424 err = esdhc_setup_data(priv, mmc, data); in esdhc_send_cmd_common()
443 | (mmc->ddr_mode ? XFERTYP_DDREN : 0)); in esdhc_send_cmd_common()
572 static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock) in set_sysctl() argument
586 int ddr_pre_div = mmc->ddr_mode ? 2 : 1; in set_sysctl()
590 if (clock < mmc->cfg->f_min) in set_sysctl()
[all …]
Dmmc_boot.c23 int mmc_boot_partition_size_change(struct mmc *mmc, unsigned long bootsize, in mmc_boot_partition_size_change() argument
34 err = mmc_send_cmd(mmc, &cmd, NULL); in mmc_boot_partition_size_change()
45 err = mmc_send_cmd(mmc, &cmd, NULL); in mmc_boot_partition_size_change()
58 err = mmc_send_cmd(mmc, &cmd, NULL); in mmc_boot_partition_size_change()
70 err = mmc_send_cmd(mmc, &cmd, NULL); in mmc_boot_partition_size_change()
85 int mmc_set_boot_bus_width(struct mmc *mmc, u8 width, u8 reset, u8 mode) in mmc_set_boot_bus_width() argument
87 return mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_BUS_WIDTH, in mmc_set_boot_bus_width()
100 int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access) in mmc_set_part_conf() argument
109 ret = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF, in mmc_set_part_conf()
112 mmc->part_config = part_conf; in mmc_set_part_conf()
[all …]
Dftsdc010_mci.c52 struct mmc mmc; member
63 static inline int ftsdc010_send_cmd(struct mmc *mmc, struct mmc_cmd *mmc_cmd) in ftsdc010_send_cmd() argument
65 struct ftsdc010_chip *chip = mmc->priv; in ftsdc010_send_cmd()
133 static void ftsdc010_clkset(struct mmc *mmc, uint32_t rate) in ftsdc010_clkset() argument
135 struct ftsdc010_chip *chip = mmc->priv; in ftsdc010_clkset()
147 if (IS_SD(mmc)) { in ftsdc010_clkset()
183 struct mmc *mmc = mmc_get_mmc_dev(dev); in ftsdc010_request() local
186 struct ftsdc010_chip *chip = mmc->priv; in ftsdc010_request()
223 ret = ftsdc010_send_cmd(mmc, cmd); in ftsdc010_request()
286 struct mmc *mmc = mmc_get_mmc_dev(dev); in ftsdc010_set_ios() local
[all …]
Dsunxi_mmc.c24 struct mmc mmc; member
208 static int mmc_config_clock(struct sunxi_mmc_priv *priv, struct mmc *mmc) in mmc_config_clock() argument
219 if (mmc_set_mod_clk(priv, mmc->clock)) in mmc_config_clock()
236 struct mmc *mmc) in sunxi_mmc_set_ios_common() argument
239 mmc->bus_width, mmc->clock); in sunxi_mmc_set_ios_common()
242 if (mmc->clock && mmc_config_clock(priv, mmc) != 0) { in sunxi_mmc_set_ios_common()
248 if (mmc->bus_width == 8) in sunxi_mmc_set_ios_common()
250 else if (mmc->bus_width == 4) in sunxi_mmc_set_ios_common()
259 static int sunxi_mmc_core_init(struct mmc *mmc) in sunxi_mmc_core_init() argument
261 struct sunxi_mmc_priv *priv = mmc->priv; in sunxi_mmc_core_init()
[all …]
Dmxsmmc.c135 mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) in mxsmmc_send_cmd() argument
137 struct mxsmmc_priv *priv = mmc->priv; in mxsmmc_send_cmd()
144 debug("MMC%d: CMD%d\n", mmc->block_dev.devnum, cmd->cmdidx); in mxsmmc_send_cmd()
159 printf("MMC%d: Bus busy timeout!\n", mmc->block_dev.devnum); in mxsmmc_send_cmd()
165 printf("MMC%d: No card detected!\n", mmc->block_dev.devnum); in mxsmmc_send_cmd()
202 priv->mmc_is_wp(mmc->block_dev.devnum)) { in mxsmmc_send_cmd()
204 mmc->block_dev.devnum); in mxsmmc_send_cmd()
245 mmc->block_dev.devnum, cmd->cmdidx); in mxsmmc_send_cmd()
252 mmc->block_dev.devnum, cmd->cmdidx, reg); in mxsmmc_send_cmd()
259 mmc->block_dev.devnum, cmd->cmdidx, reg); in mxsmmc_send_cmd()
[all …]
Darm_pl180_mmci.c32 struct mmc mmc; member
36 static int wait_for_command_end(struct mmc *dev, struct mmc_cmd *cmd) in wait_for_command_end()
76 static int do_command(struct mmc *dev, struct mmc_cmd *cmd) in do_command()
108 static int read_bytes(struct mmc *dev, u32 *dest, u32 blkcount, u32 blksize) in read_bytes()
163 static int write_bytes(struct mmc *dev, u32 *src, u32 blkcount, u32 blksize) in write_bytes()
222 static int do_data_transfer(struct mmc *dev, in do_data_transfer()
268 static int host_request(struct mmc *dev, in host_request()
282 static int host_set_ios(struct mmc *dev) in host_set_ios()
346 static int mmc_host_reset(struct mmc *dev) in mmc_host_reset()
367 int arm_pl180_mmci_init(struct pl180_mmc_host *host, struct mmc **mmc) in arm_pl180_mmci_init() argument
[all …]
Dgen_atmel_mci.c38 struct mmc mmc; member
94 struct mmc *mmc = &plat->mmc; local
98 static void mci_set_mode(struct mmc *mmc, u32 hz, u32 blklen)
100 struct atmel_mci_priv *priv = mmc->priv;
156 if (mmc->card_caps & mmc->cfg->host_caps & MMC_MODE_HS)
248 mci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
250 struct atmel_mci_priv *priv = mmc->priv;
375 struct mmc *mmc = mmc_get_mmc_dev(dev); local
379 static int mci_set_ios(struct mmc *mmc)
381 struct atmel_mci_priv *priv = mmc->priv;
[all …]
Dsdhci-cadence.c63 struct mmc mmc; member
134 struct mmc *mmc = host->mmc; in sdhci_cdns_set_control_reg() local
135 struct sdhci_cdns_plat *plat = dev_get_platdata(mmc->dev); in sdhci_cdns_set_control_reg()
136 unsigned int clock = mmc->clock; in sdhci_cdns_set_control_reg()
147 if (mmc->ddr_mode) in sdhci_cdns_set_control_reg()
152 if (mmc->ddr_mode) in sdhci_cdns_set_control_reg()
191 struct mmc *mmc = &plat->mmc; in sdhci_cdns_execute_tuning() local
202 if (!IS_MMC(mmc)) in sdhci_cdns_execute_tuning()
210 mmc_send_tuning(mmc, opcode, NULL)) { /* bad */ in sdhci_cdns_execute_tuning()
235 return sdhci_bind(dev, &plat->mmc, &plat->cfg); in sdhci_cdns_bind()
[all …]
/external/u-boot/cmd/
Dmmc.c16 static void print_mmcinfo(struct mmc *mmc) in print_mmcinfo() argument
20 printf("Device: %s\n", mmc->cfg->name); in print_mmcinfo()
21 printf("Manufacturer ID: %x\n", mmc->cid[0] >> 24); in print_mmcinfo()
22 printf("OEM: %x\n", (mmc->cid[0] >> 8) & 0xffff); in print_mmcinfo()
23 printf("Name: %c%c%c%c%c \n", mmc->cid[0] & 0xff, in print_mmcinfo()
24 (mmc->cid[1] >> 24), (mmc->cid[1] >> 16) & 0xff, in print_mmcinfo()
25 (mmc->cid[1] >> 8) & 0xff, mmc->cid[1] & 0xff); in print_mmcinfo()
27 printf("Bus Speed: %d\n", mmc->clock); in print_mmcinfo()
29 printf("Mode : %s\n", mmc_mode_name(mmc->selected_mode)); in print_mmcinfo()
30 mmc_dump_capabilities("card capabilities", mmc->card_caps); in print_mmcinfo()
[all …]
/external/u-boot/include/
Dmmc.h345 struct mmc *mmc; member
357 struct mmc *mmc_get_mmc_dev(struct udevice *dev);
388 struct mmc;
472 int mmc_set_ios(struct mmc *mmc);
473 void mmc_send_init_stream(struct mmc *mmc);
474 int mmc_getcd(struct mmc *mmc);
475 int mmc_getwp(struct mmc *mmc);
476 int mmc_execute_tuning(struct mmc *mmc, uint opcode);
477 int mmc_wait_dat0(struct mmc *mmc, int state, int timeout);
481 int (*send_cmd)(struct mmc *mmc,
[all …]
/external/u-boot/env/
Dmmc.c113 __weak int mmc_get_env_addr(struct mmc *mmc, int copy, u32 *env_addr) in mmc_get_env_addr() argument
118 offset += mmc->capacity; in mmc_get_env_addr()
131 __weak uint mmc_get_env_part(struct mmc *mmc) in mmc_get_env_part() argument
138 static int mmc_set_env_part(struct mmc *mmc) in mmc_set_env_part() argument
140 uint part = mmc_get_env_part(mmc); in mmc_set_env_part()
144 env_mmc_orig_hwpart = mmc_get_blk_desc(mmc)->hwpart; in mmc_set_env_part()
152 static inline int mmc_set_env_part(struct mmc *mmc) {return 0; }; in mmc_set_env_part() argument
155 static const char *init_mmc_for_env(struct mmc *mmc) in init_mmc_for_env() argument
157 if (!mmc) in init_mmc_for_env()
163 if (blk_get_from_parent(mmc->dev, &dev)) in init_mmc_for_env()
[all …]
/external/u-boot/common/spl/
Dspl_mmc.c18 static int mmc_load_legacy(struct spl_image_info *spl_image, struct mmc *mmc, in mmc_load_legacy() argument
30 image_size_sectors = (spl_image->size + mmc->read_bl_len - 1) / in mmc_load_legacy()
31 mmc->read_bl_len; in mmc_load_legacy()
34 count = blk_dread(mmc_get_blk_desc(mmc), sector, image_size_sectors, in mmc_load_legacy()
47 struct mmc *mmc = load->dev; in h_spl_load_read() local
49 return blk_dread(mmc_get_blk_desc(mmc), sector, count, buf); in h_spl_load_read()
54 struct mmc *mmc, unsigned long sector) in mmc_load_image_raw_sector() argument
64 count = blk_dread(mmc_get_blk_desc(mmc), sector, 1, header); in mmc_load_image_raw_sector()
76 load.dev = mmc; in mmc_load_image_raw_sector()
79 load.bl_len = mmc->read_bl_len; in mmc_load_image_raw_sector()
[all …]
/external/u-boot/drivers/dfu/
Ddfu_mmc.c25 struct mmc *mmc; in mmc_block_op() local
29 mmc = find_mmc_device(dfu->data.mmc.dev_num); in mmc_block_op()
30 if (!mmc) { in mmc_block_op()
31 pr_err("Device MMC %d - not found!", dfu->data.mmc.dev_num); in mmc_block_op()
39 *len = ALIGN(*len, dfu->data.mmc.lba_blk_size); in mmc_block_op()
41 blk_start = dfu->data.mmc.lba_start + in mmc_block_op()
42 (u32)lldiv(offset, dfu->data.mmc.lba_blk_size); in mmc_block_op()
43 blk_count = *len / dfu->data.mmc.lba_blk_size; in mmc_block_op()
45 dfu->data.mmc.lba_start + dfu->data.mmc.lba_size) { in mmc_block_op()
50 if (dfu->data.mmc.hw_partition >= 0) { in mmc_block_op()
[all …]

12345678910>>...21