* Re: linux-mtd digest, Vol 1 #323 - 3 msgs
[not found] <E16MWkI-0003Z1-00@pentafluge.infradead.org>
@ 2002-01-04 16:50 ` Geoffrey Espin
2002-01-04 16:54 ` David Woodhouse
2002-01-11 23:35 ` Atmel Flash Charles Steinkuehler
0 siblings, 2 replies; 6+ messages in thread
From: Geoffrey Espin @ 2002-01-04 16:50 UTC (permalink / raw)
To: linux-mtd
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: linux-mtd digest, Vol 1 #323 - 3 msgs
2002-01-04 16:50 ` linux-mtd digest, Vol 1 #323 - 3 msgs Geoffrey Espin
@ 2002-01-04 16:54 ` David Woodhouse
2002-01-11 23:35 ` Atmel Flash Charles Steinkuehler
1 sibling, 0 replies; 6+ messages in thread
From: David Woodhouse @ 2002-01-04 16:54 UTC (permalink / raw)
To: Geoffrey Espin; +Cc: linux-mtd
espin@idiom.com said:
> 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.:
Useful explanation, thanks - except that you omitted the step where if it's
a commonly available board, they should send me the appropriate
myboard-flash.c too :)
--
dwmw2
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: linux-mtd digest, Vol 1 #323 - 3 msgs
@ 2002-01-04 19:51 Sanjay Kumar
0 siblings, 0 replies; 6+ messages in thread
From: Sanjay Kumar @ 2002-01-04 19:51 UTC (permalink / raw)
To: 'Geoffrey Espin'
Cc: 'linux-mtd@lists.infradead.org', 'Vipin Malik',
'David Woodhouse'
[-- Attachment #1: Type: text/plain, Size: 2401 bytes --]
Thanks Geoffrey. It solved my problem.
Sanjay
-----Original Message-----
From: Geoffrey Espin [mailto:espin@idiom.com]
Sent: Friday, January 04, 2002 10:21 PM
To: linux-mtd@lists.infradead.org
Subject: Re: linux-mtd digest, Vol 1 #323 - 3 msgs
> 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
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
[-- Attachment #2: Type: application/ms-tnef, Size: 3526 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Atmel Flash
2002-01-04 16:50 ` linux-mtd digest, Vol 1 #323 - 3 msgs Geoffrey Espin
2002-01-04 16:54 ` David Woodhouse
@ 2002-01-11 23:35 ` Charles Steinkuehler
2002-01-11 23:51 ` Eric W. Biederman
1 sibling, 1 reply; 6+ messages in thread
From: Charles Steinkuehler @ 2002-01-11 23:35 UTC (permalink / raw)
To: linux-mtd
Are the small-sector Atmel flash (ie 29C010/29C040) parts supported by MTD?
These are the parts with 128/256 Byte sector size (ie 1024 128 byte sectors
in the '010, and 2048 256 byte sectors in the '040), with no explicit erase
command required before writing new data.
Charles Steinkuehler
charles@steinkuehler.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Atmel Flash
2002-01-11 23:35 ` Atmel Flash Charles Steinkuehler
@ 2002-01-11 23:51 ` Eric W. Biederman
2002-01-12 0:04 ` David Woodhouse
0 siblings, 1 reply; 6+ messages in thread
From: Eric W. Biederman @ 2002-01-11 23:51 UTC (permalink / raw)
To: Charles Steinkuehler; +Cc: linux-mtd
"Charles Steinkuehler" <charles@steinkuehler.net> writes:
> Are the small-sector Atmel flash (ie 29C010/29C040) parts supported by MTD?
>
> These are the parts with 128/256 Byte sector size (ie 1024 128 byte sectors
> in the '010, and 2048 256 byte sectors in the '040), with no explicit erase
> command required before writing new data.
Other atmel parts are. If they aren't cfi then there is the issue
that they aren't in the table jedec_probe.c. But it should be trivial
to add them.
Eric
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Atmel Flash
2002-01-11 23:51 ` Eric W. Biederman
@ 2002-01-12 0:04 ` David Woodhouse
0 siblings, 0 replies; 6+ messages in thread
From: David Woodhouse @ 2002-01-12 0:04 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: Charles Steinkuehler, linux-mtd
ebiederman@lnxi.com said:
> "Charles Steinkuehler" <charles@steinkuehler.net> writes:
> > Are the small-sector Atmel flash (ie 29C010/29C040) parts supported by
> > MTD?
>
> > These are the parts with 128/256 Byte sector size (ie 1024 128 byte
> > sectors in the '010, and 2048 256 byte sectors in the '040), with no
> > explicit erase command required before writing new data.
> Other atmel parts are. If they aren't cfi then there is the issue
> that they aren't in the table jedec_probe.c. But it should be
> trivial to add them.
I think the other supported Atmel parts are the ones with the conventional
command set. These ones are different. It's not too hard to write support
for them though.
--
dwmw2
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-01-11 23:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <E16MWkI-0003Z1-00@pentafluge.infradead.org>
2002-01-04 16:50 ` linux-mtd digest, Vol 1 #323 - 3 msgs Geoffrey Espin
2002-01-04 16:54 ` 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox