From: Geoffrey Espin <espin@idiom.com>
To: linux-mtd@lists.infradead.org
Subject: Re: linux-mtd digest, Vol 1 #323 - 3 msgs
Date: Fri, 4 Jan 2002 08:50:40 -0800 [thread overview]
Message-ID: <20020104085040.A48397@idiom.com> (raw)
In-Reply-To: <E16MWkI-0003Z1-00@pentafluge.infradead.org>; from linux-mtd-request@lists.infradead.org on Fri, Jan 04, 2002 at 03:59:02PM +0000
> From: "Sanjay Kumar" <sankumar96@lycos.com>
> Subject: Problem in changing the starting location of JFFS2 for AMD flash
> I am using AMD flash of 4M size and keeping starting 1/2 MB for RAW data. Then for the remaining I want to use JFFS2. That is JFF2 will start from 0.5 MB to 4MB. For that I am making changes in super.c of JFFS2 for function jffs2_read_super. The changes are -
> c->free_size = c->mtd->size - jffs2_start_addr;
> c->flash_size = c->mtd->size - jffs2_start_addr;
> c->nr_blocks = c->flash_size / c->sector_size;
> c->blocks[i].offset = i * c->sector_size + jffs2_start_addr;
> where am keeping jffs2_start_addr = 0x80000.
> I am using linux 2.4.2.
> Now I am able to mount the jffs2 file system and able to create a empty file.
> But when I go for writing into the created empty file, it is crashing.
As someone already has replied, don't mess with sources like super.c.
In linux/.config, have these options on:
CONFIG_MTD=y
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
CONFIG_MTD_<myboard>=y
Under linux/drivers/mtd/maps/ you must create your myboard-flash.c
(and add to Makefile), which has the partition table in it, e.g.:
#define WINDOW_ADDR 0xbfc00000 /* default 4M part */
#define WINDOW_SIZE 0x00400000
...
static struct mtd_partition myboard_partitions[] = {
{
name: "bootstrap and kernel",
size: WINDOW_SIZE / 4, /* 0.5M */
offset: 0,
},{
name: "filesystem",
size: MTDPART_SIZ_FULL, /* 2M */
offset: MTDPART_OFS_APPEND,
}
};
Then from shell you can:
# mtd_debug erase /dev/mtd/0 ${OFFSET} ${SIZE} # 0 is entire device
# cp empty.jffs2 /dev/mtd/2 # 2 is second partition
# mount -t jffs2 /dev/mtdblock/2 /mnt
Where 'empty.jffs2' is a stub file created by mkfs.jffs2,
and OFFSET & SIZE are whatever boundaries you've setup.
You might need to drop in later mtd files into 2.4.2.
Geoff
--
Geoffrey Espin
espin@idiom.com
next parent reply other threads:[~2002-01-04 16:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E16MWkI-0003Z1-00@pentafluge.infradead.org>
2002-01-04 16:50 ` Geoffrey Espin [this message]
2002-01-04 16:54 ` linux-mtd digest, Vol 1 #323 - 3 msgs David Woodhouse
2002-01-11 23:35 ` Atmel Flash Charles Steinkuehler
2002-01-11 23:51 ` Eric W. Biederman
2002-01-12 0:04 ` David Woodhouse
2002-01-04 19:51 linux-mtd digest, Vol 1 #323 - 3 msgs Sanjay Kumar
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=20020104085040.A48397@idiom.com \
--to=espin@idiom.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 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.