[U-Boot-Users] 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 */

In message 44ED7632.7010700@redfish-group.com 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 2 0x04000000 - 0x07ffffff bank3 0x00000000 - 0x03ffffff bank 4 0x00000000 - 0x03ffffff.
4 banks.
#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.
#define CFG_MAX_FLASH_BANKS 4 /* max number of memory banks */
4 banks.
Why do you say there are 4 banks when there aren't?
Best regards,
Wolfgang Denk

Wolfgang Denk wrote:
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.

In message 44ED7D11.9050208@redfish-group.com 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.
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
And this results in... ?
Best regards,
Wolfgang Denk

Wolfgang Denk wrote:
banks correspond to chip select signals. All flash chips that use the same chip select signal form one bank.
Got it. Thanks.
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.

In message 44ED8CD6.7010600@redfish-group.com 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

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

In message 44ED9A88.000005.08071@bj163app17.163.com 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, )
--Boundary-=_GIVzXNGnGxaJoClZwSxYytQcISMF Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
Please don't post HTML here!!!
Best regards,
Wolfgang Denk

Wolfgang Denk wrote:
In message 44ED8CD6.7010600@redfish-group.com 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

Wolfgang Denk wrote:
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.
participants (4)
-
Denny
-
Jerry Van Baren
-
Justin Clacherty
-
Wolfgang Denk