From: Mike Rapoport <mike@compulab.co.il>
To: "Zachár Balázs" <bzachar@direkt-kfki.hu>
Cc: linux-mtd@lists.infradead.org
Subject: Re: nand driver help
Date: Mon, 30 Mar 2009 09:35:26 +0300 [thread overview]
Message-ID: <49D0682E.4080500@compulab.co.il> (raw)
In-Reply-To: <49CCEB89.1050906@direkt-kfki.hu>
Zachár Balázs wrote:
> Hi,
>
> I have a pxa270 based board, and I try to create the nand driver for the 2.6.28-7 main kernel... On this board, the nand flash is connected directly to the pxa27x PCMCIA socket's pins... (see this
> pdf: http://pubs.gumstix.org/documents/PXA%20Documentation/PXA270/PXA270%20Connecting%20NAND%20Flash%20%5B28014402%5D.pdf)
>
[ snip ]
>
> On my board the NAND AL signal is connected to MA20 so if I "access" to 0x2010_0000 (PCMCIA0 address: 0x2000_0000) it should decoded as AL=1 operation.
> If I right, if I "access" to the PCMCIA1 address (PCMCIA1 address: 0x3000_0000) it should decoded as a CL=1 operation.
> The R/Bn (ready_notbusy) signal is connected to GPIO55 and the WP signal is connected to GPIO56.
>
> I write this hwcontrol function for my board's cmd_crtl function, but I think it isn't work(bdevelb_ALE_io_base=ioremap(0x20100000, 0x1000),bdevelb_CLE_io_base=ioremap(0x30000000, 0x1000)):
> static void bdevelb_nand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
> {
> struct nand_chip *chip = mtd->priv;
>
> if (ctrl & NAND_CTRL_CHANGE) {
> if ( ctrl & NAND_ALE )
> writeb(0xff, bdevelb_ALE_io_base);
> if ( ctrl & NAND_CLE )
> writeb(0xff, bdevelb_CLE_io_base);
> }
>
> if (cmd != NAND_CMD_NONE)
> writeb(cmd, chip->IO_ADDR_W);
You should set chip->IO_ADDW_W to either bdevelb_ALE_io_base or
bdevelb_CLE_io_base, depending on the ctrl value:
if (ctrl & NAND_CTRL_CHANGE) {
if ( ctrl & NAND_ALE )
chip->IO_ADDR_W = bdevelb_ALE_io_base;
if ( ctrl & NAND_CLE )
chip->IO_ADDR_W = bdevelb_CLE_io_base;
}
> }
>
> Is this function good for this connection scheme?
> What is it mean "access" to an address? Can be enough a readb funtion?
>
> regards,
> Balazs
>
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2009-03-30 6:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-27 15:06 nand driver help Zachár Balázs
2009-03-30 6:35 ` Mike Rapoport [this message]
2009-03-30 16:25 ` bzachar
2009-04-01 15:19 ` Mike Rapoport
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=49D0682E.4080500@compulab.co.il \
--to=mike@compulab.co.il \
--cc=bzachar@direkt-kfki.hu \
--cc=linux-mtd@lists.infradead.org \
/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.