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.

NAND prefetch read mode issue in uboot

Other Parts Discussed in Thread: DM385

hi team,

I'm using DM385, to speed up the boot speed, I port the prefetch mode read to uboot. but It didn't work, it's very weird.

Following is what I did.

I do the NAND access by hand and I programmed the NAND base address to 0x08000000,(write 0x48 to 0x50000078, the GPMC_CONFIG7).

Every thing goes well expect it can’t read out data from 0x08000000. I read 0x200 data from NAND, I can see the perfetch_status is 0x400001C0,

That means it take 0x40 data from the device, that’s good, but only thing is when I want read data from 0x08000000, it trigger the data_abort interrupt.

What else should I do to access the 0x08000000? Why arm can’t decode the 0x08000000, it should be re-directed to GPMC IP, is this right?

Following is my code if you have time to review it, Thanks.

{

               #define NAND_BASE 0x8000000

            unsigned short a;

            a = *(volatile unsigned int *) (0x50000050);       

            printf("nandcfg %08x cache enabled\n",a);

           

               // send out READ0 command

            *(volatile unsigned char *)(0x5000007c) = 0;       

            *(volatile unsigned char *)(0x50000080) = 0;       

            *(volatile unsigned char *)(0x50000080) = 0;       

            *(volatile unsigned char *)(0x50000080) = 0;       

            *(volatile unsigned char *)(0x50000080) = 0;       

            *(volatile unsigned char *)(0x50000080) = 0;       

            *(volatile unsigned char *)(0x5000007c) = 0x30; 

            udelay(2000000);

 

               // enable ECC

            *(volatile unsigned int *) (0x500001f8) = 0x01;       

            *(volatile unsigned int *) (0x500001fc) = 0x81a000;       

            *(volatile unsigned int *) (0x500001f4) = 0x11181;       

            *(volatile unsigned int *) (0x500001f8) = 0x101;       

 

               //send out RNDOUT command

            *(volatile unsigned char *)(0x5000007c) = 5;       

            *(volatile unsigned char *)(0x50000080) = 0;       

            *(volatile unsigned char *)(0x50000080) = 0;       

            *(volatile unsigned char *)(0x50000080) = 0;       

            *(volatile unsigned char *)(0x50000080) = 0;       

            *(volatile unsigned char *)(0x50000080) = 0;       

            *(volatile unsigned char *)(0x5000007c) = 0xe0; 

            udelay(2000000);

               // config the prefectch register

            *(volatile unsigned int *) (0x500001e4) = 0x200;       

            *(volatile unsigned int *) (0x500001e0) = 0x4080;       

            *(volatile unsigned int *) (0x500001ec) = 1;       

            

            

            udelay(1000000);

            a = *(volatile unsigned int *) (0x500001f0);       

            printf("stat %08x\n",a);

           

            while(1)

            {

                a = *(volatile unsigned int *) (0x500001f0);

                a = a>> 24;

                if(a != 0) break;

            }

           

            a = *(volatile unsigned int *) (0x500001f0);       

            printf("stat %08x\n",a);

           

            a = *(volatile unsigned short *)(NAND_BASE);

            printf(" %04x",a);

            a = *(volatile unsigned short *)(NAND_BASE);

            printf(" %04x",a);

            a = *(volatile unsigned short *)(NAND_BASE);

            printf(" %04x",a);

            a = *(volatile unsigned short *)(NAND_BASE);

            printf(" %04x\n",a);

            while(1);

   

    }