2 #include <linux/types.h>
9 #define SD_RAMDISK "ramdisk.img"
11 #define TEST_VERIFY_FILE ".sprdtest"
13 int load_sd_ramdisk(void* buf,int size)
16 block_dev_desc_t *dev_desc=NULL;
20 printf("%s: tick=%ld\n",__func__,get_ticks());
22 mmc = find_mmc_device(0);
26 printf("mmc init failed %d,tick=%d\n", ret,get_ticks());
30 printf("no mmc card found\n");
34 dev_desc = &mmc->block_dev;
36 printf("no mmc block device found\n");
39 ret = fat_register_device(dev_desc, 1);
41 printf("fat regist fail %d\n", ret);
44 ret = file_fat_detectfs();
46 printf("detect fs failed\n");
50 ret = file_fat_read(TEST_VERIFY_FILE, bufread, 10);
52 printf("sd verity file read error %d\n", ret);
56 ret = file_fat_read(SD_RAMDISK, buf, size);
58 printf("sd file read error %d\n", ret);
60 printf("fat_read %d,tick=%ld\n", ret,get_ticks());