From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 6/7] tegra: nand: Add Tegra NAND driver
Date: Thu, 5 Jul 2012 20:28:26 -0500 [thread overview]
Message-ID: <4FF63F3A.7060402@freescale.com> (raw)
In-Reply-To: <4B9C9637D5087840A465BDCB251780E9E2D6EDA3FA@HKMAIL02.nvidia.com>
On 07/04/2012 02:46 AM, Jim Lin wrote:
>> -----Original Message-----
>> From: Scott Wood [mailto:scottwood at freescale.com]
>> Sent: Thursday, April 26, 2012 6:17 AM
>> To: Simon Glass
>> Cc: U-Boot Mailing List; Tom Warren; Stephen Warren; Jim Lin; Stephen Warren
>> Subject: Re: [PATCH v3 6/7] tegra: nand: Add Tegra NAND driver
>>
>> On 04/17/2012 01:50 PM, Simon Glass wrote:
>>> +static void write_buf(struct mtd_info *mtd, const uint8_t *buf, int len)
>>> +{
>>> + int i, j, l;
>>> + struct nand_chip *chip = mtd->priv;
>>> + struct nand_drv *info;
>>> +
>>> + info = (struct nand_drv *)chip->priv;
>>> +
>>> + for (i = 0; i < len / 4; i++) {
>>> + l = ((int *)buf)[i];
>>
>> If you're assuming the buffer is 32-bit aligned, comment it. Ideally
>> these assumptions should be stated in the interface itself...
> This doesn't mean that buf needs to be 32-bit aligned.
> It only says each write is 32-bit.
OK, didn't realize modern ARM could deal with unaligned accesses.
>> Should also comment that there's an endian dependency here.
> What do you mean? Could you explain more or have an example?
You load a value using host endianness, and store it using a little
endian accessor. This would be fine if it represented a real 32-bit
integer, but it's really a sequence of bytes that should not be swapped.
It's not a big deal if you don't see the driver ever being used with a
big endian host, but a comment would be nice.
>>> +/**
>>> + * Board-specific NAND initialization
>>> + *
>>> + * @param nand nand chip info structure
>>> + * @return 0, after initialized, -1 on error
>>> + */
>>> +int board_nand_init(struct nand_chip *nand)
>>
>> Please consider using CONFIG_SYS_NAND_SELF_INIT.
> So far I don't see the demand.
I'd like to see the old way go away eventually.
> -----------------------------------------------------------------------------------
> This email message is for the sole use of the intended recipient(s) and may contain
> confidential information. Any unauthorized review, use, disclosure or distribution
> is prohibited. If you are not the intended recipient, please contact the sender by
> reply email and destroy all copies of the original message.
> -----------------------------------------------------------------------------------
Please try to get rid of this. This is a public mailing list.
-Scott
next prev parent reply other threads:[~2012-07-06 1:28 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 18:50 [U-Boot] [PATCH v3 0/7] tegra: Add NAND flash support Simon Glass
2012-04-17 18:50 ` [U-Boot] [PATCH v3 1/7] nand: Try to align the default buffers Simon Glass
2012-04-17 18:50 ` [U-Boot] [PATCH v3 2/7] fdt: Add debugging to fdtdec_get_int/addr() Simon Glass
2012-04-17 18:50 ` [U-Boot] [PATCH v3 3/7] tegra: Add NAND support to funcmux Simon Glass
2012-04-17 18:50 ` [U-Boot] [PATCH v3 4/7] tegra: fdt: Add NAND controller binding and definitions Simon Glass
2012-04-17 19:06 ` Scott Wood
2012-04-17 20:18 ` Simon Glass
2012-04-17 20:31 ` Scott Wood
2012-04-17 20:36 ` Simon Glass
2012-04-17 20:49 ` Scott Wood
2012-04-17 18:50 ` [U-Boot] [PATCH v3 5/7] tegra: fdt: Add NAND definitions to fdt Simon Glass
2012-04-17 18:50 ` [U-Boot] [PATCH v3 6/7] tegra: nand: Add Tegra NAND driver Simon Glass
2012-04-25 22:17 ` Scott Wood
[not found] ` <4B9C9637D5087840A465BDCB251780E9E2D5582388@HKMAIL02.nvidia.com>
2012-05-21 15:47 ` Scott Wood
2012-05-22 20:04 ` Simon Glass
2012-05-22 20:06 ` Scott Wood
2012-05-22 20:24 ` Simon Glass
2012-05-22 20:29 ` Scott Wood
[not found] ` <4B9C9637D5087840A465BDCB251780E9E2D6EDA3FA@HKMAIL02.nvidia.com>
2012-07-06 1:28 ` Scott Wood [this message]
2012-07-06 15:40 ` Stephen Warren
2012-04-17 18:50 ` [U-Boot] [PATCH v3 7/7] tegra: Enable NAND on Seaboard Simon Glass
2012-04-26 10:50 ` [U-Boot] [PATCH v3 0/7] tegra: Add NAND flash support Thierry Reding
2012-04-26 15:13 ` Stephen Warren
2012-04-26 18:32 ` Thierry Reding
2012-04-26 19:20 ` Stephen Warren
2012-04-27 5:10 ` Thierry Reding
2012-04-27 15:37 ` Stephen Warren
2012-04-28 11:39 ` Thierry Reding
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=4FF63F3A.7060402@freescale.com \
--to=scottwood@freescale.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