2 * Copyright 2008, Freescale Semiconductor, Inc
5 * Based vaguely on the Linux code
7 * See file CREDITS for list of people who contributed to this
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32 #include <linux/list.h>
34 #include <asm/errno.h>
36 #if defined(CONFIG_SC8830) || defined(CONFIG_SC9630)
37 #include <asm/arch/sprd_reg_base.h>
39 #include <asm/arch/sc8810_reg_base.h>
41 #include <asm/arch/mfp.h>
42 #if defined(CONFIG_SC8830) || defined(CONFIG_SC9630)
43 #include <asm/arch/sprd_reg_ahb.h>
45 #include <asm/arch/sc8810_reg_ahb.h>
47 #include <asm/arch/ldo.h>
48 #include <asm/arch/sdio_reg_v3.h>
49 #include <asm/arch/chip_drv_common_io.h>
50 #if defined(CONFIG_SC8830) || defined(CONFIG_SC9630)
51 #include <asm/arch/sprd_reg_global.h>
52 #include <asm/arch/sprd_module_config.h>
54 #include <asm/arch/sc8810_reg_global.h>
55 #include <asm/arch/sc8810_module_config.h>
58 static struct list_head mmc_devices;
59 static int cur_dev_num = -1;
60 #ifdef CONFIG_EMMC_BOOT
61 static block_dev_desc_t sprd_mmc_dev;
64 int __board_mmc_getcd(u8 *cd, struct mmc *mmc) {
68 int board_mmc_getcd(u8 *cd, struct mmc *mmc)__attribute__((weak,
69 alias("__board_mmc_getcd")));
71 int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
73 return mmc->send_cmd(mmc, cmd, data);
76 int mmc_set_blocklen(struct mmc *mmc, int len)
80 cmd.cmdidx = MMC_CMD_SET_BLOCKLEN;
81 cmd.resp_type = MMC_RSP_R1;
85 return mmc_send_cmd(mmc, &cmd, NULL);
88 struct mmc *find_mmc_device(int dev_num)
91 struct list_head *entry;
93 list_for_each(entry, &mmc_devices) {
94 m = list_entry(entry, struct mmc, link);
96 if (m->block_dev.dev == dev_num)
100 printf("MMC Device %d not found\n", dev_num);
106 mmc_write_blocks(struct mmc *mmc, ulong start, lbaint_t blkcnt, const void*src)
109 struct mmc_data data;
111 if ((start + blkcnt) > mmc->block_dev.lba) {
112 printf("MMC: block number 0x%lx exceeds max(0x%lx)\n",
113 start + blkcnt, mmc->block_dev.lba);
118 cmd.cmdidx = MMC_CMD_WRITE_MULTIPLE_BLOCK;
120 cmd.cmdidx = MMC_CMD_WRITE_SINGLE_BLOCK;
122 if (mmc->high_capacity)
125 cmd.cmdarg = start * mmc->write_bl_len;
127 cmd.resp_type = MMC_RSP_R1;
131 data.blocks = blkcnt;
132 data.blocksize = mmc->write_bl_len;
133 data.flags = MMC_DATA_WRITE;
135 if (mmc_send_cmd(mmc, &cmd, &data)) {
136 printf("mmc write failed\n");
141 cmd.cmdidx = MMC_CMD_STOP_TRANSMISSION;
143 cmd.resp_type = MMC_RSP_R1b;
145 if (mmc_send_cmd(mmc, &cmd, NULL)) {
146 printf("mmc fail to send stop cmd\n");
155 mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, const void*src)
157 #ifdef CONFIG_EMMC_BOOT
160 if(Emmc_Write(0, start, blkcnt, (uint8*)src))
170 lbaint_t cur, blocks_todo = blkcnt;
172 struct mmc *mmc = find_mmc_device(dev_num);
176 if (mmc_set_blocklen(mmc, mmc->write_bl_len))
181 * The 65535 constraint comes from some hardware has
182 * only 16 bit width block number counter
184 cur = (blocks_todo > 8192) ? 8192 : blocks_todo;
185 if(mmc_write_blocks(mmc, start, cur, src) != cur)
189 src += cur * mmc->write_bl_len;
190 } while (blocks_todo > 0);
195 int mmc_read_blocks(struct mmc *mmc, void *dst, ulong start, lbaint_t blkcnt)
198 struct mmc_data data;
201 cmd.cmdidx = MMC_CMD_READ_MULTIPLE_BLOCK;
203 cmd.cmdidx = MMC_CMD_READ_SINGLE_BLOCK;
205 if (mmc->high_capacity)
208 cmd.cmdarg = start * mmc->read_bl_len;
210 cmd.resp_type = MMC_RSP_R1;
214 data.blocks = blkcnt;
215 data.blocksize = mmc->read_bl_len;
216 data.flags = MMC_DATA_READ;
218 if (mmc_send_cmd(mmc, &cmd, &data))
222 cmd.cmdidx = MMC_CMD_STOP_TRANSMISSION;
224 cmd.resp_type = MMC_RSP_R1b;
226 if (mmc_send_cmd(mmc, &cmd, NULL)) {
227 printf("mmc fail to send stop cmd\n");
235 static ulong mmc_bread(int dev_num, ulong start, lbaint_t blkcnt, void *dst)
237 #ifdef CONFIG_EMMC_BOOT
240 if(Emmc_Read(0, start, blkcnt, (uint8*)dst))
250 lbaint_t cur, blocks_todo = blkcnt;
255 struct mmc *mmc = find_mmc_device(dev_num);
259 if ((start + blkcnt) > mmc->block_dev.lba) {
260 printf("MMC: block number 0x%lx exceeds max(0x%lx)\n",
261 start + blkcnt, mmc->block_dev.lba);
265 if (mmc_set_blocklen(mmc, mmc->read_bl_len))
270 * The 65535 constraint comes from some hardware has
271 * only 16 bit width block number counter
273 cur = (blocks_todo > 8192) ? 8192 : blocks_todo;
274 if(mmc_read_blocks(mmc, dst, start, cur) != cur)
278 dst += cur * mmc->read_bl_len;
279 } while (blocks_todo > 0);
284 int mmc_go_idle(struct mmc* mmc)
291 cmd.cmdidx = MMC_CMD_GO_IDLE_STATE;
293 cmd.resp_type = MMC_RSP_NONE;
296 err = mmc_send_cmd(mmc, &cmd, NULL);
307 sd_send_op_cond(struct mmc *mmc)
314 cmd.cmdidx = MMC_CMD_APP_CMD;
315 cmd.resp_type = MMC_RSP_R1;
319 err = mmc_send_cmd(mmc, &cmd, NULL);
324 cmd.cmdidx = SD_CMD_APP_SEND_OP_COND;
325 cmd.resp_type = MMC_RSP_R3;
328 * Most cards do not answer if some reserved bits
329 * in the ocr are set. However, Some controller
330 * can set bit 7 (reserved for low voltages), but
331 * how to manage low voltages SD card is not yet
334 cmd.cmdarg = mmc->voltages & 0xff8000;
336 if (mmc->version == SD_VERSION_2)
337 cmd.cmdarg |= OCR_HCS;
339 err = mmc_send_cmd(mmc, &cmd, NULL);
345 } while ((!(cmd.response[0] & OCR_BUSY)) && timeout--);
350 if (mmc->version != SD_VERSION_2)
351 mmc->version = SD_VERSION_1_0;
353 mmc->ocr = cmd.response[0];
355 mmc->high_capacity = ((mmc->ocr & OCR_HCS) == OCR_HCS);
361 int mmc_send_op_cond(struct mmc *mmc)
367 /* Some cards seem to need this */
371 cmd.cmdidx = MMC_CMD_SEND_OP_COND;
372 cmd.resp_type = MMC_RSP_R3;
373 cmd.cmdarg = OCR_HCS | mmc->voltages;
376 err = mmc_send_cmd(mmc, &cmd, NULL);
382 } while (!(cmd.response[0] & OCR_BUSY) && timeout--);
387 mmc->version = MMC_VERSION_UNKNOWN;
388 mmc->ocr = cmd.response[0];
390 mmc->high_capacity = ((mmc->ocr & OCR_HCS) == OCR_HCS);
397 int mmc_send_ext_csd(struct mmc *mmc, char *ext_csd)
400 struct mmc_data data;
403 /* Get the Card Status Register */
404 cmd.cmdidx = MMC_CMD_SEND_EXT_CSD;
405 cmd.resp_type = MMC_RSP_R1;
411 data.blocksize = 512;
412 data.flags = MMC_DATA_READ;
414 err = mmc_send_cmd(mmc, &cmd, &data);
420 int mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value)
424 cmd.cmdidx = MMC_CMD_SWITCH;
425 cmd.resp_type = MMC_RSP_R1b;
426 cmd.cmdarg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) |
431 return mmc_send_cmd(mmc, &cmd, NULL);
434 int mmc_change_freq(struct mmc *mmc)
442 /* Only version 4 supports high-speed */
443 if (mmc->version < MMC_VERSION_4)
446 mmc->card_caps |= MMC_MODE_4BIT;
448 err = mmc_send_ext_csd(mmc, ext_csd);
453 if (ext_csd[212] || ext_csd[213] || ext_csd[214] || ext_csd[215])
454 mmc->high_capacity = 1;
456 cardtype = ext_csd[196] & 0xf;
458 err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, 1);
463 /* Now check to see that it worked */
464 err = mmc_send_ext_csd(mmc, ext_csd);
469 /* No high-speed support */
473 /* High Speed is set, there are two types: 52MHz and 26MHz */
474 if (cardtype & MMC_HS_52MHZ)
475 mmc->card_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
477 mmc->card_caps |= MMC_MODE_HS;
482 int sd_switch(struct mmc *mmc, int mode, int group, u8 value, u8 *resp)
485 struct mmc_data data;
487 /* Switch the frequency */
488 cmd.cmdidx = SD_CMD_SWITCH_FUNC;
489 cmd.resp_type = MMC_RSP_R1;
490 cmd.cmdarg = (mode << 31) | 0xffffff;
491 cmd.cmdarg &= ~(0xf << (group * 4));
492 cmd.cmdarg |= value << (group * 4);
495 data.dest = (char *)resp;
498 data.flags = MMC_DATA_READ;
500 return mmc_send_cmd(mmc, &cmd, &data);
504 int sd_change_freq(struct mmc *mmc)
509 uint switch_status[16];
510 struct mmc_data data;
515 /* Read the SCR to find out if this card supports higher speeds */
516 cmd.cmdidx = MMC_CMD_APP_CMD;
517 cmd.resp_type = MMC_RSP_R1;
518 cmd.cmdarg = mmc->rca << 16;
521 err = mmc_send_cmd(mmc, &cmd, NULL);
526 cmd.cmdidx = SD_CMD_APP_SEND_SCR;
527 cmd.resp_type = MMC_RSP_R1;
535 data.dest = (char *)&scr;
538 data.flags = MMC_DATA_READ;
540 err = mmc_send_cmd(mmc, &cmd, &data);
549 mmc->scr[0] = __be32_to_cpu(scr[0]);
550 mmc->scr[1] = __be32_to_cpu(scr[1]);
552 switch ((mmc->scr[0] >> 24) & 0xf) {
554 mmc->version = SD_VERSION_1_0;
557 mmc->version = SD_VERSION_1_10;
560 mmc->version = SD_VERSION_2;
563 mmc->version = SD_VERSION_1_0;
567 /* Version 1.0 doesn't support switching */
568 if (mmc->version == SD_VERSION_1_0)
573 err = sd_switch(mmc, SD_SWITCH_CHECK, 0, 1,
574 (u8 *)&switch_status);
579 /* The high-speed function is busy. Try again */
580 if (!(__be32_to_cpu(switch_status[7]) & SD_HIGHSPEED_BUSY))
584 if (mmc->scr[0] & SD_DATA_4BIT)
585 mmc->card_caps |= MMC_MODE_4BIT;
587 /* If high-speed isn't supported, we return */
588 if (!(__be32_to_cpu(switch_status[3]) & SD_HIGHSPEED_SUPPORTED))
591 err = sd_switch(mmc, SD_SWITCH_SWITCH, 0, 1, (u8 *)&switch_status);
596 if ((__be32_to_cpu(switch_status[4]) & 0x0f000000) == 0x01000000)
597 mmc->card_caps |= MMC_MODE_HS;
602 /* frequency bases */
603 /* divided by 10 to be nice to platforms without floating point */
611 /* Multiplier values for TRAN_SPEED. Multiplied by 10 to be nice
612 * to platforms without floating point.
614 int multipliers[] = {
633 void mmc_set_ios(struct mmc *mmc)
638 void mmc_set_clock(struct mmc *mmc, uint clock)
640 if (clock > mmc->f_max)
643 if (clock < mmc->f_min)
651 void mmc_set_bus_width(struct mmc *mmc, uint width)
653 mmc->bus_width = width;
658 int mmc_startup(struct mmc *mmc)
666 /* Put the Card in Identify Mode */
667 cmd.cmdidx = MMC_CMD_ALL_SEND_CID;
668 cmd.resp_type = MMC_RSP_R2;
672 err = mmc_send_cmd(mmc, &cmd, NULL);
677 memcpy(mmc->cid, cmd.response, 16);
680 * For MMC cards, set the Relative Address.
681 * For SD cards, get the Relatvie Address.
682 * This also puts the cards into Standby State
684 cmd.cmdidx = SD_CMD_SEND_RELATIVE_ADDR;
685 cmd.cmdarg = mmc->rca << 16;
686 cmd.resp_type = MMC_RSP_R6;
689 err = mmc_send_cmd(mmc, &cmd, NULL);
695 mmc->rca = (cmd.response[0] >> 16) & 0xffff;
697 /* Get the Card-Specific Data */
698 cmd.cmdidx = MMC_CMD_SEND_CSD;
699 cmd.resp_type = MMC_RSP_R2;
700 cmd.cmdarg = mmc->rca << 16;
703 err = mmc_send_cmd(mmc, &cmd, NULL);
708 mmc->csd[0] = cmd.response[0];
709 mmc->csd[1] = cmd.response[1];
710 mmc->csd[2] = cmd.response[2];
711 mmc->csd[3] = cmd.response[3];
713 if (mmc->version == MMC_VERSION_UNKNOWN) {
714 int version = (cmd.response[0] >> 26) & 0xf;
718 mmc->version = MMC_VERSION_1_2;
721 mmc->version = MMC_VERSION_1_4;
724 mmc->version = MMC_VERSION_2_2;
727 mmc->version = MMC_VERSION_3;
730 mmc->version = MMC_VERSION_4;
733 mmc->version = MMC_VERSION_1_2;
738 /* divide frequency by 10, since the mults are 10x bigger */
739 freq = fbase[(cmd.response[0] & 0x7)];
740 mult = multipliers[((cmd.response[0] >> 3) & 0xf)];
742 mmc->tran_speed = freq * mult;
744 mmc->read_bl_len = 1 << ((cmd.response[1] >> 16) & 0xf);
747 mmc->write_bl_len = mmc->read_bl_len;
749 mmc->write_bl_len = 1 << ((cmd.response[3] >> 22) & 0xf);
751 if (mmc->high_capacity) {
752 csize = (mmc->csd[1] & 0x3f) << 16
753 | (mmc->csd[2] & 0xffff0000) >> 16;
756 csize = (mmc->csd[1] & 0x3ff) << 2
757 | (mmc->csd[2] & 0xc0000000) >> 30;
758 cmult = (mmc->csd[2] & 0x00038000) >> 15;
761 mmc->capacity = (csize + 1) << (cmult + 2);
762 mmc->capacity *= mmc->read_bl_len;
764 if (mmc->read_bl_len > 512)
765 mmc->read_bl_len = 512;
767 if (mmc->write_bl_len > 512)
768 mmc->write_bl_len = 512;
770 /* Select the card, and put it into Transfer Mode */
771 cmd.cmdidx = MMC_CMD_SELECT_CARD;
772 cmd.resp_type = MMC_RSP_R1b;
773 cmd.cmdarg = mmc->rca << 16;
775 err = mmc_send_cmd(mmc, &cmd, NULL);
780 if (!IS_SD(mmc) && (mmc->version >= MMC_VERSION_4)) {
781 /* check ext_csd version and capacity */
782 err = mmc_send_ext_csd(mmc, ext_csd);
783 if (!err & (ext_csd[192] >= 2)) {
784 mmc->capacity = ext_csd[212] << 0 | ext_csd[213] << 8 |
785 ext_csd[214] << 16 | ext_csd[215] << 24;
786 mmc->capacity *= 512;
791 err = sd_change_freq(mmc);
793 err = mmc_change_freq(mmc);
798 /* Restrict card's capabilities by what the host can do */
799 mmc->card_caps &= mmc->host_caps;
802 if (mmc->card_caps & MMC_MODE_4BIT) {
803 cmd.cmdidx = MMC_CMD_APP_CMD;
804 cmd.resp_type = MMC_RSP_R1;
805 cmd.cmdarg = mmc->rca << 16;
808 err = mmc_send_cmd(mmc, &cmd, NULL);
812 cmd.cmdidx = SD_CMD_APP_SET_BUS_WIDTH;
813 cmd.resp_type = MMC_RSP_R1;
816 err = mmc_send_cmd(mmc, &cmd, NULL);
820 mmc_set_bus_width(mmc, 4);
823 if (mmc->card_caps & MMC_MODE_HS)
824 mmc_set_clock(mmc, 50000000);
826 mmc_set_clock(mmc, 25000000);
828 if (mmc->card_caps & MMC_MODE_4BIT) {
829 /* Set the card to use 4 bit*/
830 err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL,
832 EXT_CSD_BUS_WIDTH_4);
837 mmc_set_bus_width(mmc, 4);
838 } else if (mmc->card_caps & MMC_MODE_8BIT) {
839 /* Set the card to use 8 bit*/
840 err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL,
842 EXT_CSD_BUS_WIDTH_8);
847 mmc_set_bus_width(mmc, 8);
850 if (mmc->card_caps & MMC_MODE_HS) {
851 if (mmc->card_caps & MMC_MODE_HS_52MHz)
852 mmc_set_clock(mmc, 52000000);
854 mmc_set_clock(mmc, 26000000);
856 mmc_set_clock(mmc, 20000000);
859 /* fill in device description */
860 mmc->block_dev.lun = 0;
861 mmc->block_dev.type = 0;
862 mmc->block_dev.blksz = mmc->read_bl_len;
863 mmc->block_dev.lba = lldiv(mmc->capacity, mmc->read_bl_len);
864 sprintf(mmc->block_dev.vendor, "Man %06x Snr %08x", mmc->cid[0] >> 8,
865 (mmc->cid[2] << 8) | (mmc->cid[3] >> 24));
866 sprintf(mmc->block_dev.product, "%c%c%c%c%c", mmc->cid[0] & 0xff,
867 (mmc->cid[1] >> 24), (mmc->cid[1] >> 16) & 0xff,
868 (mmc->cid[1] >> 8) & 0xff, mmc->cid[1] & 0xff);
869 sprintf(mmc->block_dev.revision, "%d.%d", mmc->cid[2] >> 28,
870 (mmc->cid[2] >> 24) & 0xf);
871 init_part(&mmc->block_dev);
876 int mmc_send_if_cond(struct mmc *mmc)
881 cmd.cmdidx = SD_CMD_SEND_IF_COND;
882 /* We set the bit if the host supports voltages between 2.7 and 3.6 V */
883 cmd.cmdarg = ((mmc->voltages & 0xff8000) != 0) << 8 | 0xaa;
884 cmd.resp_type = MMC_RSP_R7;
887 err = mmc_send_cmd(mmc, &cmd, NULL);
892 if ((cmd.response[0] & 0xff) != 0xaa)
895 mmc->version = SD_VERSION_2;
900 int mmc_register(struct mmc *mmc)
902 /* Setup the universal parts of the block interface just once */
903 mmc->block_dev.if_type = IF_TYPE_MMC;
904 mmc->block_dev.dev = cur_dev_num++;
905 mmc->block_dev.removable = 1;
906 #ifdef CONFIG_EMMC_BOOT
907 if(cur_dev_num == 2){
908 mmc->block_dev.part_type = PART_TYPE_EFI;
909 mmc->block_dev.lun = 0;
910 mmc->block_dev.type = 0;
912 /* FIXME fill in the correct size (is set to 32MByte) */
913 mmc->block_dev.blksz = 512;
915 mmc->block_dev.lba = Emmc_GetCapacity(0);;
918 mmc->block_dev.block_read = mmc_bread;
919 mmc->block_dev.block_write = mmc_bwrite;
921 INIT_LIST_HEAD (&mmc->link);
923 list_add_tail (&mmc->link, &mmc_devices);
928 block_dev_desc_t *mmc_get_dev(int dev)
930 #ifdef CONFIG_EMMC_BOOT
932 return ((block_dev_desc_t *) & sprd_mmc_dev);
934 struct mmc *mmc = find_mmc_device(dev);
936 return mmc ? &mmc->block_dev : NULL;
939 int mmc_init(struct mmc *mmc)
943 err = mmc->init(mmc);
948 mmc_set_bus_width(mmc, 1);
949 mmc_set_clock(mmc, 1);
952 err = mmc_go_idle(mmc);
957 /* Test for SD version 2 */
958 err = mmc_send_if_cond(mmc);
960 /* Now try to get the SD card's operating condition */
961 err = sd_send_op_cond(mmc);
963 /* If the command timed out, we check for an MMC card */
964 if (err == TIMEOUT) {
965 err = mmc_send_op_cond(mmc);
968 printf("Card did not respond to voltage select!\n");
973 return mmc_startup(mmc);
977 * CPU and board-specific MMC initializations. Aliased function
978 * signals caller to move on
980 static int __def_mmc_init(bd_t *bis)
985 int cpu_mmc_init(bd_t *bis) __attribute__((weak, alias("__def_mmc_init")));
986 int board_mmc_init(bd_t *bis) __attribute__((weak, alias("__def_mmc_init")));
988 void print_mmc_devices(char separator)
991 struct list_head *entry;
993 list_for_each(entry, &mmc_devices) {
994 m = list_entry(entry, struct mmc, link);
996 printf("%s: %d", m->name, m->block_dev.dev);
998 if (entry->next != &mmc_devices)
999 printf("%c ", separator);
1005 int mmc_initialize(bd_t *bis)
1007 INIT_LIST_HEAD (&mmc_devices);
1010 if (board_mmc_init(bis) < 0)
1013 print_mmc_devices(',');
1017 #ifdef CONFIG_EMMC_BOOT
1018 #define MMCSD_SECTOR_SIZE 512
1019 int mmc_legacy_init(int dev)
1021 printf("mmc_legacy_init\n");
1022 int retries, rc = -ENODEV;
1023 uint32_t cid_resp[4];
1027 if(TRUE == Emmc_Init())
1029 sprd_mmc_dev.if_type = IF_TYPE_UNKNOWN;
1030 sprd_mmc_dev.if_type = IF_TYPE_MMC;
1031 #ifdef CONFIG_EBR_PARTITION
1032 sprd_mmc_dev.part_type = PART_TYPE_DOS;
1034 sprd_mmc_dev.part_type = PART_TYPE_EFI;
1036 sprd_mmc_dev.dev = 1;
1037 sprd_mmc_dev.lun = 0;
1038 sprd_mmc_dev.type = 0;
1040 /* FIXME fill in the correct size (is set to 32MByte) */
1041 sprd_mmc_dev.blksz = MMCSD_SECTOR_SIZE;
1043 sprd_mmc_dev.lba = Emmc_GetCapacity(0);;
1044 sprd_mmc_dev.removable = 1;
1045 sprd_mmc_dev.block_read = mmc_bread;
1046 sprd_mmc_dev.block_write = mmc_bwrite;
1052 #ifdef CONFIG_GENERIC_MMC
1053 int mmc_sdcard_init()
1055 #if defined(CONFIG_SC8830) || defined(CONFIG_SC9630)
1056 if (TRUE == SDCARD_PowerOn()) {
1057 printf("SDCARD_PowerOn finished\n");
1060 printf("SDCARD_PowerOn failed\n");