xref: /openbmc/linux/drivers/mtd/parsers/Kconfig (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
25a4a335aSLinus Walleijconfig MTD_AR7_PARTS
35a4a335aSLinus Walleij	tristate "TI AR7 partitioning parser"
45a4a335aSLinus Walleij	help
55a4a335aSLinus Walleij	  TI AR7 partitioning parser support
65a4a335aSLinus Walleij
711f74023SLinus Walleijconfig MTD_BCM47XX_PARTS
811f74023SLinus Walleij	tristate "BCM47XX partitioning parser"
911f74023SLinus Walleij	depends on BCM47XX || ARCH_BCM_5301X
1011f74023SLinus Walleij	help
1111f74023SLinus Walleij	  This provides partitions parser for devices based on BCM47xx
1211f74023SLinus Walleij	  boards.
1311f74023SLinus Walleij
14ac37d352SLinus Walleijconfig MTD_BCM63XX_PARTS
15b597cc75SFlorian Fainelli	bool "BCM63XX CFE partitioning parser"
16ac37d352SLinus Walleij	depends on BCM63XX || BMIPS_GENERIC || COMPILE_TEST
17ac37d352SLinus Walleij	select CRC32
18ac37d352SLinus Walleij	select MTD_PARSER_IMAGETAG
19ac37d352SLinus Walleij	help
20ac37d352SLinus Walleij	  This provides partition parsing for BCM63xx devices with CFE
21ac37d352SLinus Walleij	  bootloaders.
22ac37d352SLinus Walleij
23002181f5SRafał Miłeckiconfig MTD_BRCM_U_BOOT
24002181f5SRafał Miłecki	tristate "Broadcom's U-Boot partition parser"
25085679b1SLukas Bulwahn	depends on ARCH_BCMBCA || COMPILE_TEST
26002181f5SRafał Miłecki	help
27002181f5SRafał Miłecki	  Broadcom uses a custom way of storing U-Boot environment variables.
28002181f5SRafał Miłecki	  They are placed inside U-Boot partition itself at unspecified offset.
29002181f5SRafał Miłecki	  It's possible to locate them by looking for a custom header with a
30002181f5SRafał Miłecki	  magic value. This driver does that and creates subpartitions for
31002181f5SRafał Miłecki	  each found environment variables block.
32002181f5SRafał Miłecki
33a3f12a35SLinus Walleijconfig MTD_CMDLINE_PARTS
34a3f12a35SLinus Walleij	tristate "Command line partition table parsing"
35a3f12a35SLinus Walleij	depends on MTD
36a3f12a35SLinus Walleij	help
37a3f12a35SLinus Walleij	  Allow generic configuration of the MTD partition tables via the kernel
38a3f12a35SLinus Walleij	  command line. Multiple flash resources are supported for hardware where
39a3f12a35SLinus Walleij	  different kinds of flash memory are available.
40a3f12a35SLinus Walleij
41a3f12a35SLinus Walleij	  You will still need the parsing functions to be called by the driver
42a3f12a35SLinus Walleij	  for your particular device. It won't happen automatically. The
43a3f12a35SLinus Walleij	  SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for
44a3f12a35SLinus Walleij	  example.
45a3f12a35SLinus Walleij
46a3f12a35SLinus Walleij	  The format for the command line is as follows:
47a3f12a35SLinus Walleij
48a3f12a35SLinus Walleij	  mtdparts=<mtddef>[;<mtddef]
49a3f12a35SLinus Walleij	  <mtddef>  := <mtd-id>:<partdef>[,<partdef>]
50a3f12a35SLinus Walleij	  <partdef> := <size>[@offset][<name>][ro]
51a3f12a35SLinus Walleij	  <mtd-id>  := unique id used in mapping driver/device
52a3f12a35SLinus Walleij	  <size>    := standard linux memsize OR "-" to denote all
53a3f12a35SLinus Walleij	  remaining space
54a3f12a35SLinus Walleij	  <name>    := (NAME)
55a3f12a35SLinus Walleij
56a3f12a35SLinus Walleij	  Due to the way Linux handles the command line, no spaces are
57a3f12a35SLinus Walleij	  allowed in the partition definition, including mtd id's and partition
58a3f12a35SLinus Walleij	  names.
59a3f12a35SLinus Walleij
60a3f12a35SLinus Walleij	  Examples:
61a3f12a35SLinus Walleij
62a3f12a35SLinus Walleij	  1 flash resource (mtd-id "sa1100"), with 1 single writable partition:
63a3f12a35SLinus Walleij	  mtdparts=sa1100:-
64a3f12a35SLinus Walleij
65a3f12a35SLinus Walleij	  Same flash, but 2 named partitions, the first one being read-only:
66a3f12a35SLinus Walleij	  mtdparts=sa1100:256k(ARMboot)ro,-(root)
67a3f12a35SLinus Walleij
68a3f12a35SLinus Walleij	  If unsure, say 'N'.
69a3f12a35SLinus Walleij
70c5da56f7SLinus Walleijconfig MTD_OF_PARTS
71c5da56f7SLinus Walleij	tristate "OpenFirmware (device tree) partitioning parser"
72c5da56f7SLinus Walleij	default y
73c5da56f7SLinus Walleij	depends on OF
74c5da56f7SLinus Walleij	help
75c5da56f7SLinus Walleij	  This provides a open firmware device tree partition parser
76c5da56f7SLinus Walleij	  which derives the partition map from the children of the
77c5da56f7SLinus Walleij	  flash memory node, as described in
78f902baa9SMiquel Raynal	  Documentation/devicetree/bindings/mtd/mtd.yaml.
79c5da56f7SLinus Walleij
80bb17230cSRafał Miłeckiconfig MTD_OF_PARTS_BCM4908
81bb17230cSRafał Miłecki	bool "BCM4908 partitioning support"
827bb49d77SWilliam Zhang	depends on MTD_OF_PARTS && (ARCH_BCMBCA || COMPILE_TEST)
837bb49d77SWilliam Zhang	default ARCH_BCMBCA
84bb17230cSRafał Miłecki	help
85bb17230cSRafał Miłecki	  This provides partitions parser for BCM4908 family devices
86bb17230cSRafał Miłecki	  that can have multiple "firmware" partitions. It takes care of
87bb17230cSRafał Miłecki	  finding currently used one and backup ones.
88bb17230cSRafał Miłecki
897134a2d0SRafał Miłeckiconfig MTD_OF_PARTS_LINKSYS_NS
907134a2d0SRafał Miłecki	bool "Linksys Northstar partitioning support"
917bb49d77SWilliam Zhang	depends on MTD_OF_PARTS && (ARCH_BCM_5301X || ARCH_BCMBCA || COMPILE_TEST)
927134a2d0SRafał Miłecki	default ARCH_BCM_5301X
937134a2d0SRafał Miłecki	help
947134a2d0SRafał Miłecki	  This provides partitions parser for Linksys devices based on Broadcom
957134a2d0SRafał Miłecki	  Northstar architecture. Linksys commonly uses fixed flash layout with
967134a2d0SRafał Miłecki	  two "firmware" partitions. Currently used firmware has to be detected
977134a2d0SRafał Miłecki	  using CFE environment variable.
987134a2d0SRafał Miłecki
99dd84cb02SJonas Gorskiconfig MTD_PARSER_IMAGETAG
100dd84cb02SJonas Gorski	tristate "Parser for BCM963XX Image Tag format partitions"
101dd84cb02SJonas Gorski	depends on BCM63XX || BMIPS_GENERIC || COMPILE_TEST
102dd84cb02SJonas Gorski	select CRC32
103dd84cb02SJonas Gorski	help
104dd84cb02SJonas Gorski	  Image Tag is the firmware header used by broadcom on their xDSL line
105dd84cb02SJonas Gorski	  of devices. It is used to describe the offsets and lengths of kernel
106dd84cb02SJonas Gorski	  and rootfs partitions.
107dd84cb02SJonas Gorski	  This driver adds support for parsing a partition with an Image Tag
108dd84cb02SJonas Gorski	  header and creates up to two partitions, kernel and rootfs.
109dd84cb02SJonas Gorski
1102aa3b8e1SLinus Walleijconfig MTD_AFS_PARTS
1112aa3b8e1SLinus Walleij	tristate "ARM Firmware Suite partition parsing"
1122aa3b8e1SLinus Walleij	depends on (ARM || ARM64)
1132aa3b8e1SLinus Walleij	help
1142aa3b8e1SLinus Walleij	  The ARM Firmware Suite allows the user to divide flash devices into
1152aa3b8e1SLinus Walleij	  multiple 'images'. Each such image has a header containing its name
1162aa3b8e1SLinus Walleij	  and offset/size etc.
1172aa3b8e1SLinus Walleij
1182aa3b8e1SLinus Walleij	  If you need code which can detect and parse these tables, and
1192aa3b8e1SLinus Walleij	  register MTD 'partitions' corresponding to each image detected,
1202aa3b8e1SLinus Walleij	  enable this option.
1212aa3b8e1SLinus Walleij
1222aa3b8e1SLinus Walleij	  You will still need the parsing functions to be called by the driver
1232aa3b8e1SLinus Walleij	  for your particular device. It won't happen automatically. The
1242aa3b8e1SLinus Walleij	  'physmap' map driver (CONFIG_MTD_PHYSMAP) does this, for example.
1252aa3b8e1SLinus Walleij
12600a35880SRafał Miłeckiconfig MTD_PARSER_TPLINK_SAFELOADER
12700a35880SRafał Miłecki	tristate "TP-Link Safeloader partitions parser"
12800a35880SRafał Miłecki	depends on MTD && (ARCH_BCM_5301X || ATH79 || SOC_MT7620 || SOC_MT7621 || COMPILE_TEST)
12900a35880SRafał Miłecki	help
13000a35880SRafał Miłecki	  TP-Link home routers use flash partitions to store various data. Info
13100a35880SRafał Miłecki	  about flash space layout is stored in a partitions table using a
13200a35880SRafał Miłecki	  custom ASCII-based format.
13300a35880SRafał Miłecki
13400a35880SRafał Miłecki	  That format was first found in devices with SafeLoader bootloader and
13500a35880SRafał Miłecki	  was named after it. Later it was adapted to CFE and U-Boot
13600a35880SRafał Miłecki	  bootloaders.
13700a35880SRafał Miłecki
13800a35880SRafał Miłecki	  This driver reads partitions table, parses it and creates MTD
13900a35880SRafał Miłecki	  partitions.
14000a35880SRafał Miłecki
14199352afeSRafał Miłeckiconfig MTD_PARSER_TRX
14299352afeSRafał Miłecki	tristate "Parser for TRX format partitions"
1432365f91cSINAGAKI Hiroshi	depends on MTD && (BCM47XX || ARCH_BCM_5301X || ARCH_MEDIATEK || RALINK || COMPILE_TEST)
14499352afeSRafał Miłecki	help
14599352afeSRafał Miłecki	  TRX is a firmware format used by Broadcom on their devices. It
14699352afeSRafał Miłecki	  may contain up to 3/4 partitions (depending on the version).
14799352afeSRafał Miłecki	  This driver will parse TRX header and report at least two partitions:
14899352afeSRafał Miłecki	  kernel and rootfs.
1498a4580e4SAndrea Adami
1508a4580e4SAndrea Adamiconfig MTD_SHARPSL_PARTS
1518a4580e4SAndrea Adami	tristate "Sharp SL Series NAND flash partition parser"
152*4080d536SLukas Bulwahn	depends on MTD_NAND_SHARPSL || COMPILE_TEST
1538a4580e4SAndrea Adami	help
1548a4580e4SAndrea Adami	  This provides the read-only FTL logic necessary to read the partition
1558a4580e4SAndrea Adami	  table from the NAND flash of Sharp SL Series (Zaurus) and the MTD
1568a4580e4SAndrea Adami	  partition parser using this code.
15743f1fd01SLinus Walleij
15843f1fd01SLinus Walleijconfig MTD_REDBOOT_PARTS
15943f1fd01SLinus Walleij	tristate "RedBoot partition table parsing"
16043f1fd01SLinus Walleij	help
16143f1fd01SLinus Walleij	  RedBoot is a ROM monitor and bootloader which deals with multiple
16243f1fd01SLinus Walleij	  'images' in flash devices by putting a table one of the erase
16343f1fd01SLinus Walleij	  blocks on the device, similar to a partition table, which gives
16443f1fd01SLinus Walleij	  the offsets, lengths and names of all the images stored in the
16543f1fd01SLinus Walleij	  flash.
16643f1fd01SLinus Walleij
16743f1fd01SLinus Walleij	  If you need code which can detect and parse this table, and register
16843f1fd01SLinus Walleij	  MTD 'partitions' corresponding to each image in the table, enable
16943f1fd01SLinus Walleij	  this option.
17043f1fd01SLinus Walleij
17143f1fd01SLinus Walleij	  You will still need the parsing functions to be called by the driver
17243f1fd01SLinus Walleij	  for your particular device. It won't happen automatically. The
17343f1fd01SLinus Walleij	  SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for
17443f1fd01SLinus Walleij	  example.
17543f1fd01SLinus Walleij
17643f1fd01SLinus Walleijif MTD_REDBOOT_PARTS
17743f1fd01SLinus Walleij
17843f1fd01SLinus Walleijconfig MTD_REDBOOT_DIRECTORY_BLOCK
17943f1fd01SLinus Walleij	int "Location of RedBoot partition table"
18043f1fd01SLinus Walleij	default "-1"
18143f1fd01SLinus Walleij	help
18243f1fd01SLinus Walleij	  This option is the Linux counterpart to the
18343f1fd01SLinus Walleij	  CYGNUM_REDBOOT_FIS_DIRECTORY_BLOCK RedBoot compile time
18443f1fd01SLinus Walleij	  option.
18543f1fd01SLinus Walleij
18643f1fd01SLinus Walleij	  The option specifies which Flash sectors holds the RedBoot
18743f1fd01SLinus Walleij	  partition table.  A zero or positive value gives an absolute
18843f1fd01SLinus Walleij	  erase block number. A negative value specifies a number of
18943f1fd01SLinus Walleij	  sectors before the end of the device.
19043f1fd01SLinus Walleij
19143f1fd01SLinus Walleij	  For example "2" means block number 2, "-1" means the last
19243f1fd01SLinus Walleij	  block and "-2" means the penultimate block.
19343f1fd01SLinus Walleij
19443f1fd01SLinus Walleijconfig MTD_REDBOOT_PARTS_UNALLOCATED
19543f1fd01SLinus Walleij	bool "Include unallocated flash regions"
19643f1fd01SLinus Walleij	help
19743f1fd01SLinus Walleij	  If you need to register each unallocated flash region as a MTD
19843f1fd01SLinus Walleij	  'partition', enable this option.
19943f1fd01SLinus Walleij
20043f1fd01SLinus Walleijconfig MTD_REDBOOT_PARTS_READONLY
20143f1fd01SLinus Walleij	bool "Force read-only for RedBoot system images"
20243f1fd01SLinus Walleij	help
20343f1fd01SLinus Walleij	  If you need to force read-only for 'RedBoot', 'RedBoot Config' and
20443f1fd01SLinus Walleij	  'FIS directory' images, enable this option.
20543f1fd01SLinus Walleij
20643f1fd01SLinus Walleijendif # MTD_REDBOOT_PARTS
207803eb124SManivannan Sadhasivam
208803eb124SManivannan Sadhasivamconfig MTD_QCOMSMEM_PARTS
2091ca890d3SBaruch Siach	tristate "Qualcomm SMEM flash partition parser"
210803eb124SManivannan Sadhasivam	depends on QCOM_SMEM
211803eb124SManivannan Sadhasivam	help
212803eb124SManivannan Sadhasivam	  This provides support for parsing partitions from Shared Memory (SMEM)
2131ca890d3SBaruch Siach	  for NAND and SPI flash on Qualcomm platforms.
2149b78ef0cSMikhail Zhilkin
2159b78ef0cSMikhail Zhilkinconfig MTD_SERCOMM_PARTS
2169b78ef0cSMikhail Zhilkin	tristate "Sercomm partition table parser"
2179b78ef0cSMikhail Zhilkin	depends on MTD && RALINK
2189b78ef0cSMikhail Zhilkin	help
2199b78ef0cSMikhail Zhilkin	  This provides partitions table parser for devices with Sercomm
2209b78ef0cSMikhail Zhilkin	  partition map. This partition table contains real partition
2219b78ef0cSMikhail Zhilkin	  offsets, which may differ from device to device depending on the
2229b78ef0cSMikhail Zhilkin	  number and location of bad blocks on NAND.
223