public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] RFC: porting u-boot to sequoia based nand booting board
Date: Tue, 17 May 2011 17:37:30 +0200	[thread overview]
Message-ID: <201105171737.30838.sr@denx.de> (raw)
In-Reply-To: <4DD28202.4050305@dawning.com>

Alex,

On Tuesday 17 May 2011 16:11:14 Alex Waterman wrote:
> > What changes did you have to make? Some 8/16 bit related changes? Or
> > something else?
> 
> I changed the hard coded value of EBC0_CFG; I forced the chip->options
> field to have the 16 bit bus width flag set; in board_nand_select_device()
> I modified the value written to the NDFC_CCR register; I think that's
> primarily it. The hard coded registers could be made into CONFIG_SYS
> defines I think, but the bus width setting... Could we make a CONFIG_SYS
> define that specifies the width of the bus since during the spl we don't
> have access to the nand chip table?

I see no problem with such an approach. How about CONFIG_SYS_NDFC_16BIT? If 
its not defined, then the currently used 8bit configuration is shall be 
selected.

> > It should be the goal, to use *only* the common NDFC code. If you have
> > found some bugs, or you need some changes for 16bit devices, we should
> > try to integrate them into the common code.
> 
> I have seen issues with the nand_read_byte16() function in nand_base.c; it
> seems like the cpu_to_le16() should be the other way around:
> le16_to_cpu(). Other than that no bugs as far as I am aware.

Hmmm. Not sure here. Perhaps this is PPC4xx specific. A better solution with 
less impact on other platforms using nand_base.c would be to implement a 
nand_read_byte() function in ndfc.c when CONFIG_SYS_NDFC_16BIT is defined. 
This way the default implementation from nand_base will be overridden.
 
> >> Likewise much of our board specific support files are copies from the
> >> sequoia code. Would it be better to symlink to the ones that are not
> >> modified? Or is it OK to just copy the relevant source files into our
> >> own board directory and make minor adjustments as needed?
> > 
> > Usually we copy those files into a new board directly. When the
> > similarities are too big, then we should probably think about splitting
> > to common parts into some other directory
> > (arch/powerpc/cpu/ppc4xx/ppc440epx.c ???).
> 
> OK, I see. Most of the code in board/amcc/sequoia is the same except for
> some of the sdram initialization and the sequoia.c file (which I renamed
> to tiger.c). Also the linker script differs slightly. How would we go
> about making those board files common (init.S, chip_config.c)?

Hard to tell without being able to look at your code and the differences. I 
suggest that you first create a patch with the NAND changes mentioned above 
and with your new board support (tiger) in a separate directory. We can 
discuss the details then on the list: if and how the sequoia code could/should 
be re-used.

Best regards,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

  reply	other threads:[~2011-05-17 15:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-17 13:00 [U-Boot] RFC: porting u-boot to sequoia based nand booting board Alex Waterman
2011-05-17 13:41 ` Stefan Roese
2011-05-17 14:11   ` Alex Waterman
2011-05-17 15:37     ` Stefan Roese [this message]
2011-05-17 17:05     ` Scott Wood
2011-05-17 17:49       ` Alex Waterman
2011-05-17 19:20         ` Scott Wood
2011-05-17 21:15           ` Alex Waterman
2011-05-17 21:32             ` Scott Wood
2011-05-18 12:49               ` Alex Waterman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201105171737.30838.sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox