NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

Get FFS partition configuration

From Texas Instruments Wiki
Jump to: navigation, search

Introduction[edit]

This section assumes that you are using the default partitions specified in the TI kernel drivers. If you are using command line partitions then the address will that of the partition you are creating for your file system. For more information on creating Flash partitions using the command line please see the Kernel Command Line Partition configuration page

NOR Flash Partitions[edit]

To determine the file system start address in NOR flash you can either look at the MTD partitions defined in the driver or the content of /proc/mtd from a running Linux kernel.

Using the Linux Driver[edit]

The NOR partitions for the EVM are defined in the file arch/arm/mach-davinci/board-evm.c. This path is based from the root of the kernel tree. For example if the TI kernel was copied to /home/user/workdir/ti-davinci the NOR partitions would be defined in

/home/user/workdir/ti-davinci/arch/arm/mach-davinci/board-evm.c

NOTE: For some systems there may be a board-<board number>-evm.c file. If that file exists then it should be used instead of the board-evm.c file. For example on the DM355 the Flash partitions are defined in board-dm355-evm.c.

The partitions are defined in the nor_partitions structure. For example the partition definition may look like:

   static struct mtd_partition nor_partitions[] = {
       /* bootloader (U-Boot, etc) in first sector */
       {
             .name             = "bootloader",
             .offset           = 0,
             .size             = SZ_128K,
             .mask_flags       = 0
       },
       /* bootloader params in the next sector */
       {
             .name             = "params",
             .offset           = MTDPART_OFS_APPEND,
             .size             = SZ_128K,
             .mask_flags       = MTD_WRITEABLE, /* force read-only */
       },
       /* kernel */
       {
             .name             = "kernel",
             .offset           = MTDPART_OFS_APPEND,
             .size             = SZ_4M,
             .mask_flags       = 0
       },
       /* file system */
       {
             .name             = "filesystem",
             .offset           = MTDPART_OFS_APPEND,
             .size             = MTDPART_SIZ_FULL,
             .mask_flags       = 0
       }
   };

The size of each partition is set in the .size member of each mtd_partition structure. So in this example we have the following partitions:

  1. bootloader - size 128K
  2. params - size 128K
  3. kernel - size 4M
  4. filesystem - size set to remainder of flash

To determine the start address of the file system partition in flash we will add the sizes of the partitions before it. In this case that is 128K + 128K + 4M = 4352K or 0x440000 bytes. So our file system partition starts at offset 0x440000 bytes.

Using a Linux Booted System[edit]

In this case we will use a Linux system which is booted to a kernel with Flash support enabled and check the contents of /proc/mtd to determine the offset of the file system partition. For more information on enabling Flash support please see the Flash configuration in the Kernel page.

From the command line issue the command

   target$ cat /proc/mtd

You should see output similar to the following:

   dev:    size   erasesize  name
   mtd0: 00020000 00010000 "bootloader"
   mtd1: 00020000 00010000 "params"
   mtd2: 00400000 00010000 "kernel"
   mtd3: 00bc0000 00010000 "filesystem"

The size of each flash partition is the second element in each row of the table. In this example there are 4 partitions with the following sizes:

  1. bootloader - size 0x20000
  2. params - size 0x20000
  3. kernels - size 0x400000
  4. filesystem - size 0xbc0000

To determine the start address of the file system partition in flash we will add the sizes of the partitions before it. In this case that is 0x20000 + 0x20000 + 0x400000 = 0x440000 bytes. So our file system partition starts at offset 0x440000 bytes.

NAND Flash Paritions[edit]

To determine the file system start address in NAND flash you can either look at the MTD partitions defined in the driver or the content of /proc/mtd from a running Linux kernel.

Using the Linux Driver[edit]

The NAND partitions for the EVM are defined in the file arch/arm/mach-davinci/board-evm.c. This path is based from the root of the kernel tree. For example if the TI kernel was copied to /home/user/workdir/ti-davinci the NAND partitions would be defined in

/home/user/workdir/ti-davinci/arch/arm/mach-davinci/board-evm.c

NOTE: For some systems there may be a board-<board number>-evm.c file. If that file exists then it should be used instead of the board-evm.c file. For example on the DM355 the Flash partitions are defined in board-dm355-evm.c.

The partitions are defined in the nand_partitions structure. For example the partition definition may look like:

   static struct mtd_partition nand_partitions[] = {
       /* bootloader (U-Boot, etc) in first sector */
       {
             .name             = "bootloader",
             .offset           = 0,
             .size             = SZ_256K,
             .mask_flags       = MTD_WRITEABLE, /* force read-only */
       },
       /* bootloader params in the next sector */
       {               .name             = "params",
             .offset           = MTDPART_OFS_APPEND,
             .size             = SZ_128K,
             .mask_flags       = MTD_WRITEABLE, /* force read-only */
       },
       /* kernel */
       {
             .name             = "kernel",
             .offset           = MTDPART_OFS_APPEND,
             .size             = SZ_4M,
             .mask_flags       = 0
       },
       /* file system */
       {
             .name             = "filesystem",
             .offset           = MTDPART_OFS_APPEND,
             .size             = MTDPART_SIZ_FULL,
             .mask_flags       = 0
       }
   };

The size of each partition is set in the .size member of each mtd_partition structure. So in this example we have the following partitions:

  1. bootloader - size 256K
  2. params - size 128K
  3. kernel - size 4M
  4. filesystem - size set to remainder of flash

To determine the start address of the file system partition in flash we will add the sizes of the partitions before it. In this case that is 256K + 128K + 4M = 4480K or 0x460000 bytes. So our file system partition starts at offset 0x460000 bytes.

Using a Linux Booted System[edit]

In this case we will use a Linux system which is booted to a kernel with Flash support enabled and check the contents of /proc/mtd to determine the offset of the file system partition. For more information on enabling Flash support please see Flash configuration in the Kernel page.

From the command line issue the command

   target$ cat /proc/mtd

You should see output similar to the following:

   dev:    size   erasesize  name
   mtd0: 00040000 00004000 "bootloader"
   mtd1: 00020000 00004000 "params"
   mtd2: 00400000 00004000 "kernel"
   mtd3: 03ba0000 00004000 "filesystem"

The size of each flash partition is the second element in each row of the table. In this example there are 4 partitions with the following sizes:

  1. bootloader - size 0x40000
  2. params - size 0x20000
  3. kernels - size 0x400000
  4. filesystem - size 0x3ba0000

To determine the start address of the file system partition in flash we will add the sizes of the partitions before it. In this case that is 0x40000 + 0x20000 + 0x400000 = 0x460000 bytes. So our file system partition starts at offset 0x460000 bytes.

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Get FFS partition configuration here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Get FFS partition configuration here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article Get FFS partition configuration here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article Get FFS partition configuration here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article Get FFS partition configuration here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Get FFS partition configuration here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Get FFS partition configuration here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article Get FFS partition configuration here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Get FFS partition configuration here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity