Uboot uses the kernel Command Line Dynamic partition config_mtd_cmdline_parts

Source: Internet
Author: User
General informations

The Linux Kernel configuration itemConfig_mtd_cmdline_partsHas multiple definitions:

Drivers/MTD/kconfig

The configuration item config_mtd_cmdline_parts:

    • Prompt: Command Line Partition Table Parsing
    • Type: tristate
    • Depends on:Config_mtd_partitions = "Y" & config_mtd = "Y"
    • Defined in drivers/MTD/kconfig
    • Found in linux kernels: From 2.6.0 release still available on 2.6.39 release
    • Module created:Cmdlinepart
Help text

Allow generic configuration of the MTD partition tables via the kernel command line. Multiple flash resources are supported for hardware where different kinds of flash memory are available.

You will still need the parsing functions to be called by the driver for your particle device. it won't happen automatically. the sa1100 map Driver (config_mtd_sa1100) has an option for this, for example.

The format for the command line is as follows:

Mtdparts = <mtddef> [; <mtddef] <mtddef >:=< MTD-ID >:< partdef> [, <partdef>] <partdef>: = <size> [@ offset] [<Name>] [Ro] <MTD-ID >:= unique ID used in mapping driver/device <size>: = standard Linux memsize or "-" to denote all remaining space <name >:= (name)

Due to the way Linux handles the command line,No spaces are allowed in the partition definition (spaces are not allowed in the middle), Including mtd id's and partition names.

Examples:

1 flash Resource (MTD-ID "sa1100"), with 1 single writable partition: mtdparts = sa1100 :-

Same flash, but 2 named partitions, the first one being read-only: mtdparts = sa1100: 256 K (armboot) Ro,-(Root)

If unsure, say 'n '.

 

1. uboot $ mtdparts and Linux/dev/MTD *
For example:
Uboot: # setenv mtdparts 'mtdparts = nx_2016: 1408k @ 0 K (BOOT), 128k @ 1408 K (ENV),-(extra); nx_2017: 16 m (k0 ), 16 m (K1),-(nandextra )'
Linux: # Cat/proc/MTD
Dev: Size erasesize name
Mtd0: 00160000 00010000 "Boot"
Mtd1: 00020000 00010000 "env"
Mtd2: 00280000 00010000 "extra"
Mtd3: 00400000 00010000 "nx_2016"
Mtd4: 04000000 00004000 "nx_2017"
Mtd5: 01000000 00004000 "K0"
Mtd6: 01000000 00004000 "K1"
Mtd7: 02000000 00004000 "nandextra"

 

 

There are several questions:

1. <MTD-ID >:= unique ID used in mapping driver/Device?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.