Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int nandRead(int cl, int al, char *buf, int count) {
- unsigned int cmds[count];
- int x, i, ret;
- i = count;
- ret = 0;
- cmds[0] = cl;
- printf("Cmd:\n");
- for (x = 0; x < i; x++)
- printf("%x %s", cmds[x], ((x & 15) == 15) ? "\n" : "");
- printf("\n\n");
- if (!nanddmaw_busy_read()) {
- printf("writing %d bytes\n", count);
- nanddmaw_reset_write(1);
- nanddmaw_base_write((unsigned int)cmds);
- nanddmaw_length_write(count);
- nanddmaw_shoot_write(1);
- } else {
- printf("DMA busy :(\n");
- return -4;
- }
- flush_l2_cache();
- for (x = 0; x < count; x++)
- buf[x] = cmds[x];
- printf("Buf:\n");
- for (x = 0; x < count; x++)
- printf("%x %s", buf[x], ((x & 15) == 15) ? "\n" : "");
- printf("\n\n");
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement