From: Vladimir Zapolskiy <vz@mleia.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/4] nand: lpc32xx: add hardware ECC support
Date: Wed, 29 Jul 2015 20:22:17 +0300 [thread overview]
Message-ID: <55B90BC9.50509@mleia.com> (raw)
In-Reply-To: <201507291850.16932.marex@denx.de>
Hi Marek, Sylvain,
On 29.07.2015 19:50, Marek Vasut wrote:
> On Wednesday, July 29, 2015 at 06:14:08 PM, slemieux.tyco at gmail.com wrote:
>
[snip]
>> static void lpc32xx_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
>> {
>> +#if defined(CONFIG_DMA_LPC32XX) && !defined(CONFIG_SPL_BUILD)
>
> I'm not a big fan of those ifdefs -- why not use DMA even in SPL ?
I think the main reason is that DMA in SPL has not been tested yet.
If needed (?) the dependency between DMA and SPL may be described
separately, e.g.
+#if defined(CONFIG_DMA_LPC32XX) && defined(CONFIG_SPL_BUILD)
+#warning "DMA support in SPL image is not tested"
+#endif
Regarding this particular #ifdef case I suppose just
+#if defined(CONFIG_DMA_LPC32XX)
is good enough here, either it is SPL or U-boot.
>> + lpc32xx_nand_xfer(mtd, buf, len, 1);
>> +#else
>> while (len-- > 0)
>> *buf++ = readl(&lpc32xx_nand_slc_regs->data);
>> +#endif
>> }
I would propose to add another pair of DMA specific
lpc32xx_read_buf()/lpc32xx_write_buf() functions chosen under
CONFIG_DMA_LPC32XX condition, this might improve readability.
--
With best wishes,
Vladimir
next prev parent reply other threads:[~2015-07-29 17:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-29 16:14 [U-Boot] [PATCH v2 2/4] nand: lpc32xx: add hardware ECC support slemieux.tyco at gmail.com
2015-07-29 16:50 ` Marek Vasut
2015-07-29 17:22 ` Vladimir Zapolskiy [this message]
2015-07-29 17:35 ` LEMIEUX, SYLVAIN
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=55B90BC9.50509@mleia.com \
--to=vz@mleia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.