All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
@ 2010-04-09  5:26 prakash bedge
  2010-04-09  6:10 ` Stefan Roese
  2010-04-09  7:48 ` Frank Svendsbøe
  0 siblings, 2 replies; 31+ messages in thread
From: prakash bedge @ 2010-04-09  5:26 UTC (permalink / raw)
  To: u-boot

Hi,

In U-boot I am not seeing the support for Spansion S29GL512P NOR flash.

This chip is CFI compliant so I believe the common CFI driver should work
with this chip.

Does U-boot supports S29GL512P NOR flash or I have to implement the
functionality to support S29GL512P?

If anyone has tried with S29GL512P NOR flash please share the experiecne.


Thanks & Regards,
Prakash

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09  5:26 [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash? prakash bedge
@ 2010-04-09  6:10 ` Stefan Roese
  2010-04-09  7:22   ` prakash bedge
  2012-03-10 10:47   ` Balaji Sivakumar
  2010-04-09  7:48 ` Frank Svendsbøe
  1 sibling, 2 replies; 31+ messages in thread
From: Stefan Roese @ 2010-04-09  6:10 UTC (permalink / raw)
  To: u-boot

Hi Prakash,

On Friday 09 April 2010 07:26:37 prakash bedge wrote:
> In U-boot I am not seeing the support for Spansion S29GL512P NOR flash.
> 
> This chip is CFI compliant so I believe the common CFI driver should work
> with this chip.
> 
> Does U-boot supports S29GL512P NOR flash or I have to implement the
> functionality to support S29GL512P?
> 
> If anyone has tried with S29GL512P NOR flash please share the experiecne.

This chip is currently supported by the common CFI NOR FLASH driver. So it 
should just work for your board as well.

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09  6:10 ` Stefan Roese
@ 2010-04-09  7:22   ` prakash bedge
  2010-04-09  7:35     ` Stefan Roese
  2012-03-10 10:47   ` Balaji Sivakumar
  1 sibling, 1 reply; 31+ messages in thread
From: prakash bedge @ 2010-04-09  7:22 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

Thanks for details. But I didn't get it clearly.

Does it mean I have to CFI_MTD ot common CFI_DRIVER will works?

Which c source file I need to check the support for this chip?

I am using below settings.
*-----------------------------------------------------------------------
 * FLASH related
 *----------------------------------------------------------------------*/
#define CONFIG_SYS_FLASH_CFI
#define CONFIG_FLASH_CFI_DRIVER
#define CONFIG_SYS_FLASH_EMPTY_INFO  /* print 'E' for empty sector on flinfo
*/

#define CONFIG_SYS_FLASH_BANKS_LIST    {CONFIG_SYS_FLASH_BASE}
#define CONFIG_SYS_MAX_FLASH_BANKS     1      /* number of banks     */
#define CONFIG_SYS_MAX_FLASH_SECT 512      /* sectors per device   */
#define CONFIG_FLASH_SHOW_PROGRESS  1

#define CONFIG_SYS_FLASH_ERASE_TOUT 220000 /* Timeout for Flash Erase (in
ms) */
#define CONFIG_SYS_FLASH_WRITE_TOUT 100 /* Timeout for Flash Write (in
ms) */

#define CONFIG_ENV_SECT_SIZE 0x20000 /* size of one complete sector */
#define CONFIG_ENV_ADDR  (CONFIG_SYS_MONITOR_BASE-CONFIG_ENV_SECT_SIZE)
#define CONFIG_ENV_SIZE  0x4000 /* Total Size of Environment Sector */


Thanks & Regards,
Prakash Bedge

On Fri, Apr 9, 2010 at 11:40 AM, Stefan Roese <sr@denx.de> wrote:

> Hi Prakash,
>
> On Friday 09 April 2010 07:26:37 prakash bedge wrote:
> > In U-boot I am not seeing the support for Spansion S29GL512P NOR flash.
> >
> > This chip is CFI compliant so I believe the common CFI driver should work
> > with this chip.
> >
> > Does U-boot supports S29GL512P NOR flash or I have to implement the
> > functionality to support S29GL512P?
> >
> > If anyone has tried with S29GL512P NOR flash please share the experiecne.
>
> This chip is currently supported by the common CFI NOR FLASH driver. So it
> should just work for your board as well.
>
> Cheers,
> Stefan
>
> --
> DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09  7:22   ` prakash bedge
@ 2010-04-09  7:35     ` Stefan Roese
  2010-04-09  7:55       ` Frank Svendsbøe
  2010-04-09  8:05       ` prakash bedge
  0 siblings, 2 replies; 31+ messages in thread
From: Stefan Roese @ 2010-04-09  7:35 UTC (permalink / raw)
  To: u-boot

Hi Prakash,

On Friday 09 April 2010 09:22:21 prakash bedge wrote:
> Thanks for details. But I didn't get it clearly.
> 
> Does it mean I have to CFI_MTD ot common CFI_DRIVER will works?

I don't understand this question.
 
> Which c source file I need to check the support for this chip?
> 
> I am using below settings.
> *-----------------------------------------------------------------------
>  * FLASH related
>  *----------------------------------------------------------------------*/
> #define CONFIG_SYS_FLASH_CFI
> #define CONFIG_FLASH_CFI_DRIVER
> #define CONFIG_SYS_FLASH_EMPTY_INFO  /* print 'E' for empty sector on
> flinfo */
> 
> #define CONFIG_SYS_FLASH_BANKS_LIST    {CONFIG_SYS_FLASH_BASE}
> #define CONFIG_SYS_MAX_FLASH_BANKS     1      /* number of banks     */
> #define CONFIG_SYS_MAX_FLASH_SECT 512      /* sectors per device   */
> #define CONFIG_FLASH_SHOW_PROGRESS  1
> 
> #define CONFIG_SYS_FLASH_ERASE_TOUT 220000 /* Timeout for Flash Erase (in
> ms) */
> #define CONFIG_SYS_FLASH_WRITE_TOUT 100 /* Timeout for Flash Write (in
> ms) */
> 
> #define CONFIG_ENV_SECT_SIZE 0x20000 /* size of one complete sector */
> #define CONFIG_ENV_ADDR  (CONFIG_SYS_MONITOR_BASE-CONFIG_ENV_SECT_SIZE)
> #define CONFIG_ENV_SIZE  0x4000 /* Total Size of Environment Sector */

This looks good. With these defines the CFI driver should work. You might want 
to add CONFIG_SYS_FLASH_USE_BUFFER_WRITE for write speedup. And you need to 
configure your access timing for the chip select to the NOR Chip correctly of 
course.

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09  5:26 [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash? prakash bedge
  2010-04-09  6:10 ` Stefan Roese
@ 2010-04-09  7:48 ` Frank Svendsbøe
  2010-04-09  8:07   ` prakash bedge
  1 sibling, 1 reply; 31+ messages in thread
From: Frank Svendsbøe @ 2010-04-09  7:48 UTC (permalink / raw)
  To: u-boot

On Fri, Apr 9, 2010 at 7:26 AM, prakash bedge <prakash.bedge@gmail.com> wrote:
> Hi,
>
> In U-boot I am not seeing the support for Spansion S29GL512P NOR flash.
>
> This chip is CFI compliant so I believe the common CFI driver should work
> with this chip.
>
> Does U-boot supports S29GL512P NOR flash or I have to implement the
> functionality to support S29GL512P?
>
> If anyone has tried with S29GL512P NOR flash please share the experiecne.
>

Hi Prakash,

I can confirm the S29GL512P is working with U-Boot (and Linux). No
special work has been
done to make it work. Use chiptype MIRRORX16, if you're using a
BDI3000 JTAG to flash U-Boot.

Good luck
Frank

>
> Thanks & Regards,
> Prakash
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09  7:35     ` Stefan Roese
@ 2010-04-09  7:55       ` Frank Svendsbøe
  2010-04-09  8:05       ` prakash bedge
  1 sibling, 0 replies; 31+ messages in thread
From: Frank Svendsbøe @ 2010-04-09  7:55 UTC (permalink / raw)
  To: u-boot

>> Does it mean I have to CFI_MTD ot common CFI_DRIVER will works?
>
> I don't understand this question.
>

me neither

>> ?*----------------------------------------------------------------------*/
>> #define CONFIG_SYS_FLASH_CFI
>> #define CONFIG_FLASH_CFI_DRIVER
>> #define CONFIG_SYS_FLASH_EMPTY_INFO ?/* print 'E' for empty sector on
>> flinfo */
>>
>> #define CONFIG_SYS_FLASH_BANKS_LIST ? ?{CONFIG_SYS_FLASH_BASE}
>> #define CONFIG_SYS_MAX_FLASH_BANKS ? ? 1 ? ? ?/* number of banks ? ? */
>> #define CONFIG_SYS_MAX_FLASH_SECT 512 ? ? ?/* sectors per device ? */
>> #define CONFIG_FLASH_SHOW_PROGRESS ?1
>>
>> #define CONFIG_SYS_FLASH_ERASE_TOUT 220000 /* Timeout for Flash Erase (in
>> ms) */
>> #define CONFIG_SYS_FLASH_WRITE_TOUT 100 /* Timeout for Flash Write (in
>> ms) */
>>
>> #define CONFIG_ENV_SECT_SIZE 0x20000 /* size of one complete sector */
>> #define CONFIG_ENV_ADDR ?(CONFIG_SYS_MONITOR_BASE-CONFIG_ENV_SECT_SIZE)
>> #define CONFIG_ENV_SIZE ?0x4000 /* Total Size of Environment Sector */
>
> This looks good. With these defines the CFI driver should work. You might want
> to add CONFIG_SYS_FLASH_USE_BUFFER_WRITE for write speedup. And you need to
> configure your access timing for the chip select to the NOR Chip correctly of
> course.
>

Yes, we use #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE 1, on order to
speed write ops.
Our BR- and OR setting is very conservative since some signals are
routed through an FPGA and are delayed.
For this reason, we utilize 8 wait states.

Frank

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09  7:35     ` Stefan Roese
  2010-04-09  7:55       ` Frank Svendsbøe
@ 2010-04-09  8:05       ` prakash bedge
  2010-04-09  8:09         ` Stefan Roese
  1 sibling, 1 reply; 31+ messages in thread
From: prakash bedge @ 2010-04-09  8:05 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

>> Does it mean I have to CFI_MTD ot common CFI_DRIVER will works?
I was asking that do I also need to add below settings in my board config
file.

/*
 * Dynamic MTD partition support
 */
#define CONFIG_CMD_MTDPARTS
#define CONFIG_MTD_DEVICE  /* needed for mtdparts commands */
#define CONFIG_FLASH_CFI_MTD
#define MTDIDS_DEFAULT  "nor0=fc000000.flash"
>And you need to configure your access timing for the chip select to the NOR
Chip correctly of course.
In which source file I can see present access timings for the chip select.
In which file I need to do these changes?

I tried with the below setting but I am getting the same error as flash not
found. So I am little bit concerned.
Please tell which boards supports the S29GL512P NOR flash, so that I can
check for reference.


Regards,
Prakash

On Fri, Apr 9, 2010 at 1:05 PM, Stefan Roese <sr@denx.de> wrote:

> Hi Prakash,
>
> On Friday 09 April 2010 09:22:21 prakash bedge wrote:
> > Thanks for details. But I didn't get it clearly.
> >
> > Does it mean I have to CFI_MTD ot common CFI_DRIVER will works?
>
> I don't understand this question.
>
> > Which c source file I need to check the support for this chip?
> >
> > I am using below settings.
> > *-----------------------------------------------------------------------
> >  * FLASH related
> >
>  *----------------------------------------------------------------------*/
> > #define CONFIG_SYS_FLASH_CFI
> > #define CONFIG_FLASH_CFI_DRIVER
> > #define CONFIG_SYS_FLASH_EMPTY_INFO  /* print 'E' for empty sector on
> > flinfo */
> >
> > #define CONFIG_SYS_FLASH_BANKS_LIST    {CONFIG_SYS_FLASH_BASE}
> > #define CONFIG_SYS_MAX_FLASH_BANKS     1      /* number of banks     */
> > #define CONFIG_SYS_MAX_FLASH_SECT 512      /* sectors per device   */
> > #define CONFIG_FLASH_SHOW_PROGRESS  1
> >
> > #define CONFIG_SYS_FLASH_ERASE_TOUT 220000 /* Timeout for Flash Erase (in
> > ms) */
> > #define CONFIG_SYS_FLASH_WRITE_TOUT 100 /* Timeout for Flash Write (in
> > ms) */
> >
> > #define CONFIG_ENV_SECT_SIZE 0x20000 /* size of one complete sector */
> > #define CONFIG_ENV_ADDR  (CONFIG_SYS_MONITOR_BASE-CONFIG_ENV_SECT_SIZE)
> > #define CONFIG_ENV_SIZE  0x4000 /* Total Size of Environment Sector */
>
> This looks good. With these defines the CFI driver should work. You might
> want
> to add CONFIG_SYS_FLASH_USE_BUFFER_WRITE for write speedup. And you need to
> configure your access timing for the chip select to the NOR Chip correctly
> of
> course.
>
> Cheers,
> Stefan
>
> --
> DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09  7:48 ` Frank Svendsbøe
@ 2010-04-09  8:07   ` prakash bedge
  2010-04-09  8:23     ` Frank Svendsbøe
  0 siblings, 1 reply; 31+ messages in thread
From: prakash bedge @ 2010-04-09  8:07 UTC (permalink / raw)
  To: u-boot

Hi Frank,

Why I should use MIRRORX16 in BDI3000 config file?

Can you please tell which boards support the S29GL512P NOR flash?

Regards,
Prakash Bedge
On Fri, Apr 9, 2010 at 1:18 PM, Frank Svendsb?e
<frank.svendsboe@gmail.com>wrote:

>  On Fri, Apr 9, 2010 at 7:26 AM, prakash bedge <prakash.bedge@gmail.com>
> wrote:
> > Hi,
> >
> > In U-boot I am not seeing the support for Spansion S29GL512P NOR flash.
> >
> > This chip is CFI compliant so I believe the common CFI driver should work
> > with this chip.
> >
> > Does U-boot supports S29GL512P NOR flash or I have to implement the
> > functionality to support S29GL512P?
> >
> > If anyone has tried with S29GL512P NOR flash please share the experiecne.
> >
>
> Hi Prakash,
>
> I can confirm the S29GL512P is working with U-Boot (and Linux). No
> special work has been
> done to make it work. Use chiptype MIRRORX16, if you're using a
> BDI3000 JTAG to flash U-Boot.
>
> Good luck
> Frank
>
> >
> > Thanks & Regards,
> > Prakash
> >
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot at lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
> >
> >
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09  8:05       ` prakash bedge
@ 2010-04-09  8:09         ` Stefan Roese
  2010-04-09  9:10           ` Frank Svendsbøe
  0 siblings, 1 reply; 31+ messages in thread
From: Stefan Roese @ 2010-04-09  8:09 UTC (permalink / raw)
  To: u-boot

On Friday 09 April 2010 10:05:02 prakash bedge wrote:
> >> Does it mean I have to CFI_MTD ot common CFI_DRIVER will works?
> 
> I was asking that do I also need to add below settings in my board config
> file.
> 
> /*
>  * Dynamic MTD partition support
>  */
> #define CONFIG_CMD_MTDPARTS
> #define CONFIG_MTD_DEVICE  /* needed for mtdparts commands */
> #define CONFIG_FLASH_CFI_MTD
> #define MTDIDS_DEFAULT  "nor0=fc000000.flash"

No, you don't need those defines for "normal" FLASH access in U-Boot.
 
> >And you need to configure your access timing for the chip select to the
> >NOR Chip correctly of course.
>
> In which source file I can see present access timings for the chip select.
> In which file I need to do these changes?

This is not really CFI driver related. It platforms/SoC specific. Which CPU 
are you using? Can you access the FLASH chip from your JTAG debugger?
 
> I tried with the below setting but I am getting the same error as flash not
> found. So I am little bit concerned.

What are the error messages? Please post a log.

> Please tell which boards supports the S29GL512P NOR flash, so that I can
> check for reference.

Check kilauea.h for example.

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09  8:07   ` prakash bedge
@ 2010-04-09  8:23     ` Frank Svendsbøe
  0 siblings, 0 replies; 31+ messages in thread
From: Frank Svendsbøe @ 2010-04-09  8:23 UTC (permalink / raw)
  To: u-boot

On Fri, Apr 9, 2010 at 10:07 AM, prakash bedge <prakash.bedge@gmail.com> wrote:
> Hi Frank,
>
> Why?I should use MIRRORX16 in BDI3000 config file?
>

According to the different flash algorithms described in the BDI
manual, this was the closest we found, and it works.
What chiptype do you use today?

> Can you please tell which?boards support the S29GL512P NOR flash?
>

None yet I think. We'll commit a patch soon which supports the Siemens
Digital Powerline Modem (DPM).

Our U-Boot/Linux hardware is based on Analogue & Micros Adder Module,
but modified a bit (different flash and SDRAM,
contains an FPGA, an AVR and a TI DSP).

Best regards,
Frank

> Regards,
> Prakash Bedge
> On Fri, Apr 9, 2010 at 1:18 PM, Frank Svendsb?e <frank.svendsboe@gmail.com>
> wrote:
>>
>> On Fri, Apr 9, 2010 at 7:26 AM, prakash bedge <prakash.bedge@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > In U-boot I am not seeing the support for Spansion S29GL512P NOR flash.
>> >
>> > This chip is CFI compliant so I believe the common CFI driver should
>> > work
>> > with this chip.
>> >
>> > Does U-boot supports S29GL512P NOR flash or I have to implement the
>> > functionality to support S29GL512P?
>> >
>> > If anyone has tried with S29GL512P NOR flash please share the
>> > experiecne.
>> >
>>
>> Hi Prakash,
>>
>> I can confirm the S29GL512P is working with U-Boot (and Linux). No
>> special work has been
>> done to make it work. Use chiptype MIRRORX16, if you're using a
>> BDI3000 JTAG to flash U-Boot.
>>
>> Good luck
>> Frank
>>
>> >
>> > Thanks & Regards,
>> > Prakash
>> >
>> > _______________________________________________
>> > U-Boot mailing list
>> > U-Boot at lists.denx.de
>> > http://lists.denx.de/mailman/listinfo/u-boot
>> >
>> >
>
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09  8:09         ` Stefan Roese
@ 2010-04-09  9:10           ` Frank Svendsbøe
  2010-04-09 12:11             ` prakash bedge
  0 siblings, 1 reply; 31+ messages in thread
From: Frank Svendsbøe @ 2010-04-09  9:10 UTC (permalink / raw)
  To: u-boot

>> In which source file I can see present access timings for the chip select.
>> In which file I need to do these changes?
>
> This is not really CFI driver related. It platforms/SoC specific. Which CPU
> are you using? Can you access the FLASH chip from your JTAG debugger?
>
>> I tried with the below setting but I am getting the same error as flash not
>> found. So I am little bit concerned.
>

Prakash: As Stefan mentioned, this is probably not a CFI driver issue.
Most probably a wrong/non memory
controller setup. What CPU are you using, and what chip-select is the
flash using?

First, you should be able to read, erase and write via the JTAG before
you even think about U-Boot.

> What are the error messages? Please post a log.
>
>> Please tell which boards supports the S29GL512P NOR flash, so that I can
>> check for reference.
>
> Check kilauea.h for example.
>

Stefan: Didn't know that. Should have known that a year ago ;-)

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09  9:10           ` Frank Svendsbøe
@ 2010-04-09 12:11             ` prakash bedge
  2010-04-09 13:27               ` Frank Svendsbøe
  2010-04-09 13:35               ` Stefan Roese
  0 siblings, 2 replies; 31+ messages in thread
From: prakash bedge @ 2010-04-09 12:11 UTC (permalink / raw)
  To: u-boot

Hi Frank,

>> What CPU are you using, and what chip-select is the flash using?
I am using PPC440x5 Cpu core. How to check the chip-select flash is using?
Earlier I have run the same code for M29W128GH and it works fine. But with
S29GL512 it is not working.
Now the difference is only in size and write/read timings. So I believe it
should work in smooth manner.


kilauea.h file is present in the U-boot.
So does this board supports S29GL512P Nor flash chip?


Regards,
Prakash


On Fri, Apr 9, 2010 at 2:40 PM, Frank Svendsb?e
<frank.svendsboe@gmail.com>wrote:

> >> In which source file I can see present access timings for the chip
> select.
> >> In which file I need to do these changes?
> >
> > This is not really CFI driver related. It platforms/SoC specific. Which
> CPU
> > are you using? Can you access the FLASH chip from your JTAG debugger?
> >
> >> I tried with the below setting but I am getting the same error as flash
> not
> >> found. So I am little bit concerned.
> >
>
> Prakash: As Stefan mentioned, this is probably not a CFI driver issue.
> Most probably a wrong/non memory
> controller setup. What CPU are you using, and what chip-select is the
> flash using?
>
> First, you should be able to read, erase and write via the JTAG before
> you even think about U-Boot.
>
> > What are the error messages? Please post a log.
> >
> >> Please tell which boards supports the S29GL512P NOR flash, so that I can
> >> check for reference.
> >
> > Check kilauea.h for example.
> >
>
> Stefan: Didn't know that. Should have known that a year ago ;-)
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09 12:11             ` prakash bedge
@ 2010-04-09 13:27               ` Frank Svendsbøe
  2010-04-12  4:13                 ` prakash bedge
  2010-04-09 13:35               ` Stefan Roese
  1 sibling, 1 reply; 31+ messages in thread
From: Frank Svendsbøe @ 2010-04-09 13:27 UTC (permalink / raw)
  To: u-boot

> I am using PPC440x5 Cpu core. How to check the chip-select flash is using?
> Earlier I have run the same code for M29W128GH and it works fine. But with
> S29GL512 it is not working.
> Now the difference is only in size and write/read timings. So I believe it
> should work in smooth manner.
>

Hmm.. If you're supposed to boot from this device, then I assume the
flash is connected to CS0.For slow devices, the memory controller is
usually setup to use the GPCM. Check your options and base registers
(OR0 and BR0). Everything related to timing (for GPCM controlled
devices) is done in these two registers.

If you have a BDI JTAG, you can set these registers using that and try
to perform flash operations from here. Again, if you can, try to
access the flash using the JTAG before experimenting with U-Boot.

You mention different size.. is the port size different too?

In order to help you, I think the community needs more info about your
system. Stefan asked for logs, etc.

Regards,
Frank

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09 12:11             ` prakash bedge
  2010-04-09 13:27               ` Frank Svendsbøe
@ 2010-04-09 13:35               ` Stefan Roese
  2010-04-12  4:18                 ` prakash bedge
  1 sibling, 1 reply; 31+ messages in thread
From: Stefan Roese @ 2010-04-09 13:35 UTC (permalink / raw)
  To: u-boot

Hi Prakash,

On Friday 09 April 2010 14:11:39 prakash bedge wrote:
> >> What CPU are you using, and what chip-select is the flash using?
> 
> I am using PPC440x5 Cpu core. How to check the chip-select flash is using?

This is a custom PPC4xx version, correct? Which external bus controller is 
used here? The EBC from IBM as on the AMCC 4xx versions? You need to check 
your SoC documentation for this.

> Earlier I have run the same code for M29W128GH and it works fine. But with
> S29GL512 it is not working.
> Now the difference is only in size and write/read timings. So I believe it
> should work in smooth manner.

Right. Most likely you just need to tune the chip select timing registers. And 
of course the size of the CS. No idea how this is done for your external bus 
controller though.

BTW: You might also need to configure a bigger TLB entry for the FLASH now 
that you use a bigger FLASH chip.
 
> kilauea.h file is present in the U-boot.
> So does this board supports S29GL512P Nor flash chip?

Yes. As most AMCC eval boards do.
 
Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09 13:27               ` Frank Svendsbøe
@ 2010-04-12  4:13                 ` prakash bedge
  2010-04-12 17:01                   ` Frank Svendsbøe
  2010-04-12 17:15                   ` Frank Svendsbøe
  0 siblings, 2 replies; 31+ messages in thread
From: prakash bedge @ 2010-04-12  4:13 UTC (permalink / raw)
  To: u-boot

Hi Frank,Stefan,

Please see bleow error log for I am getting in detecting CFI flash chip.
I am running u-boot from CRAM temporarily.

--------
U-Boot 2009.08 (Apr 01 2010 - 17:32:17)
DRAM:   2 MB
Top of RAM usable for U-Boot at: 00200000
Reserving 175k for U-Boot at: 001d4000
Reserving 1040k for malloc() at: 000d0000
Reserving 128 Bytes for Board Info at: 000cff80
Reserving 56 Bytes for Global Data at: 000cff48
Stack Pointer at: 000cff28
New Stack Pointer is: 000cff28
Now running in RAM - U-Boot at: 001d4000
FLASH: flash detect cfi
fwc addr fc000000 cmd ff ff00 16bit x 8 bit
fwc addr fc000000 cmd f0 f000 16bit x 8 bit
fwc addr fc0000aa cmd 98 9800 16bit x 8 bit
is= cmd 51(Q) addr fc000020 is= ffff 5100
fwc addr fc000aaa cmd 98 9800 16bit x 8 bit
is= cmd 51(Q) addr fc000020 is= ffff 5100
fwc addr fc000000 cmd ff 0000 16bit x 16 bit
fwc addr fc000000 cmd f0 0000 16bit x 16 bit
fwc addr fc0000aa cmd 98 0000 16bit x 16 bit
is= cmd 51(Q) addr fc000020 is= ffff 0000
fwc addr fc000aaa cmd 98 0000 16bit x 16 bit
is= cmd 51(Q) addr fc000020 is= ffff 0000
fwc addr fc000000 cmd ff ff00ff00 32bit x 8 bit
fwc addr fc000000 cmd f0 f000f000 32bit x 8 bit
fwc addr fc000154 cmd 98 98009800 32bit x 8 bit
is= cmd 51(Q) addr fc000040 is= ffffffff 51005100
fwc addr fc001554 cmd 98 98009800 32bit x 8 bit
is= cmd 51(Q) addr fc000040 is= ffffffff 51005100
fwc addr fc000000 cmd ff 00000000 32bit x 16 bit
fwc addr fc000000 cmd f0 00000000 32bit x 16 bit
fwc addr fc000154 cmd 98 00000000 32bit x 16 bit
is= cmd 51(Q) addr fc000040 is= ffffffff 00000000
fwc addr fc001554 cmd 98 00000000 32bit x 16 bit
is= cmd 51(Q) addr fc000040 is= ffffffff 00000000
fwc addr fc000000 cmd ff 00000000 32bit x 32 bit
fwc addr fc000000 cmd f0 00000000 32bit x 32 bit
fwc addr fc000154 cmd 98 00000000 32bit x 32 bit
is= cmd 51(Q) addr fc000040 is= ffffffff 00000000
fwc addr fc001554 cmd 98 00000000 32bit x 32 bit
is= cmd 51(Q) addr fc000040 is= ffffffff 00000000
fwrite addr fc000000 cmd ff ff00ff00ff00ff00 64 bit x 8 bit
fwrite addr fc000000 cmd f0 f000f000f000f000 64 bit x 8 bit
fwrite addr fc0002a8 cmd 98 9800980098009800 64 bit x 8 bit
is= cmd 51(Q) addr fc000080 is= ffffffffffffffff 5100510051005100
fwrite addr fc002aa8 cmd 98 9800980098009800 64 bit x 8 bit
is= cmd 51(Q) addr fc000080 is= ffffffffffffffff 5100510051005100
fwrite addr fc000000 cmd ff 0000000000000000 64 bit x 16 bit
fwrite addr fc000000 cmd f0 0000000000000000 64 bit x 16 bit
fwrite addr fc0002a8 cmd 98 0000000000000000 64 bit x 16 bit
is= cmd 51(Q) addr fc000080 is= ffffffffffffffff 0000000000000000
fwrite addr fc002aa8 cmd 98 0000000000000000 64 bit x 16 bit
is= cmd 51(Q) addr fc000080 is= ffffffffffffffff 0000000000000000
fwrite addr fc000000 cmd ff 0000000000000000 64 bit x 32 bit
fwrite addr fc000000 cmd f0 0000000000000000 64 bit x 32 bit
fwrite addr fc0002a8 cmd 98 0000000000000000 64 bit x 32 bit
is= cmd 51(Q) addr fc000080 is= ffffffffffffffff 0000000000000000
fwrite addr fc002aa8 cmd 98 0000000000000000 64 bit x 32 bit
is= cmd 51(Q) addr fc000080 is= ffffffffffffffff 0000000000000000
fwrite addr fc000000 cmd ff 0000000000000000 64 bit x 64 bit
fwrite addr fc000000 cmd f0 0000000000000000 64 bit x 64 bit
fwrite addr fc0002a8 cmd 98 0000000000000000 64 bit x 64 bit
is= cmd 51(Q) addr fc000080 is= ffffffffffffffff 0000000000000000
fwrite addr fc002aa8 cmd 98 0000000000000000 64 bit x 64 bit
is= cmd 51(Q) addr fc000080 is= ffffffffffffffff 0000000000000000
not found
## Unknown FLASH on Bank 1 - Size = 0x00000000 = 0 MB
flash_protect ON: from 0xFFFC0000 to 0xFFFE81FF
flash_protect ON: from 0xFFFA0000 to 0xFFFBFFFF
*** failed ***
### ERROR ### Please RESET the board ###

--------

>> For slow devices, the memory controller is usually setup to use the GPCM.
Check your options and base registers
>> (OR0 and BR0).
What is GPCM? Which source/header file I need to check for these settings.?

>>You mention different size.. is the port size different too?
I think u-boot takes care of port size as if we do not define the port size
then u-boot search with all possible port size.
BTW how I can cross-check the port size?

For M29W128GH I have to do some code fixup from patch suggested by Stefan.
Is there any special code fixup is required for S29GL512P flash chip
support?

Thanks & Regards,
Prakash


On Fri, Apr 9, 2010 at 6:57 PM, Frank Svendsb?e
<frank.svendsboe@gmail.com>wrote:

> > I am using PPC440x5 Cpu core. How to check the chip-select flash is
> using?
> > Earlier I have run the same code for M29W128GH and it works fine. But
> with
> > S29GL512 it is not working.
> > Now the difference is only in size and write/read timings. So I believe
> it
> > should work in smooth manner.
> >
>
> Hmm.. If you're supposed to boot from this device, then I assume the
> flash is connected to CS0.For slow devices, the memory controller is
> usually setup to use the GPCM. Check your options and base registers
> (OR0 and BR0). Everything related to timing (for GPCM controlled
> devices) is done in these two registers.
>
> If you have a BDI JTAG, you can set these registers using that and try
> to perform flash operations from here. Again, if you can, try to
> access the flash using the JTAG before experimenting with U-Boot.
>
> You mention different size.. is the port size different too?
>
> In order to help you, I think the community needs more info about your
> system. Stefan asked for logs, etc.
>
> Regards,
> Frank
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09 13:35               ` Stefan Roese
@ 2010-04-12  4:18                 ` prakash bedge
  2010-04-12  7:59                   ` Stefan Roese
  0 siblings, 1 reply; 31+ messages in thread
From: prakash bedge @ 2010-04-12  4:18 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

>> Right. Most likely you just need to tune the chip select timing registers
And of course the size of the CS.
What mean by size of CS? Which file I should check for timing register for
S29GL512P?
>> BTW: You might also need to configure a bigger TLB entry for the FLASH
now that you use a bigger FLASH chip.
Does uboot support one single TLB entry for 64MB size. At pesent I have
configured 4 TLB entries, each 16MB.

On Fri, Apr 9, 2010 at 7:05 PM, Stefan Roese <sr@denx.de> wrote:

> Hi Prakash,
>
> On Friday 09 April 2010 14:11:39 prakash bedge wrote:
> > >> What CPU are you using, and what chip-select is the flash using?
> >
> > I am using PPC440x5 Cpu core. How to check the chip-select flash is
> using?
>
> This is a custom PPC4xx version, correct? Which external bus controller is
> used here? The EBC from IBM as on the AMCC 4xx versions? You need to check
> your SoC documentation for this.
>
> > Earlier I have run the same code for M29W128GH and it works fine. But
> with
> > S29GL512 it is not working.
> > Now the difference is only in size and write/read timings. So I believe
> it
> > should work in smooth manner.
>
> Right. Most likely you just need to tune the chip select timing registers.
> And
> of course the size of the CS. No idea how this is done for your external
> bus
> controller though.
>
> BTW: You might also need to configure a bigger TLB entry for the FLASH now
> that you use a bigger FLASH chip.
>
> > kilauea.h file is present in the U-boot.
> > So does this board supports S29GL512P Nor flash chip?
>
> Yes. As most AMCC eval boards do.
>
> Cheers,
> Stefan
>
> --
> DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-12  4:18                 ` prakash bedge
@ 2010-04-12  7:59                   ` Stefan Roese
  0 siblings, 0 replies; 31+ messages in thread
From: Stefan Roese @ 2010-04-12  7:59 UTC (permalink / raw)
  To: u-boot

On Monday 12 April 2010 06:18:12 prakash bedge wrote:
> >> Right. Most likely you just need to tune the chip select timing
> >> registers
> 
> And of course the size of the CS.
> What mean by size of CS? Which file I should check for timing register for
> S29GL512P?

IIRC, then you have a custom PPC440 SoC. I have no idea which external bus 
controller (EBC) is used on your SoC. Is it the one also used on the 
AppliedMicro (AMCC) PPC4xx? Then you need to change the CONFIG_SYS_EBC_PBxCR / 
CONFIG_SYS_EBC_PBxAP defines. Take a look at the users manual for details. If 
you have a different EBC then I can't really help you here. Your SoC 
documentation should have all details you need.
 
> >> BTW: You might also need to configure a bigger TLB entry for the FLASH
> 
> now that you use a bigger FLASH chip.
> Does uboot support one single TLB entry for 64MB size. At pesent I have
> configured 4 TLB entries, each 16MB.

Looking into the PPC440 users manual makes it clear. 64MByte as TLB size is 
not available. You need to define 4 16MB entries for this.

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-12  4:13                 ` prakash bedge
@ 2010-04-12 17:01                   ` Frank Svendsbøe
  2010-04-12 17:15                   ` Frank Svendsbøe
  1 sibling, 0 replies; 31+ messages in thread
From: Frank Svendsbøe @ 2010-04-12 17:01 UTC (permalink / raw)
  To: u-boot

>>> For slow devices, the memory controller is usually setup to use the GPCM.
>>> Check your options and base registers
>>> (OR0 and BR0).
> What is GPCM? Which source/header file I need to check for these settings.?
>

Hi Prakash, I didn't know that a IBM PPC440 CPU didn't contain an
embedded memory controller. I assumed it did and therefore mentioned
the GPCM (General Purpose Chip Select Machine - Terminology used on
Freescale SoCs). Since your controller is obviously external/custom,
it's hard to help you.

>>>You mention different size.. is the port size different too?
> I think u-boot takes care of port size as if we do not define the port size
> then u-boot search with all possible port size.
> BTW how?I can cross-check the port size?
>

Hmm.. As I don't have a 440 system, it's hard to tell. But on other
systems, the port-size is programmed for each chip-select, and tells
the memory controller the supported bus width connected to each device
for a given chip-select.

> For M29W128GH I have to do some code fixup from patch suggested by Stefan.
> Is there any special?code fixup is required for S29GL512P flash chip
> support?

As I mentioned before, we didn't do anything special in order to get
S29GL512P working for our board.

Best regards,
Frank

>
> Thanks & Regards,
> Prakash
>
>
> On Fri, Apr 9, 2010 at 6:57 PM, Frank Svendsb?e <frank.svendsboe@gmail.com>
> wrote:
>>
>> > I am using PPC440x5 Cpu core. How to check the chip-select flash is
>> > using?
>> > Earlier I have run the same code for M29W128GH and it works fine. But
>> > with
>> > S29GL512 it is not working.
>> > Now the difference is only in size and write/read timings. So I believe
>> > it
>> > should work in smooth manner.
>> >
>>
>> Hmm.. If you're supposed to boot from this device, then I assume the
>> flash is connected to CS0.For slow devices, the memory controller is
>> usually setup to use the GPCM. Check your options and base registers
>> (OR0 and BR0). Everything related to timing (for GPCM controlled
>> devices) is done in these two registers.
>>
>> If you have a BDI JTAG, you can set these registers using that and try
>> to perform flash operations from here. Again, if you can, try to
>> access the flash using the JTAG before experimenting with U-Boot.
>>
>> You mention different size.. is the port size different too?
>>
>> In order to help you, I think the community needs more info about your
>> system. Stefan asked for logs, etc.
>>
>> Regards,
>> Frank
>
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-12  4:13                 ` prakash bedge
  2010-04-12 17:01                   ` Frank Svendsbøe
@ 2010-04-12 17:15                   ` Frank Svendsbøe
  2010-04-13  6:31                     ` prakash bedge
  1 sibling, 1 reply; 31+ messages in thread
From: Frank Svendsbøe @ 2010-04-12 17:15 UTC (permalink / raw)
  To: u-boot

> ## Unknown FLASH on Bank 1 - Size = 0x00000000 = 0 MB
> flash_protect ON: from 0xFFFC0000 to 0xFFFE81FF
> flash_protect ON: from 0xFFFA0000 to 0xFFFBFFFF
> *** failed ***
> ### ERROR ### Please RESET the board ###
>

This is just a wild guess. Check that your memory controller setup is
correct. Since you've changed your flash size, you might have a
corrupt memory controller setup. On our Freescale system, we initially
had problems when increasing flash size due to where we've decided to
put the internal space base / memory map (ISB/IMM). When changing the
size, we had to move the IMM to a lower address (.ie at least a sector
below 0xfc000000).

Best regards,
Frank

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-12 17:15                   ` Frank Svendsbøe
@ 2010-04-13  6:31                     ` prakash bedge
  2010-04-13  8:34                       ` Stefan Roese
  0 siblings, 1 reply; 31+ messages in thread
From: prakash bedge @ 2010-04-13  6:31 UTC (permalink / raw)
  To: u-boot

Hi All,

I did it. :)

I am now able to detect the flash. So now I can run the uboot commnads i.e
flinfo to check the flash information.
For this I make use of ST fixup code for M29W128GH in which I changed the
codition for chekcing chipwidth.

 To detect the flash I used chipwidth 16 Bits and Portwidth 8 Bits.

But now I am getting the problem in erasing on flash. I gave the erase
command to erase the sector but then the sector is not getting erased and I
am getting the message as flash erased. Same is for chip erase command. See
the log below

DRAM:   2 MB
Top of RAM usable for U-Boot at: 00200000
Reserving 177k for U-Boot at: 001d3000
Reserving 1040k for malloc() at: 000cf000
Reserving 128 Bytes for Board Info at: 000cef80
Reserving 56 Bytes for Global Data at: 000cef48
Stack Pointer at: 000cef28
New Stack Pointer is: 000cef28
Now running in RAM - U-Boot at: 001d3000
FLASH: flash detect cfi
fwc addr fc000000 cmd ff ff 8bit x 8 bit
fwc addr fc000000 cmd f0 f0 8bit x 8 bit
total bank size in bytes 0
number of erase units 0
combined device & manufacturer code 65535
maximum block erase timeout 0
maximum write timeout 0
manufacturer_id 0
the width of the port 1
the width of the chip 1
fwc addr fc000055 cmd 98 98 8bit x 8 bit
is= cmd 51(Q) addr fc000010 is= ff 51
is= cmd 52(R) addr fc000011 is= ff 52
is= cmd 59(Y) addr fc000012 is= ff 59
fwc addr fc000555 cmd 98 98 8bit x 8 bit
is= cmd 51(Q) addr fc000010 is= ff 51
is= cmd 52(R) addr fc000011 is= ff 52
is= cmd 59(Y) addr fc000012 is= ff 59
fwc addr fc000000 cmd ff ff00 16bit x 8 bit
fwc addr fc000000 cmd f0 f000 16bit x 8 bit
total bank size in bytes 0
number of erase units 0
combined device & manufacturer code 65535
maximum block erase timeout 0
maximum write timeout 0
manufacturer_id 0
the width of the port 2
the width of the chip 1
*fwc addr fc0000aa cmd 98 9800 16bit x 8 bit*
is= cmd 51(Q) addr fc000020 is= 5100 5100
device interface is 2
*found port 2 chip 1 port 16 bits chip 8 bits
00 : 51 52 59 02 00 40 00 00 00 00 00 27 36 00 00 06
**QRY.. at .....'6*<QRY..@.....'6>
*...
10 : 06 09 13 03 05 03 02 1a 02 00 06 00 01 ff 01 00  ................
20 : 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20  ...............*
fwc addr fc000000 cmd f0 f000 16bit x 8 bit
fwc addr fc001554 cmd aa aa00 16bit x 8 bit
fwc addr fc000aaa cmd 55 5500 16bit x 8 bit
fwc addr fc001554 cmd 90 9000 16bit x 8 bit
fwc addr fc000000 cmd f0 f000 16bit x 8 bit
fwc addr fc0000aa cmd 98 9800 16bit x 8 bit
manufacturer is 2
manufacturer id is 0xff
device id is 0xff
device id2 is 0x0
cfi version is 0x3133
*size_ratio 1 port 16 bits chip 8 bits
*found 1 erase regions
erase region 0: 0x020001ff
erase_region_count = 512 erase_region_size = 131072
fwc addr fc000000 cmd f0 f0 8bit x 8 bit
flash_protect ON: from 0xFFFC0000 to 0xFFFE89FF
protect on 510
protect on 511
flash_protect ON: from 0xFFFA0000 to 0xFFFBFFFF
protect on 509
*64 MB*
*** Warning - bad CRC, using default environment
In:    serial
Out:   serial
Err:   serial
U-Boot relocated to 001d3000
Install interrupt vector 1
Install interrupt vector 0
Install interrupt vector 3
Install interrupt vector 2
### main_loop entered: bootdelay=5
### main_loop: bootcmd="bootm 0xffdc0000 0xff8c0000 0xff200000"
Hit any key to stop autoboot:  5 0
U-Boot $  flinfo
Bank # 1: CFI conformant FLASH (8 x 8)  Size: 64 MB in 512 Sectors
  AMD Standard command set, Manufacturer ID: 0xFF, Device ID: 0xFF
  Erase timeout: 4096 ms, write timeout: 1 ms
  Buffer write timeout: 3 ms, buffer size: 64 bytes
  Sector Start Addresses:
  FC000000 E      FC020000 E      FC040000 E      FC060000 E      FC080000
E
  FC0A0000 E      FC0C0000 E      FC0E0000 E      FC100000 E      FC120000
E
  FC140000 E      FC160000 E      FC180000 E      FC1A0000 E      FC1C0000
E
  FC1E0000 E      FC200000 E      FC220000 E      FC240000 E      FC260000
E
  FC280000 E      FC2A0000 E      FC2C0000 E      FC2E0000 E      FC300000
E
  FC320000 E      FC340000 E      FC360000 E      FC380000 E      FC3A0000
E
  FC3C0000 E      FC3E0000 E      FC400000 E      FC420000 E      FC440000
E
  FC460000 E      FC480000 E      FC4A0000 E      FC4C0000 E      FC4E0000
E
  FC500000 E      FC520000 E      FC540000 E      FC560000 E      FC580000
E
  FC5A0000 E      FC5C0000 E      FC5E0000 E      FC600000 E      FC620000
E
  FC640000 E      FC660000 E      FC680000 E      FC6A0000 E      FC6C0000
E
  FC6E0000 E      FC700000 E      FC720000 E      FC740000 E      FC760000
E
  FC780000 E      FC7A0000 E      FC7C0000        FC7E0000        FC800000
E
  FC820000 E      FC840000 E      FC860000 E      FC880000 E      FC8A0000
E
  FC8C0000 E      FC8E0000 E      FC900000 E      FC920000 E      FC940000
E
  FC960000 E      FC980000 E      FC9A0000 E      FC9C0000 E      FC9E0000
E
  FCA00000 E      FCA20000 E      FCA40000 E      FCA60000 E      FCA80000
E
  FCAA0000 E      FCAC0000 E      FCAE0000 E      FCB00000 E      FCB20000
E
  FCB40000 E      FCB60000 E      FCB80000 E      FCBA0000 E      FCBC0000
E
  FCBE0000 E      FCC00000 E      FCC20000 E      FCC40000 E      FCC60000
E
  FCC80000 E      FCCA0000 E      FCCC0000 E      FCCE0000 E      FCD00000
E
  FCD20000 E      FCD40000 E      FCD60000 E      FCD80000 E      FCDA0000
E
  FCDC0000 E      FCDE0000 E      FCE00000 E      FCE20000 E      FCE40000
E
  FCE60000 E      FCE80000 E      FCEA0000 E      FCEC0000 E      FCEE0000
E
  FCF00000 E      FCF20000 E      FCF40000 E      FCF60000 E      FCF80000
E
  FCFA0000 E      FCFC0000        FCFE0000        FD000000 E      FD020000
E
  FD040000 E      FD060000 E      FD080000 E      FD0A0000 E      FD0C0000
E
  FD0E0000 E      FD100000 E      FD120000 E      FD140000 E      FD160000
E
  FD180000 E      FD1A0000 E      FD1C0000 E      FD1E0000 E      FD200000
E
  FD220000 E      FD240000 E      FD260000 E      FD280000 E      FD2A0000
E
  FD2C0000 E      FD2E0000 E      FD300000 E      FD320000 E      FD340000
E
  FD360000 E      FD380000 E      FD3A0000 E      FD3C0000 E      FD3E0000
E
  FD400000 E      FD420000 E      FD440000 E      FD460000 E      FD480000
E
  FD4A0000 E      FD4C0000 E      FD4E0000 E      FD500000 E      FD520000
E
  FD540000 E      FD560000 E      FD580000 E      FD5A0000 E      FD5C0000
E
  FD5E0000 E      FD600000 E      FD620000 E      FD640000 E      FD660000
E
  FD680000 E      FD6A0000 E      FD6C0000 E      FD6E0000 E      FD700000
E
  FD720000 E      FD740000 E      FD760000 E      FD780000 E      FD7A0000
E
  FD7C0000        FD7E0000        FD800000 E      FD820000 E      FD840000
E
  FD860000 E      FD880000 E      FD8A0000 E      FD8C0000 E      FD8E0000
E
  FD900000 E      FD920000 E      FD940000 E      FD960000 E      FD980000
E
  FD9A0000 E      FD9C0000 E      FD9E0000 E      FDA00000 E      FDA20000
E
  FDA40000 E      FDA60000 E      FDA80000 E      FDAA0000 E      FDAC0000
E
  FDAE0000 E      FDB00000 E      FDB20000 E      FDB40000 E      FDB60000
E
  FDB80000 E      FDBA0000 E      FDBC0000 E      FDBE0000 E      FDC00000
E
  FDC20000 E      FDC40000 E      FDC60000 E      FDC80000 E      FDCA0000
E
  FDCC0000 E      FDCE0000 E      FDD00000 E      FDD20000 E      FDD40000
E
  FDD60000 E      FDD80000 E      FDDA0000 E      FDDC0000 E      FDDE0000
E
  FDE00000 E      FDE20000 E      FDE40000 E      FDE60000 E      FDE80000
E
  FDEA0000 E      FDEC0000 E      FDEE0000 E      FDF00000 E      FDF20000
E
  FDF40000 E      FDF60000 E      FDF80000 E      FDFA0000 E
FDFC0000
  FDFE0000        FE000000 E      FE020000 E      FE040000 E      FE060000
E
  FE080000 E      FE0A0000 E      FE0C0000 E      FE0E0000 E      FE100000
E
  FE120000 E      FE140000 E      FE160000 E      FE180000 E      FE1A0000
E
  FE1C0000 E      FE1E0000 E      FE200000 E      FE220000 E      FE240000
E
  FE260000 E      FE280000 E      FE2A0000 E      FE2C0000 E      FE2E0000
E
  FE300000 E      FE320000 E      FE340000 E      FE360000 E      FE380000
E
  FE3A0000 E      FE3C0000 E      FE3E0000 E      FE400000 E      FE420000
E
  FE440000 E      FE460000 E      FE480000 E      FE4A0000 E      FE4C0000
E
  FE4E0000 E      FE500000 E      FE520000 E      FE540000 E      FE560000
E
  FE580000 E      FE5A0000 E      FE5C0000 E      FE5E0000 E      FE600000
E
  FE620000 E      FE640000 E      FE660000 E      FE680000 E      FE6A0000
E
  FE6C0000 E      FE6E0000 E      FE700000 E      FE720000 E      FE740000
E
  FE760000 E      FE780000 E      FE7A0000 E      FE7C0000
FE7E0000
  FE800000 E      FE820000 E      FE840000 E      FE860000 E      FE880000
E
  FE8A0000 E      FE8C0000 E      FE8E0000 E      FE900000 E      FE920000
E
  FE940000 E      FE960000 E      FE980000 E      FE9A0000 E      FE9C0000
E
  FE9E0000 E      FEA00000 E      FEA20000 E      FEA40000 E      FEA60000
E
  FEA80000 E      FEAA0000 E      FEAC0000 E      FEAE0000 E      FEB00000
E
  FEB20000 E      FEB40000 E      FEB60000 E      FEB80000 E      FEBA0000
E
  FEBC0000 E      FEBE0000 E      FEC00000 E      FEC20000 E      FEC40000
E
  FEC60000 E      FEC80000 E      FECA0000 E      FECC0000 E      FECE0000
E
  FED00000 E      FED20000 E      FED40000 E      FED60000 E      FED80000
E
  FEDA0000 E      FEDC0000 E      FEDE0000 E      FEE00000 E      FEE20000
E
  FEE40000 E      FEE60000 E      FEE80000 E      FEEA0000 E      FEEC0000
E
  FEEE0000 E      FEF00000 E      FEF20000 E      FEF40000 E      FEF60000
E
  FEF80000 E      FEFA0000 E      FEFC0000        FEFE0000        FF000000
E
  FF020000 E      FF040000 E      FF060000 E      FF080000 E      FF0A0000
E
  FF0C0000 E      FF0E0000 E      FF100000 E      FF120000 E      FF140000
E
  FF160000 E      FF180000 E      FF1A0000 E      FF1C0000 E      FF1E0000
E
  FF200000 E      FF220000 E      FF240000 E      FF260000 E      FF280000
E
  FF2A0000 E      FF2C0000 E      FF2E0000 E      FF300000 E      FF320000
E
  FF340000 E      FF360000 E      FF380000 E      FF3A0000 E      FF3C0000
E
  FF3E0000 E      FF400000 E      FF420000 E      FF440000 E      FF460000
E
  FF480000 E      FF4A0000 E      FF4C0000 E      FF4E0000 E      FF500000
E
  FF520000 E      FF540000 E      FF560000 E      FF580000 E      FF5A0000
E
  FF5C0000 E      FF5E0000 E      FF600000 E      FF620000 E      FF640000
E
  FF660000 E      FF680000 E      FF6A0000 E      FF6C0000 E      FF6E0000
E
  FF700000 E      FF720000 E      FF740000 E      FF760000 E      FF780000
E
  FF7A0000 E      FF7C0000        FF7E0000        FF800000 E      FF820000
E
  FF840000 E      FF860000 E      FF880000 E      FF8A0000 E      FF8C0000
E
  FF8E0000 E      FF900000 E      FF920000 E      FF940000 E      FF960000
E
  FF980000 E      FF9A0000 E      FF9C0000 E      FF9E0000 E      FFA00000
E
  FFA20000 E      FFA40000 E      FFA60000 E      FFA80000 E      FFAA0000
E
  FFAC0000 E      FFAE0000 E      FFB00000 E      FFB20000 E      FFB40000
E
  FFB60000 E      FFB80000 E      FFBA0000 E      FFBC0000 E      FFBE0000
E
  FFC00000 E      FFC20000 E      FFC40000 E      FFC60000 E      FFC80000
E
  FFCA0000 E      FFCC0000 E      FFCE0000 E      FFD00000 E      FFD20000
E
  FFD40000 E      FFD60000 E      FFD80000 E      FFDA0000 E      FFDC0000
E
  FFDE0000 E      FFE00000 E      FFE20000 E      FFE40000 E      FFE60000
E
  FFE80000 E      FFEA0000 E      FFEC0000 E      FFEE0000 E      FFF00000
E
  FFF20000 E      FFF40000 E      FFF60000 E      FFF80000 E      FFFA0000 E
RO
  FFFC0000   RO   FFFE0000   RO

U-Boot $  *saveenv*
Saving Environment to Flash...
copy old content: sect_addr: FFFA0000  env_addr: FFFA0000  offset: 00000000
Protect off FFFA0000 ... FFFBFFFF
Un-Protecting sectors 509..509 in bank 1
Un-Protected 1 sectors
*Erasing Flash...Erase Flash from 0xfffa0000 to 0xfffbffff in Bank # 1*
fwc addr fffa0aaa cmd aa aa 8bit x 8 bit
fwc addr fffa0555 cmd 55 55 8bit x 8 bit
fwc addr fffa0aaa cmd 80 80 8bit x 8 bit
fwc addr fffa0aaa cmd aa aa 8bit x 8 bit
fwc addr fffa0555 cmd 55 55 8bit x 8 bit
fwc addr fffa0000 cmd 30 30 8bit x 8 bit
*flash_is_busy: 0
. done*
*Erased 1 sectors
Writing to Flash... Flash not Erased*
Protecting sectors 509..509 in bank 1
Protected 1 sectors
U-Boot $

Also, even by using BDI 3000 Debugger, I am not able to erase the flash by
giving the proper CFI erase command.

mmb 0xfc000000 0xf0
 mmb 0xfc000aaa 0xaa
 mmb 0xfc000555 0x55
mmb 0xfc000aaa 0x80
mmb 0xfc000aaa 0xaa
mmb 0xfc000555 0x55
mmb 0xff7c0000  0x30

But the data is still present.

What may be the reason that flash in not getting erased using U-boot as well
as BDI debugger?


Thanks & Regards,
Prakash

On Mon, Apr 12, 2010 at 10:45 PM, Frank Svendsb?e <frank.svendsboe@gmail.com
> wrote:

> > ## Unknown FLASH on Bank 1 - Size = 0x00000000 = 0 MB
> > flash_protect ON: from 0xFFFC0000 to 0xFFFE81FF
> > flash_protect ON: from 0xFFFA0000 to 0xFFFBFFFF
> > *** failed ***
> > ### ERROR ### Please RESET the board ###
> >
>
> This is just a wild guess. Check that your memory controller setup is
> correct. Since you've changed your flash size, you might have a
> corrupt memory controller setup. On our Freescale system, we initially
> had problems when increasing flash size due to where we've decided to
> put the internal space base / memory map (ISB/IMM). When changing the
> size, we had to move the IMM to a lower address (.ie at least a sector
> below 0xfc000000).
>
> Best regards,
> Frank
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-13  6:31                     ` prakash bedge
@ 2010-04-13  8:34                       ` Stefan Roese
  2010-04-13 11:46                         ` prakash bedge
  0 siblings, 1 reply; 31+ messages in thread
From: Stefan Roese @ 2010-04-13  8:34 UTC (permalink / raw)
  To: u-boot

On Tuesday 13 April 2010 08:31:59 prakash bedge wrote:
> I did it. :)

Good. But what did you change to make it work?
 
> I am now able to detect the flash. So now I can run the uboot commnads i.e
> flinfo to check the flash information.
> For this I make use of ST fixup code for M29W128GH in which I changed the
> codition for chekcing chipwidth.

Are you not using the mainline version of cfi_flash.c? If not, which "fixup 
code" are you referring to (link)?

>  To detect the flash I used chipwidth 16 Bits and Portwidth 8 Bits.

Just checking to be sure: Are you using the Spansion chip in byte (8bit) or 
word (16bit) mode? All configurations I have used till now use the word mode 
with this chip.

And you really use 8 bit portwidth to access this chip in your SoC?
 
> But now I am getting the problem in erasing on flash. I gave the erase
> command to erase the sector but then the sector is not getting erased and I
> am getting the message as flash erased. Same is for chip erase command. See
> the log below

<snip>

> U-Boot $  *saveenv*
> Saving Environment to Flash...
> copy old content: sect_addr: FFFA0000  env_addr: FFFA0000  offset: 00000000
> Protect off FFFA0000 ... FFFBFFFF
> Un-Protecting sectors 509..509 in bank 1
> Un-Protected 1 sectors
> *Erasing Flash...Erase Flash from 0xfffa0000 to 0xfffbffff in Bank # 1*
> fwc addr fffa0aaa cmd aa aa 8bit x 8 bit
> fwc addr fffa0555 cmd 55 55 8bit x 8 bit
> fwc addr fffa0aaa cmd 80 80 8bit x 8 bit
> fwc addr fffa0aaa cmd aa aa 8bit x 8 bit
> fwc addr fffa0555 cmd 55 55 8bit x 8 bit
> fwc addr fffa0000 cmd 30 30 8bit x 8 bit
> *flash_is_busy: 0
>  done*
> *Erased 1 sectors
> Writing to Flash... Flash not Erased*
> Protecting sectors 509..509 in bank 1
> Protected 1 sectors
> U-Boot $
> 
> Also, even by using BDI 3000 Debugger, I am not able to erase the flash by
> giving the proper CFI erase command.
> 
> mmb 0xfc000000 0xf0
>  mmb 0xfc000aaa 0xaa
>  mmb 0xfc000555 0x55
> mmb 0xfc000aaa 0x80
> mmb 0xfc000aaa 0xaa
> mmb 0xfc000555 0x55
> mmb 0xff7c0000  0x30
> 
> But the data is still present.
> 
> What may be the reason that flash in not getting erased using U-boot as
> well as BDI debugger?

Hard to tell. Perhaps still a problem of a misconfigured external bus? Perhaps 
a problem of incorrect unlocking addresses (byte vs. word address)?

How did you program the U-Boot image into FLASH? Via the BDI3000 "prog" 
command? Is this working correctly?

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-13  8:34                       ` Stefan Roese
@ 2010-04-13 11:46                         ` prakash bedge
  2010-04-13 12:16                           ` Stefan Roese
  0 siblings, 1 reply; 31+ messages in thread
From: prakash bedge @ 2010-04-13 11:46 UTC (permalink / raw)
  To: u-boot

Hi Stefan,
>> Are you not using the mainline version of cfi_flash.c? If not, which
"fixup
>> code" are you referring to (link)?
I am using U-Boot 2009.08 version.
I used the fixup for M29W128GH chip from the patch you suggested earlier. In
that code, I changed the condition to check chipwidth and it works.

But I have a concern now, as it works with by changing chipwidth to 16Bit or
portwidth to 16Bit. This is making me a little bit confuse.
 if(info->chipwidth == FLASH_CFI_16BIT)
  info->portwidth = FLASH_CFI_8BIT;

if(info->chipwidth == FLASH_CFI_8BIT)
info->portwidth = FLASH_CFI_16BIT;

Can you please tell what is chipwidth and portwidth and how we can find
that?

Also I am not getting the correct manufacturer and device ids.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-13 11:46                         ` prakash bedge
@ 2010-04-13 12:16                           ` Stefan Roese
  2010-04-14  5:03                             ` prakash bedge
  0 siblings, 1 reply; 31+ messages in thread
From: Stefan Roese @ 2010-04-13 12:16 UTC (permalink / raw)
  To: u-boot

Hi Prakash,

On Tuesday 13 April 2010 13:46:11 prakash bedge wrote:
> >> Are you not using the mainline version of cfi_flash.c? If not, which
> >> "fixup code" are you referring to (link)?
> 
> I am using U-Boot 2009.08 version.

This version is outdated. I suggest to switch to current code.

> I used the fixup for M29W128GH chip from the patch you suggested earlier.
> In that code, I changed the condition to check chipwidth and it works.

You shouldn't need any additional code to support the Spansion S29GL chips. 
Please use the latest code from mainline U-Boot.
 
> But I have a concern now, as it works with by changing chipwidth to 16Bit
> or portwidth to 16Bit. This is making me a little bit confuse.
>  if(info->chipwidth == FLASH_CFI_16BIT)
>   info->portwidth = FLASH_CFI_8BIT;
> 
> if(info->chipwidth == FLASH_CFI_8BIT)
> info->portwidth = FLASH_CFI_16BIT;

???
 
> Can you please tell what is chipwidth and portwidth and how we can find
> that?

chipwidth: Width of the NOR FLASH chip, meaning count of data lines
	actively used.

portwidth: Width of the external bus (data lines).
 
> Also I am not getting the correct manufacturer and device ids.
> 
> From the flash control register I can see that my device is 16 Bit.It
> reprsent a bit set 1 saying it is a 16 bit device.
> Now is this flash chipwidth or flash portwidth?

chipwidth.
 
> To my flash chip 16 data lines and 26 address lines are connected.

So you have chipwidth *and* portwidth of 16! This is the most common use case. 
Again, please use the mainline CFI driver and give it another try.
 
> >> Perhaps a problem of incorrect unlocking addresses (byte vs. word
> 
> address)?
> Does it mean that unlocking addresses are not correct?
> Supoose if chip is in word mode then what should be the portwidth and
> chipwidth? What will be the ublocking address then?
> 
> I am using an utilty to erase flash and to load uboot image and it is
> working fine, only that it copies data at multple locations.

What kind of "utility"? Don't you use the BDI3000 for FLASH programming? This 
mirroring might a a result of an incorrect EBC setup.

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-13 12:16                           ` Stefan Roese
@ 2010-04-14  5:03                             ` prakash bedge
  2010-04-14  7:38                               ` Frank Svendsbøe
  2010-04-14 12:05                               ` Stefan Roese
  0 siblings, 2 replies; 31+ messages in thread
From: prakash bedge @ 2010-04-14  5:03 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

Does the latest code supports S29GL512P chip, since I am not seeing any
instance of this chip in 2010.03 uboot code.

>>So you have chipwidth *and* portwidth of 16! This is the most common use
case.
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?

>> 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.

I replaced the cfi_flash.c with the new cfi_flash.c file from latest uboot
version 2010.03 and done relevant changes. But still I didn't get the
postive result. Is there anything else that I have to check, or by using
only cfi_flash.c and cfi_flash.h from 2010.03 uboot code CFI flash driver
will work?

I can not use the latest code but I want the CFI support for S29GL512P.
Can you please tell that, what I need to do to make the CFI driver works for
the S29GL512P chip?

>> What kind of "utility"? Don't you use the BDI3000 for FLASH programming?
We have customized utility to flash the binary. Using BDI3000 I tried to
erase the flash but it didn't work. I followed the CFI erase command seuence
but it fails to erase the flash.
BDI3000>md 0xfe7c0000
fe7c0000 : 27051956 552d426f 6f742032 3030392e  '..VU-Boot 2009.
fe7c0010 : 30382028 41707220 31342032 30313020  08 (Apr 14 2010
fe7c0020 : 2d203130 3a30313a 32392900 00000000  - 10:01:29).....
fe7c0030 : 00000000 00000000 00000000 00000000  ................
fe7c0040 : 00000000 00000000 00000000 00000000  ................
fe7c0050 : 00000000 00000000 00000000 00000000  ................
fe7c0060 : 00000000 00000000 00000000 00000000  ................
fe7c0070 : 00000000 00000000 00000000 00000000  ................
fe7c0080 : 00000000 00000000 00000000 00000000  ................
fe7c0090 : 00000000 00000000 00000000 00000000  ................
fe7c00a0 : 00000000 00000000 00000000 00000000  ................
fe7c00b0 : 00000000 00000000 00000000 00000000  ................
fe7c00c0 : 00000000 00000000 00000000 00000000  ................
fe7c00d0 : 00000000 00000000 00000000 00000000  ................
fe7c00e0 : 00000000 00000000 00000000 00000000  ................
fe7c00f0 : 00000000 00000000 00000000 00000000  ................
*BDI3000>mmb 0xfc000000 0xf0
BDI3000>mmb 0xfc000aaa 0xaa
BDI3000>mmb 0xfc000555 0x55
BDI3000>mmb 0xfc000aaa 0x80
BDI3000>mmb 0xfc000aaa 0xaa
BDI3000>mmb 0xfc000555 0x55
BDI3000>mmb 0xfe7c0000 0x30
*BDI3000>mmb 0xfc000000 0xf0
BDI3000>md 0xfe7c0000 -- *sector data is not erased
*fe7c0000 : 30051956 552d426f 6f742032 3030392e  0..VU-Boot 2009.
fe7c0010 : 30382028 41707220 31342032 30313020  08 (Apr 14 2010
fe7c0020 : 2d203130 3a30313a 32392900 00000000  - 10:01:29).....
fe7c0030 : 00000000 00000000 00000000 00000000  ................
fe7c0040 : 00000000 00000000 00000000 00000000  ................
fe7c0050 : 00000000 00000000 00000000 00000000  ................
fe7c0060 : 00000000 00000000 00000000 00000000  ................
fe7c0070 : 00000000 00000000 00000000 00000000  ................
fe7c0080 : 00000000 00000000 00000000 00000000  ................
fe7c0090 : 00000000 00000000 00000000 00000000  ................
fe7c00a0 : 00000000 00000000 00000000 00000000  ................
fe7c00b0 : 00000000 00000000 00000000 00000000  ................
fe7c00c0 : 00000000 00000000 00000000 00000000  ................
fe7c00d0 : 00000000 00000000 00000000 00000000  ................
fe7c00e0 : 00000000 00000000 00000000 00000000  ................
fe7c00f0 : 00000000 00000000 00000000 00000000  ................
BDI3000>mmb 0xfc000000 0xf0
BDI3000>mmb 0xfc0000aa 0x98
BDI3000>md 0xfc000020
fc000020 : 51005200 59000200 00004000 00000000  Q.R.Y..... at .....
fc000030 : 00000000 00002700 36000000 00000600  ......'.6.......
fc000040 : 06000900 13000300 05000300 02001a00  ................
fc000050 : 02000000 06000000 0100ff00 01000000  ................
fc000060 : 02000000 00000000 00000000 00000000  ................
fc000070 : 00000000 00000000 0000ffff ffffffff  ................
fc000080 : 50005200 49003100 33001400 02000100  P.R.I.1.3.......
fc000090 : 00000800 00000000 0200b500 c5000400  ................
fc0000a0 : 0100ffff ffffffff ffffffff ffffffff  ................
fc0000b0 : ffffffff ffffffff ffffffff ffffffff  ................
fc0000c0 : ffffffff ffffffff ffffffff ffffffff  ................
fc0000d0 : ffffffff ffffffff ffffffff ffffffff  ................
fc0000e0 : ffffffff ffffffff ffffffff ffffffff  ................
fc0000f0 : ffffffff ffffffff ffffffff ffffffff  ................
fc000100 : 00000000 00000000 00000000 00000000  ................
fc000110 : 00000000 00000000 00000000 00000000  ................
BDI3000>mmb 0xfc000000 0xf0


>> This mirroring might a a result of an incorrect EBC setup.
What does it mean?
In BDI3000 I am using chiptype MIRRORX16 and BUSWIDTH 16.

BDI parameter
[FLASH]
; user flash at 0xFC000000, S29GL512P (16M x 8)
CHIPTYPE    MIRRORX16          ;Flash type (Flash M29W128GH is of MIRRORX8
Flash Type)
CHIPSIZE    0x4000000       ;The size of one flash chip in bytes
BUSWIDTH    16              ;The width of the flash memory bus in bits (8 |
16 | 32)
ERASE       0xFC000000  0x20000 512 ;erase sector 512 of flash (S29GL512P)


On Tue, Apr 13, 2010 at 5:46 PM, Stefan Roese <sr@denx.de> wrote:

> Hi Prakash,
>
> On Tuesday 13 April 2010 13:46:11 prakash bedge wrote:
> > >> Are you not using the mainline version of cfi_flash.c? If not, which
> > >> "fixup code" are you referring to (link)?
> >
> > I am using U-Boot 2009.08 version.
>
> This version is outdated. I suggest to switch to current code.
>
> > I used the fixup for M29W128GH chip from the patch you suggested earlier.
> > In that code, I changed the condition to check chipwidth and it works.
>
> You shouldn't need any additional code to support the Spansion S29GL chips.
> Please use the latest code from mainline U-Boot.
>
> > But I have a concern now, as it works with by changing chipwidth to 16Bit
> > or portwidth to 16Bit. This is making me a little bit confuse.
> >  if(info->chipwidth == FLASH_CFI_16BIT)
> >   info->portwidth = FLASH_CFI_8BIT;
> >
> > if(info->chipwidth == FLASH_CFI_8BIT)
> > info->portwidth = FLASH_CFI_16BIT;
>
> ???
>
> > Can you please tell what is chipwidth and portwidth and how we can find
> > that?
>
> chipwidth: Width of the NOR FLASH chip, meaning count of data lines
>        actively used.
>
> portwidth: Width of the external bus (data lines).
>
> > Also I am not getting the correct manufacturer and device ids.
> >
> > From the flash control register I can see that my device is 16 Bit.It
> > reprsent a bit set 1 saying it is a 16 bit device.
> > Now is this flash chipwidth or flash portwidth?
>
> chipwidth.
>
> > To my flash chip 16 data lines and 26 address lines are connected.
>
> So you have chipwidth *and* portwidth of 16! This is the most common use
> case.
> Again, please use the mainline CFI driver and give it another try.
>
> > >> Perhaps a problem of incorrect unlocking addresses (byte vs. word
> >
> > address)?
> > Does it mean that unlocking addresses are not correct?
> > Supoose if chip is in word mode then what should be the portwidth and
> > chipwidth? What will be the ublocking address then?
> >
> > I am using an utilty to erase flash and to load uboot image and it is
> > working fine, only that it copies data at multple locations.
>
> What kind of "utility"? Don't you use the BDI3000 for FLASH programming?
> This
> mirroring might a a result of an incorrect EBC setup.
>
> Cheers,
> Stefan
>
> --
> DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-14  5:03                             ` prakash bedge
@ 2010-04-14  7:38                               ` Frank Svendsbøe
  2010-04-14 12:05                               ` Stefan Roese
  1 sibling, 0 replies; 31+ messages in thread
From: Frank Svendsbøe @ 2010-04-14  7:38 UTC (permalink / raw)
  To: u-boot

> 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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-14  5:03                             ` prakash bedge
  2010-04-14  7:38                               ` Frank Svendsbøe
@ 2010-04-14 12:05                               ` Stefan Roese
  2010-04-16 14:38                                 ` prakash bedge
  1 sibling, 1 reply; 31+ messages in thread
From: Stefan Roese @ 2010-04-14 12:05 UTC (permalink / raw)
  To: u-boot

Hi Prakash,

On Wednesday 14 April 2010 07:03:59 prakash bedge wrote:
> Does the latest code supports S29GL512P chip, since I am not seeing any
> instance of this chip in 2010.03 uboot code.

Yes. We have told you multiple times, that this chip is supported. You can't 
find it in the source though, since no code was needed to specifically support 
this chip. But its working!
 
> >>So you have chipwidth *and* portwidth of 16! This is the most common use
> 
> case.
> 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?
> 
> >> 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.

Yes. 2009.08 already supported this chip. But you seem to be using a special 
patch for this driver, which might afflict this.

> I replaced the cfi_flash.c with the new cfi_flash.c file from latest uboot
> version 2010.03 and done relevant changes.

Which changes? No changes to this driver are needed to support this chip!!!

> But still I didn't get the
> postive result. Is there anything else that I have to check, or by using
> only cfi_flash.c and cfi_flash.h from 2010.03 uboot code CFI flash driver
> will work?
> 
> I can not use the latest code but I want the CFI support for S29GL512P.
> Can you please tell that, what I need to do to make the CFI driver works
> for the S29GL512P chip?

See above.
 
> >> What kind of "utility"? Don't you use the BDI3000 for FLASH programming?
> 
> We have customized utility to flash the binary.

Still not clear to me, what this "utility" is.

> Using BDI3000 I tried to
> erase the flash but it didn't work.

So the BDI FLASH commands ("erase", "prog" etc) don't work?

> I followed the CFI erase command
> seuence but it fails to erase the flash.
> BDI3000>md 0xfe7c0000
> fe7c0000 : 27051956 552d426f 6f742032 3030392e  '..VU-Boot 2009.
> fe7c0010 : 30382028 41707220 31342032 30313020  08 (Apr 14 2010
> fe7c0020 : 2d203130 3a30313a 32392900 00000000  - 10:01:29).....
> fe7c0030 : 00000000 00000000 00000000 00000000  ................
> fe7c0040 : 00000000 00000000 00000000 00000000  ................
> fe7c0050 : 00000000 00000000 00000000 00000000  ................
> fe7c0060 : 00000000 00000000 00000000 00000000  ................
> fe7c0070 : 00000000 00000000 00000000 00000000  ................
> fe7c0080 : 00000000 00000000 00000000 00000000  ................
> fe7c0090 : 00000000 00000000 00000000 00000000  ................
> fe7c00a0 : 00000000 00000000 00000000 00000000  ................
> fe7c00b0 : 00000000 00000000 00000000 00000000  ................
> fe7c00c0 : 00000000 00000000 00000000 00000000  ................
> fe7c00d0 : 00000000 00000000 00000000 00000000  ................
> fe7c00e0 : 00000000 00000000 00000000 00000000  ................
> fe7c00f0 : 00000000 00000000 00000000 00000000  ................
> *BDI3000>mmb 0xfc000000 0xf0
> BDI3000>mmb 0xfc000aaa 0xaa
> BDI3000>mmb 0xfc000555 0x55
> BDI3000>mmb 0xfc000aaa 0x80
> BDI3000>mmb 0xfc000aaa 0xaa
> BDI3000>mmb 0xfc000555 0x55
> BDI3000>mmb 0xfe7c0000 0x30
> *BDI3000>mmb 0xfc000000 0xf0
> BDI3000>md 0xfe7c0000 -- *sector data is not erased

You are using byte access. You should be using word (16bit) access instead! 
And the word unlock addresses.

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-14 12:05                               ` Stefan Roese
@ 2010-04-16 14:38                                 ` prakash bedge
  2010-04-20  9:25                                   ` prakash bedge
  0 siblings, 1 reply; 31+ messages in thread
From: prakash bedge @ 2010-04-16 14:38 UTC (permalink / raw)
  To: u-boot

Hi,



I removed the changes as you suggested and now it is working without
modifying the code.

Only thing is that I had to add a flag *CONFIG_SYS_WRITE_SWAPPED_DATA* and
it works.



But here I am getting the error in erasing the sector as well in saveenv.



U-Boot $  *saveenv*

Saving Environment to Flash...

copy old content: sect_addr: FFFA0000  env_addr: FFFA0000  offset: 00000000

Protect off FFFA0000 ... FFFBFFFF

Un-Protecting sectors 509..509 in bank 1

Un-Protected 1 sectors

Erasing Flash...Erase Flash from 0xfffa0000 to 0xfffbffff in Bank # 1

fwc addr fffa0aaa cmd aa aa00 16bit x 16 bit

fwc addr fffa0554 cmd 55 5500 16bit x 16 bit

fwc addr fffa0aaa cmd 80 8000 16bit x 16 bit

fwc addr fffa0aaa cmd aa aa00 16bit x 16 bit

fwc addr fffa0554 cmd 55 5500 16bit x 16 bit

fwc addr fffa0000 cmd 30 3000 16bit x 16 bit

*flash_is_busy: 0*

. done

Erased 1 sectors

*Writing to Flash... Flash not Erased*

Protecting sectors 509..509 in bank 1

Protected 1 sectors



Here the data is not erase but the last erase sector command data is
displayed instead of environment parameters.

U-Boot $  md 0xfffa0000

fffa0000: 3000ffff ffffffff ffffffff ffffffff    0...............

fffa0010: ffffffff ffffffff ffffffff ffffffff    ................



I tired to program the word and erase the sector but here again erase
failed.

U-Boot $  mw.w 0xfdfa0000 0xfc00

 U-Boot $  mw.w 0xfdfa0aaa 0xaa00

 U-Boot $  mw.w 0xfdfa0554 0x5500

 U-Boot $  mw.w 0xfdfa0aaa 0xa000

 U-Boot $  mw.w 0xfdfa0000 0x3132

 U-Boot $  md.w 0xfdfa0000

fdfa0000: 3132 ffff ffff ffff ffff ffff ffff ffff    12..............

fdfa0010: ffff ffff ffff ffff ffff ffff ffff ffff    ................

fdfa0020: ffff ffff ffff ffff ffff ffff ffff ffff    ................

fdfa0030: ffff ffff ffff ffff ffff ffff ffff ffff    ................

fdfa0040: ffff ffff ffff ffff ffff ffff ffff ffff    ................

fdfa0050: ffff ffff ffff ffff ffff ffff ffff ffff    ................

fdfa0060: ffff ffff ffff ffff ffff ffff ffff ffff    ................

fdfa0070: ffff ffff ffff ffff ffff ffff ffff ffff    ................

 U-Boot $  erase 0xfdfa0000 +0x20000

Erase Flash from 0xfdfa0000 to 0xfdfbffff in Bank # 1

fwc addr fdfa0aaa cmd aa aa00 16bit x 16 bit

fwc addr fdfa0554 cmd 55 5500 16bit x 16 bit

fwc addr fdfa0aaa cmd 80 8000 16bit x 16 bit

fwc addr fdfa0aaa cmd aa aa00 16bit x 16 bit

fwc addr fdfa0554 cmd 55 5500 16bit x 16 bit

fwc addr fdfa0000 cmd 30 3000 16bit x 16 bit

flash_is_busy: 0

. done

Erased 1 sectors

 U-Boot $  erase 0xfdfa0000 +0x20000

 U-Boot $   md.w 0xfdfa0000

fdfa0000: *3000* ffff ffff ffff ffff ffff ffff ffff    0...............

fdfa0010: ffff ffff ffff ffff ffff ffff ffff ffff    ................


But, when I program the 0xfcfa0000 address and tried to erase the sector
then I am able to erase the sector.


U-Boot $  mw.w 0xfcfa0000 0xfc00

U-Boot $  mw.w 0xfcfa0aaa 0xaa00

U-Boot $  mw.w 0xfcfa0554 0x5500

U-Boot $  mw.w 0xfcfa0aaa 0xa000

U-Boot *$ mw.w 0xfcfa0000 0x3132*

U-Boot $  md.w 0xfcfa0000

fcfa0000: *3132* ffff ffff ffff ffff ffff ffff ffff    12..............

fcfa0010: ffff ffff ffff ffff ffff ffff ffff ffff    ................



U-Boot $  *erase 0xfcfa0000 0x20000*

Erase Flash from 0xfcfa0000 to 0xfcfbffff in Bank # 1

fwc addr fcfa0aaa cmd aa aa00 16bit x 16 bit

fwc addr fcfa0554 cmd 55 5500 16bit x 16 bit

fwc addr fcfa0aaa cmd 80 8000 16bit x 16 bit

fwc addr fcfa0aaa cmd aa aa00 16bit x 16 bit

fwc addr fcfa0554 cmd 55 5500 16bit x 16 bit

fwc addr fcfa0000 cmd 30 3000 16bit x 16 bit

flash_is_busy: 1

flash_is_busy: 1

flash_is_busy: 1

.

.

.

flash_is_busy: 1

flash_is_busy: 1

flash_is_busy: 0

. done

Erased 1 sectors

 U-Boot $  md 0xfcfa0000

*fcfa0000: ffffffff ffffffff* ffffffff ffffffff    ................

fcfa0010: ffffffff ffffffff ffffffff ffffffff    ................

fcfa0020: ffff ffff ffff ffff ffff ffff ffff ffff    ................

fcfa0030: ffff ffff ffff ffff ffff ffff ffff ffff    ................



I am able to erase 128 sector from flash base i.e. I am able to erase the
flash from flash base 0xfc000000 upto 16 MB size.

But I am not able to erase the remaining 384 sectors from 0xFD000000
onwards.



My current flash settings

/*-----------------------------------------------------------------------

 * FLASH related

 *----------------------------------------------------------------------*/

#define CONFIG_SYS_FLASH_CFI

#define CONFIG_FLASH_CFI_DRIVER

#define CONFIG_SYS_FLASH_EMPTY_INFO                  /* print 'E' for empty
sector on flinfo */

#define CONFIG_SYS_FLASH_BASE                 0xfc000000        /* start of
FLASH           */

#define CONFIG_ENV_IS_IN_FLASH     1



#define CONFIG_SYS_WRITE_SWAPPED_DATA



#define CONFIG_SYS_FLASH_CFI_WIDTH (FLASH_CFI_16BIT)



#define CONFIG_SYS_FLASH_BANKS_LIST    {CONFIG_SYS_FLASH_BASE}

#define CONFIG_SYS_MAX_FLASH_BANKS     1                            /*
number of banks         */

#define CONFIG_SYS_MAX_FLASH_SECT         512                       /*
sectors per device   */

#define CONFIG_FLASH_SHOW_PROGRESS    1

#define CONFIG_SYS_FLASH_ERASE_TOUT     300000  /* Timeout for Flash Erase
(in ms)           */

#define CONFIG_SYS_FLASH_WRITE_TOUT      500       /* Timeout for Flash
Write (in ms)            */



#define CONFIG_SYS_MONITOR_BASE      0xFFFC0000            /* Start of
U-Boot           */

#define CONFIG_SYS_MONITOR_LEN         256



#define CONFIG_ENV_SECT_SIZE         0x20000 /* size of one complete sector
*/

#define CONFIG_ENV_ADDR
(CONFIG_SYS_MONITOR_BASE-CONFIG_ENV_SECT_SIZE)

#define CONFIG_ENV_SIZE                         0x4000        /* Total Size
of Environment Sector          */





But when I give the ?erase all? command then the complete flash gets erased.
I am little bit confused by this abnormal behavior.

Is there something in code needs to check or there be an issue with chip
address bus?



Regards,

Prakash




On Wed, Apr 14, 2010 at 5:35 PM, Stefan Roese <sr@denx.de> wrote:

> Hi Prakash,
>
> On Wednesday 14 April 2010 07:03:59 prakash bedge wrote:
> > Does the latest code supports S29GL512P chip, since I am not seeing any
> > instance of this chip in 2010.03 uboot code.
>
> Yes. We have told you multiple times, that this chip is supported. You
> can't
> find it in the source though, since no code was needed to specifically
> support
> this chip. But its working!
>
> > >>So you have chipwidth *and* portwidth of 16! This is the most common
> use
> >
> > case.
> > 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?
> >
> > >> 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.
>
> Yes. 2009.08 already supported this chip. But you seem to be using a
> special
> patch for this driver, which might afflict this.
>
> > I replaced the cfi_flash.c with the new cfi_flash.c file from latest
> uboot
> > version 2010.03 and done relevant changes.
>
> Which changes? No changes to this driver are needed to support this chip!!!
>
> > But still I didn't get the
> > postive result. Is there anything else that I have to check, or by using
> > only cfi_flash.c and cfi_flash.h from 2010.03 uboot code CFI flash driver
> > will work?
> >
> > I can not use the latest code but I want the CFI support for S29GL512P.
> > Can you please tell that, what I need to do to make the CFI driver works
> > for the S29GL512P chip?
>
> See above.
>
> > >> What kind of "utility"? Don't you use the BDI3000 for FLASH
> programming?
> >
> > We have customized utility to flash the binary.
>
> Still not clear to me, what this "utility" is.
>
> > Using BDI3000 I tried to
> > erase the flash but it didn't work.
>
> So the BDI FLASH commands ("erase", "prog" etc) don't work?
>
> > I followed the CFI erase command
> > seuence but it fails to erase the flash.
> > BDI3000>md 0xfe7c0000
> > fe7c0000 : 27051956 552d426f 6f742032 3030392e  '..VU-Boot 2009.
> > fe7c0010 : 30382028 41707220 31342032 30313020  08 (Apr 14 2010
> > fe7c0020 : 2d203130 3a30313a 32392900 00000000  - 10:01:29).....
> > fe7c0030 : 00000000 00000000 00000000 00000000  ................
> > fe7c0040 : 00000000 00000000 00000000 00000000  ................
> > fe7c0050 : 00000000 00000000 00000000 00000000  ................
> > fe7c0060 : 00000000 00000000 00000000 00000000  ................
> > fe7c0070 : 00000000 00000000 00000000 00000000  ................
> > fe7c0080 : 00000000 00000000 00000000 00000000  ................
> > fe7c0090 : 00000000 00000000 00000000 00000000  ................
> > fe7c00a0 : 00000000 00000000 00000000 00000000  ................
> > fe7c00b0 : 00000000 00000000 00000000 00000000  ................
> > fe7c00c0 : 00000000 00000000 00000000 00000000  ................
> > fe7c00d0 : 00000000 00000000 00000000 00000000  ................
> > fe7c00e0 : 00000000 00000000 00000000 00000000  ................
> > fe7c00f0 : 00000000 00000000 00000000 00000000  ................
> > *BDI3000>mmb 0xfc000000 0xf0
> > BDI3000>mmb 0xfc000aaa 0xaa
> > BDI3000>mmb 0xfc000555 0x55
> > BDI3000>mmb 0xfc000aaa 0x80
> > BDI3000>mmb 0xfc000aaa 0xaa
> > BDI3000>mmb 0xfc000555 0x55
> > BDI3000>mmb 0xfe7c0000 0x30
> > *BDI3000>mmb 0xfc000000 0xf0
> > BDI3000>md 0xfe7c0000 -- *sector data is not erased
>
> You are using byte access. You should be using word (16bit) access instead!
> And the word unlock addresses.
>
> Cheers,
> Stefan
>
> --
> DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-16 14:38                                 ` prakash bedge
@ 2010-04-20  9:25                                   ` prakash bedge
  0 siblings, 0 replies; 31+ messages in thread
From: prakash bedge @ 2010-04-20  9:25 UTC (permalink / raw)
  To: u-boot

Hi All,

At last all is done. There were plattform specific changes in the board.

Now I am able to run the CFI driver for flash chip S29GL512P.

Thanks for your help so far.

Regards,
Prakash



On Fri, Apr 16, 2010 at 8:08 PM, prakash bedge <prakash.bedge@gmail.com>wrote:

> Hi,
>
>
>
> I removed the changes as you suggested and now it is working without
> modifying the code.
>
> Only thing is that I had to add a flag *CONFIG_SYS_WRITE_SWAPPED_DATA* and
> it works.
>
>
>
> But here I am getting the error in erasing the sector as well in saveenv.
>
>
>
> U-Boot $  *saveenv*
>
> Saving Environment to Flash...
>
> copy old content: sect_addr: FFFA0000  env_addr: FFFA0000  offset:
> 00000000
>
> Protect off FFFA0000 ... FFFBFFFF
>
> Un-Protecting sectors 509..509 in bank 1
>
> Un-Protected 1 sectors
>
> Erasing Flash...Erase Flash from 0xfffa0000 to 0xfffbffff in Bank # 1
>
> fwc addr fffa0aaa cmd aa aa00 16bit x 16 bit
>
> fwc addr fffa0554 cmd 55 5500 16bit x 16 bit
>
> fwc addr fffa0aaa cmd 80 8000 16bit x 16 bit
>
> fwc addr fffa0aaa cmd aa aa00 16bit x 16 bit
>
> fwc addr fffa0554 cmd 55 5500 16bit x 16 bit
>
> fwc addr fffa0000 cmd 30 3000 16bit x 16 bit
>
> *flash_is_busy: 0*
>
> . done
>
> Erased 1 sectors
>
> *Writing to Flash... Flash not Erased*
>
> Protecting sectors 509..509 in bank 1
>
> Protected 1 sectors
>
>
>
> Here the data is not erase but the last erase sector command data is
> displayed instead of environment parameters.
>
> U-Boot $  md 0xfffa0000
>
> fffa0000: 3000ffff ffffffff ffffffff ffffffff    0...............
>
> fffa0010: ffffffff ffffffff ffffffff ffffffff    ................
>
>
>
> I tired to program the word and erase the sector but here again erase
> failed.
>
> U-Boot $  mw.w 0xfdfa0000 0xfc00
>
>  U-Boot $  mw.w 0xfdfa0aaa 0xaa00
>
>  U-Boot $  mw.w 0xfdfa0554 0x5500
>
>  U-Boot $  mw.w 0xfdfa0aaa 0xa000
>
>  U-Boot $  mw.w 0xfdfa0000 0x3132
>
>  U-Boot $  md.w 0xfdfa0000
>
> fdfa0000: 3132 ffff ffff ffff ffff ffff ffff ffff    12..............
>
> fdfa0010: ffff ffff ffff ffff ffff ffff ffff ffff    ................
>
> fdfa0020: ffff ffff ffff ffff ffff ffff ffff ffff    ................
>
> fdfa0030: ffff ffff ffff ffff ffff ffff ffff ffff    ................
>
> fdfa0040: ffff ffff ffff ffff ffff ffff ffff ffff    ................
>
> fdfa0050: ffff ffff ffff ffff ffff ffff ffff ffff    ................
>
> fdfa0060: ffff ffff ffff ffff ffff ffff ffff ffff    ................
>
> fdfa0070: ffff ffff ffff ffff ffff ffff ffff ffff    ................
>
>  U-Boot $  erase 0xfdfa0000 +0x20000
>
> Erase Flash from 0xfdfa0000 to 0xfdfbffff in Bank # 1
>
> fwc addr fdfa0aaa cmd aa aa00 16bit x 16 bit
>
> fwc addr fdfa0554 cmd 55 5500 16bit x 16 bit
>
> fwc addr fdfa0aaa cmd 80 8000 16bit x 16 bit
>
> fwc addr fdfa0aaa cmd aa aa00 16bit x 16 bit
>
> fwc addr fdfa0554 cmd 55 5500 16bit x 16 bit
>
> fwc addr fdfa0000 cmd 30 3000 16bit x 16 bit
>
> flash_is_busy: 0
>
> . done
>
> Erased 1 sectors
>
>  U-Boot $  erase 0xfdfa0000 +0x20000
>
>  U-Boot $   md.w 0xfdfa0000
>
> fdfa0000: *3000* ffff ffff ffff ffff ffff ffff ffff    0...............
>
> fdfa0010: ffff ffff ffff ffff ffff ffff ffff ffff    ................
>
>
> But, when I program the 0xfcfa0000 address and tried to erase the sector
> then I am able to erase the sector.
>
>
> U-Boot $  mw.w 0xfcfa0000 0xfc00
>
> U-Boot $  mw.w 0xfcfa0aaa 0xaa00
>
> U-Boot $  mw.w 0xfcfa0554 0x5500
>
> U-Boot $  mw.w 0xfcfa0aaa 0xa000
>
> U-Boot *$ mw.w 0xfcfa0000 0x3132*
>
> U-Boot $  md.w 0xfcfa0000
>
> fcfa0000: *3132* ffff ffff ffff ffff ffff ffff ffff    12..............
>
> fcfa0010: ffff ffff ffff ffff ffff ffff ffff ffff    ................
>
>
>
> U-Boot $  *erase 0xfcfa0000 0x20000*
>
> Erase Flash from 0xfcfa0000 to 0xfcfbffff in Bank # 1
>
> fwc addr fcfa0aaa cmd aa aa00 16bit x 16 bit
>
> fwc addr fcfa0554 cmd 55 5500 16bit x 16 bit
>
> fwc addr fcfa0aaa cmd 80 8000 16bit x 16 bit
>
> fwc addr fcfa0aaa cmd aa aa00 16bit x 16 bit
>
> fwc addr fcfa0554 cmd 55 5500 16bit x 16 bit
>
> fwc addr fcfa0000 cmd 30 3000 16bit x 16 bit
>
> flash_is_busy: 1
>
> flash_is_busy: 1
>
> flash_is_busy: 1
>
> .
>
> .
>
> .
>
> flash_is_busy: 1
>
> flash_is_busy: 1
>
> flash_is_busy: 0
>
> . done
>
> Erased 1 sectors
>
>  U-Boot $  md 0xfcfa0000
>
> *fcfa0000: ffffffff ffffffff* ffffffff ffffffff    ................
>
> fcfa0010: ffffffff ffffffff ffffffff ffffffff    ................
>
> fcfa0020: ffff ffff ffff ffff ffff ffff ffff ffff    ................
>
> fcfa0030: ffff ffff ffff ffff ffff ffff ffff ffff    ................
>
>
>
> I am able to erase 128 sector from flash base i.e. I am able to erase the
> flash from flash base 0xfc000000 upto 16 MB size.
>
> But I am not able to erase the remaining 384 sectors from 0xFD000000
> onwards.
>
>
>
> My current flash settings
>
> /*-----------------------------------------------------------------------
>
>  * FLASH related
>
>  *----------------------------------------------------------------------*/
>
> #define CONFIG_SYS_FLASH_CFI
>
> #define CONFIG_FLASH_CFI_DRIVER
>
> #define CONFIG_SYS_FLASH_EMPTY_INFO                  /* print 'E' for
> empty sector on flinfo */
>
> #define CONFIG_SYS_FLASH_BASE                 0xfc000000        /* start
> of FLASH           */
>
> #define CONFIG_ENV_IS_IN_FLASH     1
>
>
>
> #define CONFIG_SYS_WRITE_SWAPPED_DATA
>
>
>
> #define CONFIG_SYS_FLASH_CFI_WIDTH (FLASH_CFI_16BIT)
>
>
>
> #define CONFIG_SYS_FLASH_BANKS_LIST    {CONFIG_SYS_FLASH_BASE}
>
> #define CONFIG_SYS_MAX_FLASH_BANKS     1                            /*
> number of banks         */
>
> #define CONFIG_SYS_MAX_FLASH_SECT         512                       /*
> sectors per device   */
>
> #define CONFIG_FLASH_SHOW_PROGRESS    1
>
> #define CONFIG_SYS_FLASH_ERASE_TOUT     300000  /* Timeout for Flash Erase
> (in ms)           */
>
> #define CONFIG_SYS_FLASH_WRITE_TOUT      500       /* Timeout for Flash
> Write (in ms)            */
>
>
>
> #define CONFIG_SYS_MONITOR_BASE      0xFFFC0000            /* Start of
> U-Boot           */
>
> #define CONFIG_SYS_MONITOR_LEN         256
>
>
>
> #define CONFIG_ENV_SECT_SIZE         0x20000 /* size of one complete
> sector    */
>
> #define CONFIG_ENV_ADDR
> (CONFIG_SYS_MONITOR_BASE-CONFIG_ENV_SECT_SIZE)
>
> #define CONFIG_ENV_SIZE                         0x4000        /* Total
> Size of Environment Sector          */
>
>
>
>
>
> But when I give the ?erase all? command then the complete flash gets
> erased. I am little bit confused by this abnormal behavior.
>
> Is there something in code needs to check or there be an issue with chip
> address bus?
>
>
>
> Regards,
>
> Prakash
>
>
>
>
> On Wed, Apr 14, 2010 at 5:35 PM, Stefan Roese <sr@denx.de> wrote:
>
>> Hi Prakash,
>>
>> On Wednesday 14 April 2010 07:03:59 prakash bedge wrote:
>> > Does the latest code supports S29GL512P chip, since I am not seeing any
>> > instance of this chip in 2010.03 uboot code.
>>
>> Yes. We have told you multiple times, that this chip is supported. You
>> can't
>> find it in the source though, since no code was needed to specifically
>> support
>> this chip. But its working!
>>
>> > >>So you have chipwidth *and* portwidth of 16! This is the most common
>> use
>> >
>> > case.
>> > 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?
>> >
>> > >> 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.
>>
>> Yes. 2009.08 already supported this chip. But you seem to be using a
>> special
>> patch for this driver, which might afflict this.
>>
>> > I replaced the cfi_flash.c with the new cfi_flash.c file from latest
>> uboot
>> > version 2010.03 and done relevant changes.
>>
>> Which changes? No changes to this driver are needed to support this
>> chip!!!
>>
>> > But still I didn't get the
>> > postive result. Is there anything else that I have to check, or by using
>> > only cfi_flash.c and cfi_flash.h from 2010.03 uboot code CFI flash
>> driver
>> > will work?
>> >
>> > I can not use the latest code but I want the CFI support for S29GL512P.
>> > Can you please tell that, what I need to do to make the CFI driver works
>> > for the S29GL512P chip?
>>
>> See above.
>>
>> > >> What kind of "utility"? Don't you use the BDI3000 for FLASH
>> programming?
>> >
>> > We have customized utility to flash the binary.
>>
>> Still not clear to me, what this "utility" is.
>>
>> > Using BDI3000 I tried to
>> > erase the flash but it didn't work.
>>
>> So the BDI FLASH commands ("erase", "prog" etc) don't work?
>>
>> > I followed the CFI erase command
>> > seuence but it fails to erase the flash.
>> > BDI3000>md 0xfe7c0000
>> > fe7c0000 : 27051956 552d426f 6f742032 3030392e  '..VU-Boot 2009.
>> > fe7c0010 : 30382028 41707220 31342032 30313020  08 (Apr 14 2010
>> > fe7c0020 : 2d203130 3a30313a 32392900 00000000  - 10:01:29).....
>> > fe7c0030 : 00000000 00000000 00000000 00000000  ................
>> > fe7c0040 : 00000000 00000000 00000000 00000000  ................
>> > fe7c0050 : 00000000 00000000 00000000 00000000  ................
>> > fe7c0060 : 00000000 00000000 00000000 00000000  ................
>> > fe7c0070 : 00000000 00000000 00000000 00000000  ................
>> > fe7c0080 : 00000000 00000000 00000000 00000000  ................
>> > fe7c0090 : 00000000 00000000 00000000 00000000  ................
>> > fe7c00a0 : 00000000 00000000 00000000 00000000  ................
>> > fe7c00b0 : 00000000 00000000 00000000 00000000  ................
>> > fe7c00c0 : 00000000 00000000 00000000 00000000  ................
>> > fe7c00d0 : 00000000 00000000 00000000 00000000  ................
>> > fe7c00e0 : 00000000 00000000 00000000 00000000  ................
>> > fe7c00f0 : 00000000 00000000 00000000 00000000  ................
>> > *BDI3000>mmb 0xfc000000 0xf0
>> > BDI3000>mmb 0xfc000aaa 0xaa
>> > BDI3000>mmb 0xfc000555 0x55
>> > BDI3000>mmb 0xfc000aaa 0x80
>> > BDI3000>mmb 0xfc000aaa 0xaa
>> > BDI3000>mmb 0xfc000555 0x55
>> > BDI3000>mmb 0xfe7c0000 0x30
>> > *BDI3000>mmb 0xfc000000 0xf0
>> > BDI3000>md 0xfe7c0000 -- *sector data is not erased
>>
>> You are using byte access. You should be using word (16bit) access
>> instead!
>> And the word unlock addresses.
>>
>> Cheers,
>> Stefan
>>
>> --
>> DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
>> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>> Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
>>
>
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2010-04-09  6:10 ` Stefan Roese
  2010-04-09  7:22   ` prakash bedge
@ 2012-03-10 10:47   ` Balaji Sivakumar
  2012-03-10 18:29     ` Dirk Behme
  2012-03-10 19:10     ` Wolfgang Denk
  1 sibling, 2 replies; 31+ messages in thread
From: Balaji Sivakumar @ 2012-03-10 10:47 UTC (permalink / raw)
  To: u-boot

Stefan Roese <sr <at> denx.de> writes:

> 
> Hi Prakash,
> 
> On Friday 09 April 2010 07:26:37 prakash bedge wrote:
> > In U-boot I am not seeing the support for Spansion S29GL512P NOR flash.
> > 
> > This chip is CFI compliant so I believe the common CFI driver should work
> > with this chip.
> > 
> > Does U-boot supports S29GL512P NOR flash or I have to implement the
> > functionality to support S29GL512P?
> > 
> > If anyone has tried with S29GL512P NOR flash please share the experiecne.
> 
> This chip is currently supported by the common CFI NOR FLASH driver. So it 
> should just work for your board as well.
> 
> Cheers,
> Stefan
> 
> --
> DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office <at> denx.de
> 


Hi Stefan,

I am Balaji.  am using IMX6 base custom board. In my board am using S29GL01G 
NOR Flash to srore u-boot and kernel. I understand from the data sheet this 
NOR Flash is CFI based on. So i have added Configurations for CFI Flash driver.

Currently am loading the U-boot into DDR3 and able to excute U-boot test 
commands. When i put flinfo , am getting "missing or unknow flash type" and 
while loading the u-boot it is printing as " Unknown flash on BANK 1 - Size - 
0MB". So am not sure what am missing here or i have to add anything extra in 
teh config file. Please request you to check and provide your suggestion.

Thanks,
Balaji S

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2012-03-10 10:47   ` Balaji Sivakumar
@ 2012-03-10 18:29     ` Dirk Behme
  2012-03-10 19:10     ` Wolfgang Denk
  1 sibling, 0 replies; 31+ messages in thread
From: Dirk Behme @ 2012-03-10 18:29 UTC (permalink / raw)
  To: u-boot

Dear Balaji,

On 10.03.2012 11:47, Balaji Sivakumar wrote:
> Stefan Roese<sr<at>  denx.de>  writes:
>
>>
>> Hi Prakash,
>>
>> On Friday 09 April 2010 07:26:37 prakash bedge wrote:
>>> In U-boot I am not seeing the support for Spansion S29GL512P NOR flash.
>>>
>>> This chip is CFI compliant so I believe the common CFI driver should work
>>> with this chip.
>>>
>>> Does U-boot supports S29GL512P NOR flash or I have to implement the
>>> functionality to support S29GL512P?
>>>
>>> If anyone has tried with S29GL512P NOR flash please share the experiecne.
>>
>> This chip is currently supported by the common CFI NOR FLASH driver. So it
>> should just work for your board as well.
>>
>> Cheers,
>> Stefan
>>
>> --
>> DENX Software Engineering GmbH,      MD: Wolfgang Denk&  Detlev Zundel
>> HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>> Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office<at>  denx.de
>>
>
>
> Hi Stefan,
>
> I am Balaji.  am using IMX6 base custom board. In my board am using S29GL01G
> NOR Flash to srore u-boot and kernel. I understand from the data sheet this
> NOR Flash is CFI based on. So i have added Configurations for CFI Flash driver.
>
> Currently am loading the U-boot into DDR3 and able to excute U-boot test
> commands. When i put flinfo , am getting "missing or unknow flash type" and
> while loading the u-boot it is printing as " Unknown flash on BANK 1 - Size -
> 0MB". So am not sure what am missing here or i have to add anything extra in
> teh config file. Please request you to check and provide your suggestion.

Just to be sure: Do you use the mainline U-Boot (u-boot.imx) or the 
old Freescale one?

This thread talks about S29GL512P. You talk about S29GL01G?

Can you send us your flash/CFI configuration from the config file?

Which CONFIG_SYS_FLASH_BASE do you use?

Best regards

Dirk

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash?
  2012-03-10 10:47   ` Balaji Sivakumar
  2012-03-10 18:29     ` Dirk Behme
@ 2012-03-10 19:10     ` Wolfgang Denk
  1 sibling, 0 replies; 31+ messages in thread
From: Wolfgang Denk @ 2012-03-10 19:10 UTC (permalink / raw)
  To: u-boot

Dear Balaji Sivakumar,

In message <loom.20120310T113930-255@post.gmane.org> you wrote:
> 
> I am Balaji.  am using IMX6 base custom board. In my board am using S29GL01G 
> NOR Flash to srore u-boot and kernel. I understand from the data sheet this 
> NOR Flash is CFI based on. So i have added Configurations for CFI Flash driver.

Thi sis of course only part of the configuration that is needed.

> Currently am loading the U-boot into DDR3 and able to excute U-boot test 
> commands. When i put flinfo , am getting "missing or unknow flash type" and 
> while loading the u-boot it is printing as " Unknown flash on BANK 1 - Size - 
> 0MB". So am not sure what am missing here or i have to add anything extra in 
> teh config file. Please request you to check and provide your suggestion.

For example, you must also set up the memory controller and memory map
as needed for your board.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A dog always bit deepest on the veterinary hand.
                                    - Terry Pratchett, _Wyrd Sisters_

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2012-03-10 19:10 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-09  5:26 [U-Boot] Does U-boot supports Spansion S29GL512P NOR Flash? prakash bedge
2010-04-09  6:10 ` Stefan Roese
2010-04-09  7:22   ` prakash bedge
2010-04-09  7:35     ` Stefan Roese
2010-04-09  7:55       ` Frank Svendsbøe
2010-04-09  8:05       ` prakash bedge
2010-04-09  8:09         ` Stefan Roese
2010-04-09  9:10           ` Frank Svendsbøe
2010-04-09 12:11             ` prakash bedge
2010-04-09 13:27               ` Frank Svendsbøe
2010-04-12  4:13                 ` prakash bedge
2010-04-12 17:01                   ` Frank Svendsbøe
2010-04-12 17:15                   ` Frank Svendsbøe
2010-04-13  6:31                     ` prakash bedge
2010-04-13  8:34                       ` Stefan Roese
2010-04-13 11:46                         ` prakash bedge
2010-04-13 12:16                           ` Stefan Roese
2010-04-14  5:03                             ` prakash bedge
2010-04-14  7:38                               ` Frank Svendsbøe
2010-04-14 12:05                               ` Stefan Roese
2010-04-16 14:38                                 ` prakash bedge
2010-04-20  9:25                                   ` prakash bedge
2010-04-09 13:35               ` Stefan Roese
2010-04-12  4:18                 ` prakash bedge
2010-04-12  7:59                   ` Stefan Roese
2012-03-10 10:47   ` Balaji Sivakumar
2012-03-10 18:29     ` Dirk Behme
2012-03-10 19:10     ` Wolfgang Denk
2010-04-09  7:48 ` Frank Svendsbøe
2010-04-09  8:07   ` prakash bedge
2010-04-09  8:23     ` Frank Svendsbøe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.