Skip to contentSkip to conversation

Partition question...

DISCUSSION Chris Lesiak 3 participants 4 messages Sep 10, 2001 – Sep 12, 2001 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

I also have two banks mapped contiguously into virtual memory that I would like to be seen as one.

The problem is that RedBoot (and ECOS) seems to only support one flash logical device. I wrote an ECOS flash driver that treated both banks as a single large logical device. RedBoot stores its partition table in the last erase
block of the device. So in my case, a single partition table is store in the last
erase block of the second bank but partitions the space of both banks.

When I get to the linux, mtd seems to expect a partition table for each bank.

What is the best way to reconcile the problem?
Can linux also easily see both banks as a single device that can be partitioned?

Chris Lesiak
[email protected]

If the addressing between two Flash devices remains linear with no gaps, can they be part of the same mtd[n] partition, or must the next chip be mtd[n+1]?

I have two 32-bit Flash devices (or so I'm told). Since this is a MIPS application the
reset vector is 0xBFC00000. The Flash devices are 0xBE000000-BEFFFFFF and 0xBF000000-BFFFFFFF, so I have 4Megs at the top of the second device, with the
first device and lower 12Megs of the second giving me 28Megs of linear Flash

available.

Keith Siders
Software Engineer
Toshiba America Consumer Products, Inc.
Advanced Television Technology Center
801 Royal Parkway, Suite 100
Nashville, Tennessee 37214

Phone: (615) 257-4050
Fax:   (615) 453-7880

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#1 lore raw
Quoted 2 lines · Chris Lesiak

I also have two banks mapped contiguously into virtual memory that I would like to be seen as one.

Should be fine, as long as the two chips are identical. At the moment, they need to be mapped with no space between them. However, aliases are OK. So, for example, if you have

0xbe000000-0xbe7fffff Chip 1
0xbe800000-0xbeffffff Chip 1 again
0xbf000000-0xbf7fffff Chip 2
0xbf800000-0xbfffffff Chip 2 again.

That'll be fine. It'll detect the aliases in there. It will quit scanning the region when it finds something that's not a flash chip, though, so if those aliases _weren't_ there it'd break (and you could trivially fix it the your 'map' driver by munging the addresses).

Quoted 10 lines

The problem is that RedBoot (and ECOS) seems to only support one flash logical device. I wrote an ECOS flash driver that treated both banks as a single large logical device. RedBoot stores its partition table in the last erase block of the device. So in my case, a single partition table is store in the last erase block of the second bank but partitions the space of both banks.

When I get to the linux, mtd seems to expect a partition table for each bank.

What is the best way to reconcile the problem?

Change your map driver to encompass the whole region, then it should appear as a single MTD device and it'll look for a single partition table.

Quoted 5 lines

I have two 32-bit Flash devices (or so I'm told). Since this is a MIPS application the reset vector is 0xBFC00000. The Flash devices are 0xBE000000-BEFFFFFF and 0xBF000000-BFFFFFFF, so I have 4Megs at the top of the second device, with the first device and lower 12Megs of the second giving me 28Megs of linear Flash

You should be able probe the two chips as a single device with no problems, as I said above. But then you want two non-contiguous regions to appear as a single partition.

That's not handled by the existing partition code - but the partition code is just a simple set of wrappers that add an offset and pass control through to the methods of the underlying MTD device. It's simple enough to hack up your own wrapper which does what you want.

Signature · 1 line
dwmw2
#2 lore raw

Hi,
I want to partition my MTD devices , it physical address :
CS0: 0x00000000 - 0x00800000
CS1: 0x10000000 - 0x10800000
How should I to haldle it ?

Thanks..
----- Original Message -----
From: "David Woodhouse" <[email protected]>
To: "Chris Lesiak" <[email protected]>
Cc: <[email protected]>; "Siders, Keith" <[email protected]>
Sent: Tuesday, September 11, 2001 3:52 AM
Subject: Re: Partition question...

Quoted 3 lines · Chris Lesiak
Quoted 2 lines

I also have two banks mapped contiguously into virtual memory that I

would

Quoted 11 lines
Quoted 1 line

like to be seen as one.

Should be fine, as long as the two chips are identical. At the moment, they need to be mapped with no space between them. However, aliases are OK. So, for example, if you have

0xbe000000-0xbe7fffff Chip 1
0xbe800000-0xbeffffff Chip 1 again
0xbf000000-0xbf7fffff Chip 2
0xbf800000-0xbfffffff Chip 2 again.

Quoted 13 lines

That'll be fine. It'll detect the aliases in there. It will quit scanning the region when it finds something that's not a flash chip, though, so if those aliases _weren't_ there it'd break (and you could trivially fix it the your 'map' driver by munging the addresses).

Quoted 8 lines

The problem is that RedBoot (and ECOS) seems to only support one flash logical device. I wrote an ECOS flash driver that treated both banks as a single large logical device. RedBoot stores its partition table in the last erase block of the device. So in my case, a single partition table is store in the last erase block of the second bank but partitions the space of both banks.

When I get to the linux, mtd seems to expect a partition table for each

bank.

Quoted 29 lines
Quoted 2 lines

What is the best way to reconcile the problem?

Change your map driver to encompass the whole region, then it should appear as a single MTD device and it'll look for a single partition table.

Quoted 5 lines

I have two 32-bit Flash devices (or so I'm told). Since this is a MIPS application the reset vector is 0xBFC00000. The Flash devices are 0xBE000000-BEFFFFFF and 0xBF000000-BFFFFFFF, so I have 4Megs at the top of the second device, with the first device and lower 12Megs of the second giving me 28Megs of linear Flash

You should be able probe the two chips as a single device with no problems, as I said above. But then you want two non-contiguous regions to appear as a single partition.

That's not handled by the existing partition code - but the partition code is just a simple set of wrappers that add an offset and pass control through to the methods of the underlying MTD device. It's simple enough to hack up your own wrapper which does what you want.

--
dwmw2

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#3 lore raw
Quoted 4 lines · [email protected] said:

I want to partition my MTD devices , it physical address :

    CS0: 0x00000000 - 0x00800000
    CS1: 0x10000000 - 0x10800000
    How should I to haldle it ? 

What's at 0x800000-0xffffff? A second image of CS0? If so, just copy one of the existing map drivers and make it length 0x10800000. Then after calling the chip probe routines you set up your array of struct mtd_partitions and call add_mtd_partitions. There are plenty of examples to crib from.

--
dwmw2