public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Chin Liang See <clsee@altera.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 1/6] nand: denali: add Denali NAND driver for SPL
Date: Wed, 17 Sep 2014 07:10:39 -0500	[thread overview]
Message-ID: <1410955839.7769.47.camel@clsee-VirtualBox.altera.com> (raw)
In-Reply-To: <20140917180906.3BD0.AA925319@jp.panasonic.com>

Hi Masahiro,

On Wed, 2014-09-17 at 18:09 +0900, Masahiro Yamada wrote:
> Hi Chin,
> 
> 
> On Mon, 15 Sep 2014 01:39:07 -0500
> Chin Liang See <clsee@altera.com> wrote:
> 
> > Hi Masahiro,
> > 
> > On Fri, 2014-09-12 at 17:06 +0900, Masahiro Yamada wrote:
> > 
> > > > > +/* nand_init() - initialize data to make nand usable by SPL */
> > > > > +void nand_init(void)
> > > > > +{
> > > > > +	/* access to main area */
> > > > > +	writel(0, denali_flash_reg + TRANSFER_SPARE_REG);
> > > > > +
> > > > > +	page_size = readl(denali_flash_reg + DEVICE_MAIN_AREA_SIZE);
> > > > > +	oob_size = readl(denali_flash_reg + DEVICE_SPARE_AREA_SIZE);
> > > > > +	pages_per_block = readl(denali_flash_reg + PAGES_PER_BLOCK);
> > > > 
> > > > 
> > > > I believe this will work for ONFI NAND devices only.
> > > > For non-ONFI, the value might not correct.
> > > 
> > > 
> > > I don't think so.
> > > It depends on the hardware; in my understanding
> > > Denali IP is capable of detecting MAIN_AREA_SIZE etc.
> > > for non-ONFI devices.  At least this is working with non-ONFI devices
> > > on some Panasonic boards.
> > > 
> > > If it does not work for Altera SoCs (and if you are planning to use
> > > this driver), these three registers should be set in advance
> > > in an earlier board init.
> > > 
> > 
> > I recall one of my colleague was telling me that it doesn't work for one
> > of non ONFI part where it read incorrect page size. Nevertheless, we can
> > put comments so user which use this driver need to take note.
> 
> I have also heard of that.  I think it happens on some Hynix devices.
> 
> According to my colleague, for the device with
> maf_id = 0xAD, device_id = 0xDA,
> the Denali IP seems to set wrong parameters.
> 
> Either comments or fixup code like get_hynix_nand_para() in denali.c
> will do.
> 
> BTW I've noticed only a few Hynix devices are supported by denali.c.
> (only the device id = 0xD5 or 0xD7)
> 
> This is, anyway, a upstream limitation and we can send a follow up
> patch if needed.
> 
> 

Yup, that sound a good plan to enable this patch to move forward. We
just need to add some write-up to the commit message.


> 
> 
> > > 
> > > 
> > > > 
> > > > 
> > > > Currently U-Boot has drivers/mtd/nand/nand_spl_simple.c which handling
> > > > the SPL NAND image load. Wonder this driver will be integrated into
> > > > nand_spl_simple.c once drivers/mtd/nand/denali.c is applied?
> > > 
> > > I am not planning to do so because:
> > > 
> > > [1] nand_spl_simple.c requires CONFIG_SYS_NAND_BLOCK_SIZE, CONFIG_SYS_NAND_PAGE_SIZE,
> > > CONFIG_SYS_NAND_PAGE_COUNT; we need to specify the device attributes at compilation,
> > > which the Denali IP is able to detect at run time.
> > > It is not acceptable for us because we need (want) the run time configuration.
> > > 
> > > [2] nand_spl_simple.c is so generic that it cannot use the hardware acceleration of
> > > the Denali IP, that is, slower booting.
> > > 
> > 
> > Yup, you identified the nand_spl_simple.c constrain. This is why I
> > patched this file at
> > http://rocketboards.org/gitweb/?p=u-boot-socfpga.git;a=commit;h=461a61b8f03d3b690de1f4ff007cd23fb80018a5. But I didn't send this patch out as I am waiting the NAND driver patch accepted.
> 
> 
> After applying your patch, both [1] and [2] are still the constrain of nand_spl_simple.c
> 

For [1], yup. But the intention is to ensure it works for various
devices and NAND controllers. While for [2], the patch will take
advantage of the hardware based ECC calculation. But it will not take
advantage of the DMA as I believe DMA might not exist for certain NAND
controller. 

With that, I don't have much concern to remain this file as this would
enable better performance as its specific for Denali. Probably Altera
should use this too if its accepted into mainline :)

Thanks
Chin Liang

> 
> Best Regards
> Masahiro Yamada
> 

  reply	other threads:[~2014-09-17 12:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-05  5:50 [U-Boot] [PATCH v4 0/6] Add support for Panasonic UniPhier SoCs/boards Masahiro Yamada
2014-09-05  5:50 ` [U-Boot] [PATCH v4 1/6] nand: denali: add Denali NAND driver for SPL Masahiro Yamada
2014-09-12  7:09   ` Chin Liang See
2014-09-12  8:06     ` Masahiro Yamada
2014-09-15  6:39       ` Chin Liang See
2014-09-17  9:09         ` Masahiro Yamada
2014-09-17 12:10           ` Chin Liang See [this message]
2014-09-05  5:50 ` [U-Boot] [PATCH v4 2/6] serial: add UniPhier serial driver Masahiro Yamada
2014-09-05 10:35   ` Marek Vasut
2014-09-05 12:03     ` Masahiro Yamada
2014-09-05 12:59       ` Marek Vasut
2014-09-05 16:41       ` Simon Glass
2014-09-06 14:49         ` Masahiro YAMADA
2014-09-19 12:15         ` Masahiro Yamada
2014-09-19 16:30           ` Simon Glass
2014-09-20  7:18             ` Masahiro YAMADA
2014-09-22  6:35               ` Simon Glass
2014-09-05  5:50 ` [U-Boot] [PATCH v4 3/6] arm: uniphier: add UniPhier SoC support code Masahiro Yamada
2014-09-05 18:59   ` Simon Glass
2014-09-06 15:34     ` Masahiro YAMADA
2014-09-06 16:39       ` Simon Glass
2014-09-05  5:50 ` [U-Boot] [PATCH v4 4/6] arm: uniphier: add Kconfig and defconfig Masahiro Yamada
2014-09-05  5:50 ` [U-Boot] [PATCH v4 5/6] MAINTAINERS: add me as a maintainer of UniPhier platform Masahiro Yamada
2014-09-18 11:33   ` Albert ARIBAUD
2014-09-18 11:40     ` Michal Simek
2014-09-05  5:50 ` [U-Boot] [PATCH v4 6/6] git-mailrc: " Masahiro Yamada

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=1410955839.7769.47.camel@clsee-VirtualBox.altera.com \
    --to=clsee@altera.com \
    --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