public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] nand flash controller on 440ep/epx
@ 2006-10-09 14:15 Jeff Mann
  2006-10-09 15:14 ` Stefan Roese
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Mann @ 2006-10-09 14:15 UTC (permalink / raw)
  To: u-boot

Stefan:

>Use the least significant 2 bit's in the CFG_NAND_BASE_LIST to select
the CS. 
>In your case this would look like this:

>#define CFG_NAND_BASE_LIST	{ CFG_NAND_BASE + 1, CFG_NAND_BASE + 2 }

>The driver could then configure the correct CS in the new device select
function, and would of course mask the least significant 2 bit's in the
IO_ADDR_W/_R accesses.

>Is this too "hackish"?

That would work. Is simple, and would work for initialization. It would
involve using a proper mask for nand_baseaddr[..] when setting the
location of the nand read/write/control registers to ignore the CS data.


So.....

Nand_init(...) calls nand_init_chip(...) which then calls
board_nand_init(...)
I think the most appropriate place to select the proper Chip select is
in the board_nand_init() function. This function is only passed an
address of the chip nand_chip struct address. So I still think that an
entry in the nand_chip struct should be used for tracking the chip
select to keep the chip select code out of nand.c and keep the code as
simple as possible. 

So, I like the 
#define CFG_NAND_BASE_LIST	{ CFG_NAND_BASE + 1, CFG_NAND_BASE + 2 }

configuration method, but I still think that the struct nand_chip needs
a chip select variable. 

Do we assume the use of the nand flash controller on PPC 440 EP, Epx,
GP, and GPx processors by default (unless still using the legacy drivers
like the bamboo board)?

What do you think?

-Jeff

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [U-Boot-Users] nand flash controller on 440ep/epx
@ 2006-10-06 20:51 Jeff Mann
  2006-10-07 14:15 ` Stefan Roese
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Mann @ 2006-10-06 20:51 UTC (permalink / raw)
  To: u-boot

>It seems to me that we are missing a board/cpu specific function to
select a different NAND chip, when the device is changed via the "nand
device x" command.This 440EP(x) specific function would then setup the
NDFC configuration register (NDFC0_CR) to enable the desired NAND chip
select. 

This seems simple enough. In addition to "nand device x" switching, it
would need to be incorporated into nand_init_chip(...) in nand.c before
it calls nand_scan(...). I do not think it has to be board specific, but
rather processor specific. 

>
>And to make it easy I suggest that NAND device 0 represents chips
select 0 and so on... So no need for additional config options or config
arrays.

I origionally consitered this approach. However, as nand would rarely be
on CS 0, it seemed to have additional problems. For example, I have
FLASH on CS 0, a CPLD on CS 3 and NAND on 1 and 3. So, doing
nand_scan(..) at boot would cause problems if all four chip selects were
scanned. On the other hand, a config option like #define
CONFIG_NAND_CS0, etc. could solve this problem.

So, we will need the configuration options:
CONFIG_USE_PPC440_NDFC to select the use of the nand flash controller on
ppc440ep/x/gp boards
CONFIG_NAND_CS0, CONFIG_NAND_CS1, CONFIG_NAND_CS2, CONFIG_NAND_CS3 or 
CONFIG_NAND_CS { ...} to select which chip selects to use

Then we need to assumme that all nand chips use the address set for the
nand controller in 
#define CFG_NAND_BASE CFG_NAND_ADDR

We will either need to set CFG_MAX_NAND_DEVICE to four (if assuming all
CS might me used) or somehow each of the devices in the nand_chip struct
array will need to be identified with a cs. I origionally recommended
adding a variable in the struct for identifying the chip select, but
there are other ways around this. 

So, Stefan, (or Wolfgang) which approach would you prefer I take. I
think that the AMCC sequoia is the only board so far that uses the nand
controller so it is the only board that will need changes.

-Jeff
Embedded Planet

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [U-Boot-Users] nand flash controller on 440ep/epx
@ 2006-10-06 17:56 Jeff Mann
  2006-10-06 19:40 ` Stefan Roese
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Mann @ 2006-10-06 17:56 UTC (permalink / raw)
  To: u-boot

It appears that the nand flash controller support recently added to
u-boot for the ppc400ep/epx only supports the use of a single nand chip.
The nand flash controller supports up to four devices using chip selects
0-3. I am working on making two devices work right now for my use, but I
would like to update the flash-controller support. I am open for
comments on this.

What I think I need to do is add an #config CFG_440_USENANDCONTROLLER
option and an entry into the nand_chip struct for holding the chip
select numbers for each chip. Then in addition to configuring an array
of nand bases {CFG_NAND_BASE} (which would all be the same address
because it is the address of the nand controller), the chip selects are
put in a configured array and put into the nand_chip nand struct. The
read and write functions would then need to be updated to enable the
right chip select in the nand controller config register too. 

Comments? Suggestions? What am I missing?

-Jeff 

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

end of thread, other threads:[~2006-10-09 15:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-09 14:15 [U-Boot-Users] nand flash controller on 440ep/epx Jeff Mann
2006-10-09 15:14 ` Stefan Roese
  -- strict thread matches above, loose matches on Subject: below --
2006-10-06 20:51 Jeff Mann
2006-10-07 14:15 ` Stefan Roese
2006-10-06 17:56 Jeff Mann
2006-10-06 19:40 ` Stefan Roese

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