From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCHv3 3/3] 83xx, kmeter1: added NAND support
Date: Fri, 17 Jul 2009 07:05:03 +0200 [thread overview]
Message-ID: <4A60067F.9000400@denx.de> (raw)
In-Reply-To: <20090716193518.GE32758@b07421-ec1.am.freescale.net>
Hello Scott
Scott Wood wrote:
> On Mon, Jul 13, 2009 at 12:15:12PM +0200, Heiko Schocher wrote:
>> +#define read_mode() in_8((volatile unsigned char __iomem *) \
>> + CONFIG_NAND_MODE_REG)
>> +#define write_mode(val) out_8((volatile unsigned char __iomem *) \
>> + CONFIG_NAND_MODE_REG, val)
>> +#define read_data() in_8((volatile unsigned char __iomem *) \
>> + CONFIG_NAND_DATA_REG)
>> +#define write_data(val) out_8((volatile unsigned char __iomem *) \
>> + CONFIG_NAND_DATA_REG, val)
>
> No need for volatile when using accessors. If you kept a pointer around
> instead of casting here, you could reasonably use the accessors directly
> without needing wrappers...
>
> If this is purely for U-Boot and not shared with Linux we can drop the
> __iomem.
OK, I fix it.
>> +static void kpn_nand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
>> +{
>> + u8 reg_val = read_mode();
>
> No tab after "u8".
>
>> + if (ctrl & NAND_CTRL_CHANGE) {
>> + if ( ctrl & NAND_NCE)
>
> No space after "(".
Yep, you are right. Fixed.
>> + reg_val = reg_val & ~KPN_CE1N;
>> + else
>> + reg_val = reg_val | KPN_CE1N;
>> + write_mode(reg_val);
>> + }
>> + if (cmd == NAND_CMD_NONE)
>> + return;
>> +
>> + reg_val = reg_val & ~(KPN_ALE + KPN_CLE);
>> + if (ctrl & NAND_CLE)
>> + reg_val = reg_val | KPN_CLE;
>> + if (ctrl & NAND_ALE)
>> + reg_val = reg_val | KPN_ALE;
>
> If ALE/CLE is sticky in the hardware mode register, you could probably
> move this under NAND_CTRL_CHANGE and simplify things a little.
I try this out.
>> diff --git a/include/configs/kmeter1.h b/include/configs/kmeter1.h
>> index 811ba88..4de0dfc 100644
>> --- a/include/configs/kmeter1.h
>> +++ b/include/configs/kmeter1.h
>> @@ -324,6 +324,12 @@
>> #define CONFIG_SYS_DTT_HYSTERESIS 3
>> #define CONFIG_SYS_DTT_BUS_NUM (CONFIG_SYS_MAX_I2C_BUS)
>>
>> +#if defined(CONFIG_CMD_NAND)
>> +#define CONFIG_NAND_KMETER1
>
> No tab after #define.
fixed.
>> +#define CONFIG_SYS_MAX_NAND_DEVICE 1
>> +#define CONFIG_SYS_NAND_BASE CONFIG_SYS_PIGGY_BASE
>> +#endif
>> +
>> #if defined(CONFIG_PCI)
>> #define CONFIG_CMD_PCI
>> #endif
>
> This file looks a little different in the current tree (2 rather than
> CONFIG_SYS_MAX_I2C_BUS), so it wouldn't apply cleanly.
Hmm... this is the third patch of a patchset, so it apply cleanly, if
the other 2 patches are first applied ... or should I base this patch
against current nand-flash tree, because this patch goes through your
tree?
thanks for reviewing
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2009-07-17 5:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-11 8:19 [U-Boot] [PATCHv2 3/3] 83xx, kmeter1: added NAND support Heiko Schocher
2009-07-13 9:20 ` Stefan Roese
2009-07-13 9:55 ` Heiko Schocher
2009-07-13 9:57 ` Stefan Roese
2009-07-13 10:15 ` [U-Boot] [PATCHv3 " Heiko Schocher
2009-07-16 19:35 ` Scott Wood
2009-07-17 5:05 ` Heiko Schocher [this message]
2009-07-17 15:36 ` Scott Wood
2009-07-18 8:43 ` Heiko Schocher
2009-07-21 15:13 ` [U-Boot] [PATCHv4 " Heiko Schocher
2009-08-06 22:08 ` Scott Wood
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=4A60067F.9000400@denx.de \
--to=hs@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