This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How do I add "fatload mmc 0 0x80050000 tv.bin" into code of u-boot?

Dear TI


I try add command of "fatload mmc 0 0x80050000 tv.bin" into code, and I trace code to

u-boot/fs/fs.c

static int fs_read_fat(const char *filename, ulong addr, int offset, int len)
{
    int len_read;
        printf("value are %x %d %d\n", filename,offset,len);
    len_read = file_fat_read_at(filename, offset,
                    (unsigned char *)addr, len);
    if (len_read == -1) {
        printf("** Unable to read file %s **\n", filename);
        return -1;
    }

    return len_read;
}


At first, I do "fatload mmc 0 0x80050000 tv.bin" in u-boot mode, and it prints  "value are 8f9db6a8 0 0", as result, I do the same thing in u-boot code.


    time = get_timer(0);
    ptr=0x8f9db6a8;
    len_read=fs_read(ptr,0x80050000,0,0);
    time = get_timer(time);
    printf("%d bytes read in %lu ms", len_read, time);
    if (time > 0) {
        puts(" (");
        print_size(len_read / time * 1000, "/s");
        puts(")");
    }


but there error occurs.  

What is wrong? Could you correct me? Thank you.