U-Boot 1.3.3 for new MCF5485EVB BSP: Error: start address not on sector boundary

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

U-Boot 1.3.3 for new MCF5485EVB BSP: Error: start address not on sector boundary

2,267 Views
jkimble
Contributor III


I'm running this on a Coldfire (MCF5484) processor for Linux 2.6.25. I've
got 64MB of Intel P33 flash. I have two chips that have their chip selects
tied together to give me 32 bit read/write.

flinfo shows:

Bank # 1: CFI conformant FLASH (32 x 16)  Size: 64 MB in 259 SectorsEC0000
  Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x22
  Erase timeout: 4096 ms, write timeout: 1 ms
  Buffer write timeout: 2 ms, buffer size: 64 bytes
addr_first:     0xfc002000
  Sector Start Addresses:0
  FC000000   RO   FC010000   RO   FC020000   RO   FC030000   RO   FC040000
  RO
  FC080000   RO   FC0C0000   RO   FC100000   RO   FC140000   RO   FC180000
  RO
  FC1C0000   RO   FC200000        FC240000        FC280000        FC2C0000
  FC300000        FC340000        FC380000        FC3C0000        FC400000
etc....


Got CS0 set as:

#define CFG_CS0_BASE            0xFC000000
#define CFG_CS0_MASK            (((CFG_BOOTSZ << 20) - 1) & 0xFFFF0001)
#define CFG_CS0_CTRL            0x00002500


This chips first four sectors are 32K (the rest are 128K). The
CFG_ENV_SECT_SIZE is set to 0x2000. However if I change it to 32K I get
errors. On top of that the sector boundaries look fine in flinfo. I put in
some debug to see more about the error and I get:

-> save
Saving Environment to Flash...
addr_first:     0xfc002000
info->start[0]: 0xfc000000
b_end:          0xffffffff
Error: start address not on sector boundary

Not sure what to do with this. Any help appreciated.
Labels (1)
0 Kudos
3 Replies

520 Views
meteorcool
Contributor I
there's another config option in include/configs/M5485EVB.h
 
CFG_ENV_OFFSET
 
this option controls the start address for the environment variables . The default value is 0x2000. You should set this to the boudary of flash sectors. Or you will get the error prompts. Maybe 0x2000000 works for you .
 
And set CFG_**_SECT_SIZE to 0x2000000 as your flash has 32K sector size.
 
 
0 Kudos

520 Views
jkimble
Contributor III

Well, actually, there are a couple of problems here. The first of which is what you identified. The
CFG_ENV_OFFSET must be sector boundary aligned. I had guessed this and tried to modify it but kept getting odd errors when I would recompile. That set me off looking in other places for a problem when I should have just kept looking at why the compile would fail.

It seems that linker load map is hard coded to use the CFG_ENV_OFFSET settings to determine where some of the text portion of the code is loaded into memory. The 64K size pushes things out too far and causes the compiler to complain about running out of space. After adjusting the linker map things compiled and seem to be working. Unfortunately, though I am able to write to flash now I don't think U-Boot knows where I'm writing my environment to. I can save things but they get lost when I reboot.

Oh well. I'll figure it out eventually...  Thanks for your suggestion.
0 Kudos

520 Views
musa
Contributor I
Ohh,my god ,I met the same question!
I'll try this later!
Thanks a lot!
0 Kudos