public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* 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

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