public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Flash configuration
@ 2005-10-13 15:27 Jose França (Ext_GTBC)
  2005-10-13 15:43 ` Alex Zeffertt
  2005-10-13 15:53 ` Wolfgang Denk
  0 siblings, 2 replies; 13+ messages in thread
From: Jose França (Ext_GTBC) @ 2005-10-13 15:27 UTC (permalink / raw)
  To: u-boot

Hello u all!

	I'm configuring u-boot (for the first time) so that i can have 2 flash eprom chips, in two different banks, for a mpc8272 based board. They are organized the following way:
	
		BOOT Flash -> starts at 0xFFF00000 and has 512KB of size. (read-only)
		Linux Flash -> starts at 0x50000000 and has 64MB of size. (CFI compatible)

	Since CFG_FLASH_BASE is used throughout the u-boot code as a reference, which one should it be? The boot flash address or the linux flash address? I'm really confused here...
	All is setup so that the processor starts to boot from 0xFFF00000 and the reset vector set to 0xFFF00100.
	Should I use the cfi_flash driver, provided by u-boot? Or should I write a flash.c in my board directory (this is done already)? Do I have to change anything when I use the driver?



Thanks in advance!
Filipe

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

* [U-Boot-Users] Flash configuration
  2005-10-13 15:27 Jose França (Ext_GTBC)
@ 2005-10-13 15:43 ` Alex Zeffertt
  2005-10-13 15:53 ` Wolfgang Denk
  1 sibling, 0 replies; 13+ messages in thread
From: Alex Zeffertt @ 2005-10-13 15:43 UTC (permalink / raw)
  To: u-boot

On Thu, 13 Oct 2005 16:27:20 +0100

> Hello u all!
> 
> 	I'm configuring u-boot (for the first time) so that i can have
> 	2 flash eprom chips, in two different banks, for a mpc8272
> 	based board. They are organized the following way:
> 	
> 		BOOT Flash -> starts at 0xFFF00000 and has 512KB of size.
> 		(read-only) Linux Flash -> starts at 0x50000000 and has 64MB
> 		of size. (CFI compatible)
> 
> 	Since CFG_FLASH_BASE is used throughout the u-boot code as a
> 	reference, which one should it be? The boot flash address or
> 	the linux flash address? I'm really confused here... All is
> 	setup so that the processor starts to boot from 0xFFF00000 and
> 	the reset vector set to 0xFFF00100. Should I use the cfi_flash
> 	driver, provided by u-boot? Or should I write a flash.c in my
> 	board directory (this is done already)? Do I have to change
> 	anything when I use the driver?
> 
> 


CFG_FLASH_BASE is the address to which u-boot remaps the flash on CS0.

I assume that by "Linux Flash" you mean a Linux root file system on a
seperate chip.  If so then I think you need to map it (to a different
CS) in u-boot/board/<yourboard>/flash.c.  Then you can use the
"bootcmd" variable to boot the kernel uImage from whereever in this
chip it is.

The bootargs variable will tell the kernel where to find its root file
system.  You will have to write a mapping driver
drivers/mtd/<yourboard>.c so that the kernel knows how to interpret
this.

Alex


> 
> Thanks in advance!
> Filipe
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads,
> discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users

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

* [U-Boot-Users] Flash configuration
  2005-10-13 15:27 Jose França (Ext_GTBC)
  2005-10-13 15:43 ` Alex Zeffertt
@ 2005-10-13 15:53 ` Wolfgang Denk
  1 sibling, 0 replies; 13+ messages in thread
From: Wolfgang Denk @ 2005-10-13 15:53 UTC (permalink / raw)
  To: u-boot

In message <6DABE12DF62766479F2A94F7E3157C5F9B2890@lisi053a.siemens.pt> you wrote:
> 
> 	I'm configuring u-boot (for the first time) so that i can have 2 flash
> eprom chips, in two different banks, for a mpc8272 based board. They are
> organized the following way:
> 	
> 		BOOT Flash -> starts at 0xFFF00000 and has 512KB of size. (read-only)
> 		Linux Flash -> starts at 0x50000000 and has 64MB of size. (CFI
> compatible)
> 
> 	Since CFG_FLASH_BASE is used throughout the u-boot code as a reference,
> which one should it be? The boot flash address or the linux flash
> address? I'm really confused here...

FLASH_BASE is closely related to the location of U-Boot in flash,  so
it has to be set to match the start address of your "boot flash".

> 	Should I use the cfi_flash driver, provided by u-boot? Or should I

This is mostly a mtter of taste, and how you design your system.

Some configurations handle the "boot flash" as  "ROM"  (your  use  of
"read  only"  above seems to indicate such intentions, too), and they
configure U-Boot such that it is not even included  in  the  "flinfo"
display and thus cannot be written by standard U-Boot commands.

Others expose all flash banks to the user, which is IMHO  the  better
approach - sooner or later you *will* want to update the U-Boot image
in  your  "boot  flash"  and you will execrate the idiot who disabled
write access to this chip. Probably rather sooner than  later.  Also,
the  boot  flash  is probably an excellent location to store U-Boot's
environment sectors without creating gaps or reserved areas  in  your
"Linux flash".

If you want to use the CFI driver or your own is also mostly a matter
of taste - and code size requirements.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

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

* [U-Boot-Users] Flash configuration
@ 2006-08-24  9:49 Justin Clacherty
  2006-08-24 10:01 ` Wolfgang Denk
  0 siblings, 1 reply; 13+ messages in thread
From: Justin Clacherty @ 2006-08-24  9:49 UTC (permalink / raw)
  To: u-boot

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     */

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

* [U-Boot-Users] Flash configuration
  2006-08-24  9:49 [U-Boot-Users] Flash configuration Justin Clacherty
@ 2006-08-24 10:01 ` Wolfgang Denk
  2006-08-24 10:18   ` Justin Clacherty
  0 siblings, 1 reply; 13+ messages in thread
From: Wolfgang Denk @ 2006-08-24 10:01 UTC (permalink / raw)
  To: u-boot

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

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

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

* [U-Boot-Users] Flash configuration
  2006-08-24 10:01 ` Wolfgang Denk
@ 2006-08-24 10:18   ` Justin Clacherty
  2006-08-24 10:30     ` Wolfgang Denk
  0 siblings, 1 reply; 13+ messages in thread
From: Justin Clacherty @ 2006-08-24 10:18 UTC (permalink / raw)
  To: u-boot

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.

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

* [U-Boot-Users] Flash configuration
  2006-08-24 10:18   ` Justin Clacherty
@ 2006-08-24 10:30     ` Wolfgang Denk
  2006-08-24 11:26       ` Justin Clacherty
  0 siblings, 1 reply; 13+ messages in thread
From: Wolfgang Denk @ 2006-08-24 10:30 UTC (permalink / raw)
  To: u-boot

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

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

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

* [U-Boot-Users] Flash configuration
  2006-08-24 10:30     ` Wolfgang Denk
@ 2006-08-24 11:26       ` Justin Clacherty
  2006-08-24 12:13         ` Wolfgang Denk
  0 siblings, 1 reply; 13+ messages in thread
From: Justin Clacherty @ 2006-08-24 11:26 UTC (permalink / raw)
  To: u-boot

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.

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

* [U-Boot-Users] Flash configuration
  2006-08-24 11:26       ` Justin Clacherty
@ 2006-08-24 12:13         ` Wolfgang Denk
  2006-08-24 12:24           ` [U-Boot-Users] about the function "pci_write_config_dwor d" Denny
                             ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Wolfgang Denk @ 2006-08-24 12:13 UTC (permalink / raw)
  To: u-boot

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

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

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

* [U-Boot-Users] about the function "pci_write_config_dwor d"
  2006-08-24 12:13         ` Wolfgang Denk
@ 2006-08-24 12:24           ` Denny
  2006-08-24 15:18             ` Wolfgang Denk
  2006-08-24 12:31           ` [U-Boot-Users] Flash configuration Jerry Van Baren
  2006-08-25 14:13           ` Justin Clacherty
  2 siblings, 1 reply; 13+ messages in thread
From: Denny @ 2006-08-24 12:24 UTC (permalink / raw)
  To: u-boot

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 

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

* [U-Boot-Users] Flash configuration
  2006-08-24 12:13         ` Wolfgang Denk
  2006-08-24 12:24           ` [U-Boot-Users] about the function "pci_write_config_dwor d" Denny
@ 2006-08-24 12:31           ` Jerry Van Baren
  2006-08-25 14:13           ` Justin Clacherty
  2 siblings, 0 replies; 13+ messages in thread
From: Jerry Van Baren @ 2006-08-24 12:31 UTC (permalink / raw)
  To: u-boot

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

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

* [U-Boot-Users] about the function "pci_write_config_dwor d"
  2006-08-24 12:24           ` [U-Boot-Users] about the function "pci_write_config_dwor d" Denny
@ 2006-08-24 15:18             ` Wolfgang Denk
  0 siblings, 0 replies; 13+ messages in thread
From: Wolfgang Denk @ 2006-08-24 15:18 UTC (permalink / raw)
  To: u-boot

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

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

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

* [U-Boot-Users] Flash configuration
  2006-08-24 12:13         ` Wolfgang Denk
  2006-08-24 12:24           ` [U-Boot-Users] about the function "pci_write_config_dwor d" Denny
  2006-08-24 12:31           ` [U-Boot-Users] Flash configuration Jerry Van Baren
@ 2006-08-25 14:13           ` Justin Clacherty
  2 siblings, 0 replies; 13+ messages in thread
From: Justin Clacherty @ 2006-08-25 14:13 UTC (permalink / raw)
  To: u-boot

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.

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

end of thread, other threads:[~2006-08-25 14:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-24  9:49 [U-Boot-Users] Flash configuration Justin Clacherty
2006-08-24 10:01 ` Wolfgang Denk
2006-08-24 10:18   ` Justin Clacherty
2006-08-24 10:30     ` Wolfgang Denk
2006-08-24 11:26       ` Justin Clacherty
2006-08-24 12:13         ` Wolfgang Denk
2006-08-24 12:24           ` [U-Boot-Users] about the function "pci_write_config_dwor d" Denny
2006-08-24 15:18             ` Wolfgang Denk
2006-08-24 12:31           ` [U-Boot-Users] Flash configuration Jerry Van Baren
2006-08-25 14:13           ` Justin Clacherty
  -- strict thread matches above, loose matches on Subject: below --
2005-10-13 15:27 Jose França (Ext_GTBC)
2005-10-13 15:43 ` Alex Zeffertt
2005-10-13 15:53 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox