Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Philipp Boerker" <philipp.boerker@gmx.de>
To: linux-mtd@lists.infradead.org
Subject: mtd partitions definition
Date: Tue, 13 Oct 2009 17:10:49 +0200	[thread overview]
Message-ID: <20091013151049.280490@gmx.net> (raw)


I'm sorry if this is the wrong place for such questions. I have done a lot of reading on the subject and have browsed through the kernel code for my device but still could not find the desired information (I'm no programming crack, I'm afraid). The situation is this:

I have an embedded device which has some mtd partitions which are controlled by the omap2-nand driver. The exact kernel sources for the device are unavailable at the moment (I expect them to be published by the manufacturer within the next weeks) so I collect most of the info I have from dmesg and grepping through the binaries. 

Now I would like to install my own bootloader which in the present case resides in an mtd partition that appears to be read-only (opening the device rw fails). I concluded that I had to change the partition definition to being writable in order to be able to write to the partition holding the bootloader (I assume that making the partition read-only was a kind of security measure on the side of the manufacturer). The remaining mtd partitions can be written using flash_image.

I have learned so far that there are (at least) three ways of defining mtd partitions: kernel command line ("cmdline parsing not available" in dmesg so it shouldn't be this), fixed (i.e. defined somewhere in the sources, however, a grep for the partition names listed in dmesg doesn't show anything) or redboot. The device does not use redboot as a bootloader but as far as I understand this does not mean that it doesn't use the redboot method for defining mtd partitions.

I have looked through the kernel sources for the omap2-nand driver and have come to a function called omap_nand_probe which seems to initialise (at least part of) the device but gets all the interesting information (i.e. partition definition) passed as an argument. So the partition information is set up somewhere else. And I can't find this somewhere else...

I wonder whether there is a user-space tool similar to fdisk for defining mtd partitions provided that the redboot method is used. (btw, the partition holding the bootloader does not use ubi.) I know that mtd partitions can be defined in redboot itself but this is some sort of a chicken-and-egg problem: I need to have the partitions rw in order to have my own bootloader installed and the device uses some other kind of bootloader...

Any help on this? I spend two days learning about mtd (a week ago I didn't know it existed) and I start feeling that pain in my neck... :)


Thank you for your work and time!

-- 
Hoy la lluvia no me moja, hoy en día soy el huracán
Voy levantando las hojas, voy zarpado por todo el lugar
Hoy la fuerza me sonríe, hoy la vida me quiere ayudar
Me levanto aunque me tiren, no me duele, no me ves llorar


Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser

             reply	other threads:[~2009-10-13 15:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-13 15:10 Philipp Boerker [this message]
2009-10-14  5:16 ` mtd partitions definition vimal singh
2009-10-17 10:37 ` Mika Korhonen

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=20091013151049.280490@gmx.net \
    --to=philipp.boerker@gmx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox