
But when flash is getting detected it shows the chipwidth is 8 and portwidth is 16. If you see the logs in earlier mail it is like found port 2 chip 1 port 16 bits chip 8 bits. Is it correct or wrong?
Check the nBYTE pin on the Spansion flash. For 16bit operation, it should be connected to 3.3V.
Again, please use the mainline CFI driver and give it another try.
I can not use the current code as we have to use the present code for some reason. I believe the uboot code 2009.08, I am using, must also support the S29GL512P chip.
We used the S29GL512P on 2009.08 too, so the problem is probably not related to wrong version of U-Boot. Your BDI configuration is the same we use, except for the ERASE command.
With an uninitialized memory controller, the CS0 is probably visible at address 0x0. So the ERASE should be ERASE 0x0 0x20000 512
Regards, Frank