linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Preferred way to configure MTD physical mapping and partitioning
@ 2006-05-22 10:32 Laurent Pinchart
  2006-05-22 12:27 ` Thiago Galesi
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Laurent Pinchart @ 2006-05-22 10:32 UTC (permalink / raw)
  To: linuxppc-embedded

Hi everybody,

while browsing the kernel sources to find out how other boards configure MTD 
physical mapping and partitioning, I noticed that a couple of different 
approaches were possible:

- adding a board specific "driver" in drivers/mtd/maps and handle all mapping 
manually
- adding board specific MTD configuration in arch/ppc/platforms with calls to 
physmap_set_partitions() and physmap_configure()
- adding board specific MTD configuration in arch/ppc/platforms with a call to 
physmap_set_partitions(), and using the CONFIG_MTD_PHYSMAP option with 
physical mapping values provided in the kernel configuration.

Could anyone comment on the preferred approach ?

Best regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Preferred way to configure MTD physical mapping and partitioning
  2006-05-22 10:32 Preferred way to configure MTD physical mapping and partitioning Laurent Pinchart
@ 2006-05-22 12:27 ` Thiago Galesi
       [not found]   ` <200605221500.00634.laurent.pinchart@tbox.biz>
  2006-05-22 16:30 ` Guillaume Autran
  2006-05-22 22:35 ` David Woodhouse
  2 siblings, 1 reply; 5+ messages in thread
From: Thiago Galesi @ 2006-05-22 12:27 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-embedded

What about configuring it in kernel configuration (using make
menuconfig for example). Most of the configurations can be done
through there (position, size, width, etc)?

Only if you have something out of the ordinary it would be advisable
to use a driver.

If you give us more detail we'll be able to help you better

BTW, you can partition your flash via cmdline

Cheers :)



-- 
-
Thiago Galesi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Preferred way to configure MTD physical mapping and partitioning
       [not found]   ` <200605221500.00634.laurent.pinchart@tbox.biz>
@ 2006-05-22 13:27     ` Thiago Galesi
  0 siblings, 0 replies; 5+ messages in thread
From: Thiago Galesi @ 2006-05-22 13:27 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-embedded

> >
> > BTW, you can partition your flash via cmdline
>
> So would that be the preferred way to configure MTD partitions ?
>
> Laurent Pinchart
>
Using the mtdparts option in the boot cmdline. example

mtdparts=256k(partition1)ro,333k(partition2),444k(partition3),-(partition 4)

This will create /dev/mtd1, /dev/mtd2, etc, etc (and the corresponding
mtdblock devices) - you still have to create the inodes manually
(AFAIK) with the corresponding size, etc Using the '-' in the last
option uses all the remaining space. (as the ro option that makes the
partition read only. Useful for not overwriting your bootloader)

-- 
-
Thiago Galesi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Preferred way to configure MTD physical mapping and partitioning
  2006-05-22 10:32 Preferred way to configure MTD physical mapping and partitioning Laurent Pinchart
  2006-05-22 12:27 ` Thiago Galesi
@ 2006-05-22 16:30 ` Guillaume Autran
  2006-05-22 22:35 ` David Woodhouse
  2 siblings, 0 replies; 5+ messages in thread
From: Guillaume Autran @ 2006-05-22 16:30 UTC (permalink / raw)
  To: Laurent Pinchart, linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]

Hi Laurent,

There is also the "RedBoot" approach that let you create and store your partition table in a reserved sector of your flash.
You can enable your kernel to parse and create your MTD partitions according. After that, all you need to do is make your boot loader write the table in flash. Have a look at the file "linux/drivers/mtd/redboot.c". 

Guillaume.



-----Original Message-----
From: linuxppc-embedded-bounces+gautran=mrv.com@ozlabs.org on behalf of Laurent Pinchart
Sent: Mon 5/22/2006 6:32 AM
To: linuxppc-embedded@ozlabs.org
Subject: Preferred way to configure MTD physical mapping and partitioning
 
Hi everybody,

while browsing the kernel sources to find out how other boards configure MTD 
physical mapping and partitioning, I noticed that a couple of different 
approaches were possible:

- adding a board specific "driver" in drivers/mtd/maps and handle all mapping 
manually
- adding board specific MTD configuration in arch/ppc/platforms with calls to 
physmap_set_partitions() and physmap_configure()
- adding board specific MTD configuration in arch/ppc/platforms with a call to 
physmap_set_partitions(), and using the CONFIG_MTD_PHYSMAP option with 
physical mapping values provided in the kernel configuration.

Could anyone comment on the preferred approach ?

Best regards,

Laurent Pinchart
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


[-- Attachment #2: Type: text/html, Size: 2185 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Preferred way to configure MTD physical mapping and partitioning
  2006-05-22 10:32 Preferred way to configure MTD physical mapping and partitioning Laurent Pinchart
  2006-05-22 12:27 ` Thiago Galesi
  2006-05-22 16:30 ` Guillaume Autran
@ 2006-05-22 22:35 ` David Woodhouse
  2 siblings, 0 replies; 5+ messages in thread
From: David Woodhouse @ 2006-05-22 22:35 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-embedded

On Mon, 2006-05-22 at 12:32 +0200, Laurent Pinchart wrote:
> - adding a board specific "driver" in drivers/mtd/maps and handle all mapping 
> manually
> - adding board specific MTD configuration in arch/ppc/platforms with calls to 
> physmap_set_partitions() and physmap_configure()
> - adding board specific MTD configuration in arch/ppc/platforms with a call to 
> physmap_set_partitions(), and using the CONFIG_MTD_PHYSMAP option with 
> physical mapping values provided in the kernel configuration.
> 
> Could anyone comment on the preferred approach ?

None of the above. The physmap driver in the MTD git tree already works
with a platform_device, instead of needing a call to physmap_configure()
or manual configuration at build time. Either register a
platform_device, or preferably extend it to use an of_device too.

-- 
dwmw2

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-05-22 22:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-22 10:32 Preferred way to configure MTD physical mapping and partitioning Laurent Pinchart
2006-05-22 12:27 ` Thiago Galesi
     [not found]   ` <200605221500.00634.laurent.pinchart@tbox.biz>
2006-05-22 13:27     ` Thiago Galesi
2006-05-22 16:30 ` Guillaume Autran
2006-05-22 22:35 ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).