Flash configuration
Hi,
I've ported u-boot to my PXA270 board and have it working as a network boot loader. I'm now trying to get flash programming working so I can flash the kernel and root file system. Our board has two Intel 512Mib P30 flashes on it configured as 32-bit memory. The 512Mib parts are actually two 256Mib parts on the same die so u-boot should see two banks of 32-bit memory with two flash devices in each bank.
After booting flinfo shows that u-boot has found four devices but the addresses seem to be wrong. It has
bank 1 0x00000000 - 0x03ffffff
bank 2 0x04000000 - 0x07ffffff
bank3 0x00000000 - 0x03ffffff
bank 4 0x00000000 - 0x03ffffff.
Any ideas where I might have gone wrong? The relevant portions of my board header file are below.
Regards,
Justin.
#define PHYS_FLASH_1 0x00000000 /* Flash Bank #1 */
#define PHYS_FLASH_2 0x04000000 /* Flash Bank #2 */
#define CFG_FLASH_CFI
#define CFG_FLASH_CFI_DRIVER 1
#define CFG_FLASH_CFI_WIDTH FLASH_CFI_32BIT
#define CFG_FLASH_BASE_1 PHYS_FLASH_1
#define CFG_FLASH_BASE_2 PHYS_FLASH_2
#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE_1, CFG_FLASH_BASE_2 }#define CFG_MONITOR_BASE 0
#define CFG_MONITOR_LEN 0x20000
#define CFG_MAX_FLASH_BANKS 4 /* max number of memory
banks */
#define CFG_MAX_FLASH_SECT (4 + 255) /* max number of sectors on
one chip */
/* timeout values are in ticks */
#define CFG_FLASH_ERASE_TOUT (25*CFG_HZ) /* Timeout for Flash Erase */
#define CFG_FLASH_WRITE_TOUT (25*CFG_HZ) /* Timeout for Flash Write */
/* write flash less slowly */
#define CFG_FLASH_USE_BUFFER_WRITE 1
/* Flash environment locations */
#define CFG_ENV_IS_IN_FLASH 1 #define CFG_ENV_ADDR (CFG_FLASH_BASE_1 + CFG_MONITOR_LEN) /* Addr of Environment Sector */ #define CFG_ENV_SIZE 0x10000 /* Total Size of
Environment */
#define CFG_ENV_SECT_SIZE 0x10000 /* Total Size of Environment
Sector */
Quoted 8 lines · In message <[email protected]> you wrote:
After booting flinfo shows that u-boot has found four devices but the addresses seem to be wrong. It has
bank 1
0x00000000-0x03ffffff
bank 20x04000000-0x07ffffff
bank30x00000000-0x03ffffff
bank 40x00000000-0x03ffffff.
4 banks.
Quoted 3 lines
#define CFG_FLASH_BASE_1 PHYS_FLASH_1
#define CFG_FLASH_BASE_2 PHYS_FLASH_2
#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE_1, CFG_FLASH_BASE_2 }Init data for 2 banks.
Quoted 1 line
#define
CFG_MAX_FLASH_BANKS4 /* max number of memory banks */
4 banks.
Why do you say there are 4 banks when there aren't?
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense. - E. W. Dijkstra
Quoted 1 line · Wolfgang Denk
Why do you say there are 4 banks when there aren't?
I must admit to being a little confused about the terminology. I had thought that banks were the number of devices but wasn't sure how that worked given that two devices would be in the same address range. I take it that "banks" refer to the address range that the devices use and the CFI code takes care of how many devices are in a bank. So in my case there are two banks made up of two devices. The extra two I see are because I've told u-boot there are four and it just retries at address 0x00000000. Would this be correct?
So my config should be:
#define CFG_FLASH_BASE_1 PHYS_FLASH_1
#define CFG_FLASH_BASE_2 PHYS_FLASH_2
#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE_1, CFG_FLASH_BASE_2 }
#define CFG_MAX_FLASH_BANKS 2
Regards,
Justin.
Quoted 4 lines · In message <[email protected]> you wrote:
I must admit to being a little confused about the terminology. I had thought that banks were the number of devices but wasn't sure how that worked given that two devices would be in the same address range. I
banks correspond to chip select signals. All flash chips that use the same chip select signal form one bank.
Quoted 7 lines
So my config should be:
#define
CFG_FLASH_BASE_1PHYS_FLASH_1
#defineCFG_FLASH_BASE_2PHYS_FLASH_2
#defineCFG_FLASH_BANKS_LIST{CFG_FLASH_BASE_1,CFG_FLASH_BASE_2}#define
CFG_MAX_FLASH_BANKS2
And this results in... ?
Best regards,
Wolfgang Denk
Signature · 3 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Every time history repeats itself the price goes up.
Quoted 3 lines · Wolfgang Denk
banks correspond to chip select signals. All flash chips that use the same chip select signal form one bank.
Got it. Thanks.
Quoted 2 lines
And this results in... ?
Will let you know tomorrow, I'm not in the office anymore so don't have access to the hardware (9:30 pm here in Australia).
Justin.
Quoted 3 lines · In message <[email protected]> you wrote:
Will let you know tomorrow, I'm not in the office anymore so don't have access to the hardware (9:30 pm here in Australia).
An excellent time to start the second shift. No customers calling on the phone etc... :-)
Best regards,
Wolfgang Denk
Signature · 4 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Life, loathe it or ignore it, you can't like it." - Marvin the paranoid android
[U-Boot-Users] about the function "pci_write_config_dwor d"
Hi,
Can anyone tell me where is the funciton "<FONT color=#cc0033>pci_write_config_dword".
So far I didn't find it in uboot src code
Thanks in advance!
- Denny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20060824/6dfecbf3/attachment.htm
[U-Boot-Users] about the function "pci_write_config_dwor d"
Quoted 3 lines · In message <[email protected]> you wrote:
Can anyone tell me where is the funciton "<FONT color=#cc0033>pci_write_config_dword".
So far I didn't find it in uboot src code
This is in drivers/pci.c line 75:
PCI_OP(write, dword, u32, )
Quoted 3 lines
--Boundary-=_GIVzXNGnGxaJoClZwSxYytQcISMF
Content-Type: text/html; charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Please don't post HTML here!!!
Best regards,
Wolfgang Denk
Signature · 5 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de 1st Old Man: Gee, its windy today. 2nd Old Man: No it's not... it's Thursday. 3rd Old Man: Yeh, me too. Let's go for a beer.
Quoted 10 lines · Wolfgang Denk
Quoted 2 lines · In message <[email protected]> you wrote:
Will let you know tomorrow, I'm not in the office anymore so don't have access to the hardware (9:30 pm here in Australia).
An excellent time to start the second shift. No customers calling on the phone etc... :-)
Best regards,
Wolfgang Denk
The man knows. :-)
I recall the night that I was remotely debugging on one of Wolfgang's boards around 22:30 local time six(?) time zones W of Germany when, all of a sudden, I got a "talk" request from Wolfgang on my terminal (and I really appreciated it, too, because it really helped me climb the learning curve mountain).
gvb
Quoted 3 lines · Wolfgang Denk
An excellent time to start the second shift. No customers calling on the phone etc... :-)
Had enough late nights over the past few months, figured it was time for a night off.
Changing to two banks did the trick thanks. To get programming to work correctly I also needed to add
#define CFG_FLASH_PROTECTION
Thanks for your help.
Regards,
Justin.