From: Thomas Gleixner <gleixner@autronix.de>
To: "" <cafe@eyou.com>, linux-mtd@lists.infradead.org
Subject: Re: the structs of MTD
Date: Mon, 29 Apr 2002 07:44:55 +0200 [thread overview]
Message-ID: <200204290544.g3T5itB05294@thomas.tec.autronix.de> (raw)
In-Reply-To: <20020429103500.62790.qmail@eyou.com>
On Monday, 29. April 2002 04:35, wrote:
> Hi, I'm new to linux-mtd.
> I have a SAMSUNG k9F5608U0M flash, 32M NAND Flash Memory.
> But the difficulty is I know little about the structs of MTD , such as
> struct mtd_chip_driver.
> So I don't know how to drive it . can you explain these interrelated
> struct ?
> By the way, please explain detailedly how to drive the forenamed NAND Flash
> Memory ?
This chip is supported by the generic NAND driver already. You need just a
driver for your specific hardware, where you supply baseaddress and access to
CE, ALE and CLE pins. Have a look at drivers/mtd/nand/nand.c (generic nand
driver) and drivers/mtd/nand/autcpu12.c (example for a hardware driver). Use
latest CVS code. It contains all enhancements for NAND support.
The important pieces of the hardware driver are
void autcpu12_hwcontrol(iCONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_NAND=y
nt cmd)
This is the function, which supplies the manipulation of CE, CLE and ALE pins.
int __init autcpu12_init (void)
This is the main init function of the hardware driver
The main points of this function are
/* map physical adress */
autcpu12_fio_base=(unsigned long)ioremap(autcpu12_fio_pbase,SZ_1K);
Remaps the physical base address to a virtual address for driver usage
/* Set address of NAND IO lines */
this->IO_ADDR_R = autcpu12_fio_base;
this->IO_ADDR_W = autcpu12_fio_base;
Set the address for read / write access to the chips data bus. In most cases
the base address.
this->hwcontrol = autcpu12_hwcontrol;
Set the function for access to controllines (CE, CLE, ALE)
this->dev_ready = autcpu12_device_ready;
Give the function to read the ready/busy pin of the chip. If you do not have
access to this pin set it to NULL.
/* 20 us command delay time */
this->chip_delay = 20;
Give a appropriate command delay time according to the chips datasheet.
Supply partitioning information, if you want to use more than one partition
on the chip.
Following CONFIG's should be set
CONFIG_MTD=y
CONFIG_MTD_PARTITIONS=y <--- if you want to use partitions
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_NAND=y
CONFIG_MTD_NAND_ECC=y
CONFIG_MTD_NAND_ECC_JFFS2=y <-- If you want to use JFFS2, which is recommended
CONFIG_MTD_NAND_AUTCPU12=y <-- Replace this by your hardware driver
For JFFS2 usage set
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_NAND=y
Enjoy.
--
Thomas
___________________________________
autronix automation GmbH
http://www.autronix.de gleixner@autronix.de
prev parent reply other threads:[~2002-04-29 5:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-29 2:35 the structs of MTD cafe
2002-04-29 5:44 ` Thomas Gleixner [this message]
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=200204290544.g3T5itB05294@thomas.tec.autronix.de \
--to=gleixner@autronix.de \
--cc=cafe@eyou.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox