All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] no mtdparted from U-Boot> prompt
Date: Sat, 22 Dec 2012 00:13:40 +0100	[thread overview]
Message-ID: <20121221231341.39F5F201213@gemini.denx.de> (raw)
In-Reply-To: <1356130404.28896.135.camel@genx>

Dear John Stile,

In message <1356130404.28896.135.camel@genx> you wrote:
>
> > I had the impression there was also an interactive command-line tool for
> > mtdparts, from the u-boot prompt.
> 
> This post give me the impression that there should be a uboot mtdparts
> command in addtion to the kernel option.
> http://stackoverflow.com/questions/8585864/nand-partitioning-in-u-boot

Yes, there is.

For example:

=> mtdparts -?
mtdparts - define flash/nand partitions

Usage:
mtdparts 
    - list partition table
mtdparts delall
    - delete all partitions
mtdparts del part-id
    - delete partition (e.g. part-id = nand0,1)
mtdparts add <mtd-dev> <size>[@<offset>] [<name>] [ro]
    - add partition
mtdparts default
    - reset partition table to defaults

-----

this command uses three environment variables:

'partition' - keeps current partition identifier

partition  := <part-id>
<part-id>  := <dev-id>,part_num

'mtdids' - linux kernel mtd device id <-> u-boot device id mapping

mtdids=<idmap>[,<idmap>,...]

<idmap>    := <dev-id>=<mtd-id>
<dev-id>   := 'nand'|'nor'|'onenand'<dev-num>
<dev-num>  := mtd device number, 0...
<mtd-id>   := unique device tag used by linux kernel to find mtd device (mtd->name)

'mtdparts' - partition list

mtdparts=mtdparts=<mtd-def>[;<mtd-def>...]

<mtd-def>  := <mtd-id>:<part-def>[,<part-def>...]
<mtd-id>   := unique device tag used by linux kernel to find mtd device (mtd->name)
<part-def> := <size>[@<offset>][<name>][<ro-flag>]
<size>     := standard linux memsize OR '-' to denote all remaining space
<offset>   := partition start offset within the device
<name>     := '(' NAME ')'
<ro-flag>  := when set to 'ro' makes partition read-only (not used, passed to kernel)



=> mtdparts   

device nor0 <fc000000.flash>, # parts = 7
 #: name                size            offset          mask_flags
 0: firmware            0x00100000      0x00000000      0
 1: dtb                 0x00040000      0x00100000      0
 2: kernel              0x00240000      0x00140000      0
 3: small-fs            0x00280000      0x00380000      0
 4: initrd              0x00200000      0x00600000      0
 5: misc                0x00800000      0x00800000      0
 6: big-fs              0x01000000      0x01000000      0

active partition: nor0,0 - (firmware) 0x00100000 @ 0x00000000

defaults:
mtdids  : nor0=fc000000.flash
mtdparts: mtdparts=fc000000.flash:1m(firmware),256k(dtb),2304k(kernel),2560k(small-fs),2m(initrd),8m(misc),16m(big-fs)
=> 


> > Now it contains:
> > #define CONFIG_JFFS2_NAND 1
> > #define CONFIG_JFFS2_CMDLINE 1
> > #define CONFIG_CMD_JFFS2
> > #define CONFIG_CMD_MTDPARTS"

If this is an exact copy, then please remove this '"'

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If you're not part of the solution, then you're part of the  precipi-
tate.

  reply	other threads:[~2012-12-21 23:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-20 23:53 [U-Boot] no mtdparted from U-Boot> prompt johns at msli.com
2012-12-21  9:59 ` Bo Shen
2012-12-21 18:29   ` johns at msli.com
2012-12-21 22:53     ` John Stile
2012-12-21 23:13       ` Wolfgang Denk [this message]
2012-12-22  0:00         ` John Stile
2012-12-22  8:04           ` Anatolij Gustschin

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=20121221231341.39F5F201213@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.