162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_ciconfig MTD_AR7_PARTS
362306a36Sopenharmony_ci	tristate "TI AR7 partitioning parser"
462306a36Sopenharmony_ci	help
562306a36Sopenharmony_ci	  TI AR7 partitioning parser support
662306a36Sopenharmony_ci
762306a36Sopenharmony_ciconfig MTD_BCM47XX_PARTS
862306a36Sopenharmony_ci	tristate "BCM47XX partitioning parser"
962306a36Sopenharmony_ci	depends on BCM47XX || ARCH_BCM_5301X
1062306a36Sopenharmony_ci	help
1162306a36Sopenharmony_ci	  This provides partitions parser for devices based on BCM47xx
1262306a36Sopenharmony_ci	  boards.
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ciconfig MTD_BCM63XX_PARTS
1562306a36Sopenharmony_ci	bool "BCM63XX CFE partitioning parser"
1662306a36Sopenharmony_ci	depends on BCM63XX || BMIPS_GENERIC || COMPILE_TEST
1762306a36Sopenharmony_ci	select CRC32
1862306a36Sopenharmony_ci	select MTD_PARSER_IMAGETAG
1962306a36Sopenharmony_ci	help
2062306a36Sopenharmony_ci	  This provides partition parsing for BCM63xx devices with CFE
2162306a36Sopenharmony_ci	  bootloaders.
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ciconfig MTD_BRCM_U_BOOT
2462306a36Sopenharmony_ci	tristate "Broadcom's U-Boot partition parser"
2562306a36Sopenharmony_ci	depends on ARCH_BCMBCA || COMPILE_TEST
2662306a36Sopenharmony_ci	help
2762306a36Sopenharmony_ci	  Broadcom uses a custom way of storing U-Boot environment variables.
2862306a36Sopenharmony_ci	  They are placed inside U-Boot partition itself at unspecified offset.
2962306a36Sopenharmony_ci	  It's possible to locate them by looking for a custom header with a
3062306a36Sopenharmony_ci	  magic value. This driver does that and creates subpartitions for
3162306a36Sopenharmony_ci	  each found environment variables block.
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ciconfig MTD_CMDLINE_PARTS
3462306a36Sopenharmony_ci	tristate "Command line partition table parsing"
3562306a36Sopenharmony_ci	depends on MTD
3662306a36Sopenharmony_ci	help
3762306a36Sopenharmony_ci	  Allow generic configuration of the MTD partition tables via the kernel
3862306a36Sopenharmony_ci	  command line. Multiple flash resources are supported for hardware where
3962306a36Sopenharmony_ci	  different kinds of flash memory are available.
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci	  You will still need the parsing functions to be called by the driver
4262306a36Sopenharmony_ci	  for your particular device. It won't happen automatically. The
4362306a36Sopenharmony_ci	  SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for
4462306a36Sopenharmony_ci	  example.
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci	  The format for the command line is as follows:
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci	  mtdparts=<mtddef>[;<mtddef]
4962306a36Sopenharmony_ci	  <mtddef>  := <mtd-id>:<partdef>[,<partdef>]
5062306a36Sopenharmony_ci	  <partdef> := <size>[@offset][<name>][ro]
5162306a36Sopenharmony_ci	  <mtd-id>  := unique id used in mapping driver/device
5262306a36Sopenharmony_ci	  <size>    := standard linux memsize OR "-" to denote all
5362306a36Sopenharmony_ci	  remaining space
5462306a36Sopenharmony_ci	  <name>    := (NAME)
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci	  Due to the way Linux handles the command line, no spaces are
5762306a36Sopenharmony_ci	  allowed in the partition definition, including mtd id's and partition
5862306a36Sopenharmony_ci	  names.
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ci	  Examples:
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci	  1 flash resource (mtd-id "sa1100"), with 1 single writable partition:
6362306a36Sopenharmony_ci	  mtdparts=sa1100:-
6462306a36Sopenharmony_ci
6562306a36Sopenharmony_ci	  Same flash, but 2 named partitions, the first one being read-only:
6662306a36Sopenharmony_ci	  mtdparts=sa1100:256k(ARMboot)ro,-(root)
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci	  If unsure, say 'N'.
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ciconfig MTD_OF_PARTS
7162306a36Sopenharmony_ci	tristate "OpenFirmware (device tree) partitioning parser"
7262306a36Sopenharmony_ci	default y
7362306a36Sopenharmony_ci	depends on OF
7462306a36Sopenharmony_ci	help
7562306a36Sopenharmony_ci	  This provides a open firmware device tree partition parser
7662306a36Sopenharmony_ci	  which derives the partition map from the children of the
7762306a36Sopenharmony_ci	  flash memory node, as described in
7862306a36Sopenharmony_ci	  Documentation/devicetree/bindings/mtd/mtd.yaml.
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ciconfig MTD_OF_PARTS_BCM4908
8162306a36Sopenharmony_ci	bool "BCM4908 partitioning support"
8262306a36Sopenharmony_ci	depends on MTD_OF_PARTS && (ARCH_BCMBCA || COMPILE_TEST)
8362306a36Sopenharmony_ci	default ARCH_BCMBCA
8462306a36Sopenharmony_ci	help
8562306a36Sopenharmony_ci	  This provides partitions parser for BCM4908 family devices
8662306a36Sopenharmony_ci	  that can have multiple "firmware" partitions. It takes care of
8762306a36Sopenharmony_ci	  finding currently used one and backup ones.
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ciconfig MTD_OF_PARTS_LINKSYS_NS
9062306a36Sopenharmony_ci	bool "Linksys Northstar partitioning support"
9162306a36Sopenharmony_ci	depends on MTD_OF_PARTS && (ARCH_BCM_5301X || ARCH_BCMBCA || COMPILE_TEST)
9262306a36Sopenharmony_ci	default ARCH_BCM_5301X
9362306a36Sopenharmony_ci	help
9462306a36Sopenharmony_ci	  This provides partitions parser for Linksys devices based on Broadcom
9562306a36Sopenharmony_ci	  Northstar architecture. Linksys commonly uses fixed flash layout with
9662306a36Sopenharmony_ci	  two "firmware" partitions. Currently used firmware has to be detected
9762306a36Sopenharmony_ci	  using CFE environment variable.
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ciconfig MTD_PARSER_IMAGETAG
10062306a36Sopenharmony_ci	tristate "Parser for BCM963XX Image Tag format partitions"
10162306a36Sopenharmony_ci	depends on BCM63XX || BMIPS_GENERIC || COMPILE_TEST
10262306a36Sopenharmony_ci	select CRC32
10362306a36Sopenharmony_ci	help
10462306a36Sopenharmony_ci	  Image Tag is the firmware header used by broadcom on their xDSL line
10562306a36Sopenharmony_ci	  of devices. It is used to describe the offsets and lengths of kernel
10662306a36Sopenharmony_ci	  and rootfs partitions.
10762306a36Sopenharmony_ci	  This driver adds support for parsing a partition with an Image Tag
10862306a36Sopenharmony_ci	  header and creates up to two partitions, kernel and rootfs.
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ciconfig MTD_AFS_PARTS
11162306a36Sopenharmony_ci	tristate "ARM Firmware Suite partition parsing"
11262306a36Sopenharmony_ci	depends on (ARM || ARM64)
11362306a36Sopenharmony_ci	help
11462306a36Sopenharmony_ci	  The ARM Firmware Suite allows the user to divide flash devices into
11562306a36Sopenharmony_ci	  multiple 'images'. Each such image has a header containing its name
11662306a36Sopenharmony_ci	  and offset/size etc.
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci	  If you need code which can detect and parse these tables, and
11962306a36Sopenharmony_ci	  register MTD 'partitions' corresponding to each image detected,
12062306a36Sopenharmony_ci	  enable this option.
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ci	  You will still need the parsing functions to be called by the driver
12362306a36Sopenharmony_ci	  for your particular device. It won't happen automatically. The
12462306a36Sopenharmony_ci	  'physmap' map driver (CONFIG_MTD_PHYSMAP) does this, for example.
12562306a36Sopenharmony_ci
12662306a36Sopenharmony_ciconfig MTD_PARSER_TPLINK_SAFELOADER
12762306a36Sopenharmony_ci	tristate "TP-Link Safeloader partitions parser"
12862306a36Sopenharmony_ci	depends on MTD && (ARCH_BCM_5301X || ATH79 || SOC_MT7620 || SOC_MT7621 || COMPILE_TEST)
12962306a36Sopenharmony_ci	help
13062306a36Sopenharmony_ci	  TP-Link home routers use flash partitions to store various data. Info
13162306a36Sopenharmony_ci	  about flash space layout is stored in a partitions table using a
13262306a36Sopenharmony_ci	  custom ASCII-based format.
13362306a36Sopenharmony_ci
13462306a36Sopenharmony_ci	  That format was first found in devices with SafeLoader bootloader and
13562306a36Sopenharmony_ci	  was named after it. Later it was adapted to CFE and U-Boot
13662306a36Sopenharmony_ci	  bootloaders.
13762306a36Sopenharmony_ci
13862306a36Sopenharmony_ci	  This driver reads partitions table, parses it and creates MTD
13962306a36Sopenharmony_ci	  partitions.
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_ciconfig MTD_PARSER_TRX
14262306a36Sopenharmony_ci	tristate "Parser for TRX format partitions"
14362306a36Sopenharmony_ci	depends on MTD && (BCM47XX || ARCH_BCM_5301X || ARCH_MEDIATEK || RALINK || COMPILE_TEST)
14462306a36Sopenharmony_ci	help
14562306a36Sopenharmony_ci	  TRX is a firmware format used by Broadcom on their devices. It
14662306a36Sopenharmony_ci	  may contain up to 3/4 partitions (depending on the version).
14762306a36Sopenharmony_ci	  This driver will parse TRX header and report at least two partitions:
14862306a36Sopenharmony_ci	  kernel and rootfs.
14962306a36Sopenharmony_ci
15062306a36Sopenharmony_ciconfig MTD_SHARPSL_PARTS
15162306a36Sopenharmony_ci	tristate "Sharp SL Series NAND flash partition parser"
15262306a36Sopenharmony_ci	depends on MTD_NAND_SHARPSL || COMPILE_TEST
15362306a36Sopenharmony_ci	help
15462306a36Sopenharmony_ci	  This provides the read-only FTL logic necessary to read the partition
15562306a36Sopenharmony_ci	  table from the NAND flash of Sharp SL Series (Zaurus) and the MTD
15662306a36Sopenharmony_ci	  partition parser using this code.
15762306a36Sopenharmony_ci
15862306a36Sopenharmony_ciconfig MTD_REDBOOT_PARTS
15962306a36Sopenharmony_ci	tristate "RedBoot partition table parsing"
16062306a36Sopenharmony_ci	help
16162306a36Sopenharmony_ci	  RedBoot is a ROM monitor and bootloader which deals with multiple
16262306a36Sopenharmony_ci	  'images' in flash devices by putting a table one of the erase
16362306a36Sopenharmony_ci	  blocks on the device, similar to a partition table, which gives
16462306a36Sopenharmony_ci	  the offsets, lengths and names of all the images stored in the
16562306a36Sopenharmony_ci	  flash.
16662306a36Sopenharmony_ci
16762306a36Sopenharmony_ci	  If you need code which can detect and parse this table, and register
16862306a36Sopenharmony_ci	  MTD 'partitions' corresponding to each image in the table, enable
16962306a36Sopenharmony_ci	  this option.
17062306a36Sopenharmony_ci
17162306a36Sopenharmony_ci	  You will still need the parsing functions to be called by the driver
17262306a36Sopenharmony_ci	  for your particular device. It won't happen automatically. The
17362306a36Sopenharmony_ci	  SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for
17462306a36Sopenharmony_ci	  example.
17562306a36Sopenharmony_ci
17662306a36Sopenharmony_ciif MTD_REDBOOT_PARTS
17762306a36Sopenharmony_ci
17862306a36Sopenharmony_ciconfig MTD_REDBOOT_DIRECTORY_BLOCK
17962306a36Sopenharmony_ci	int "Location of RedBoot partition table"
18062306a36Sopenharmony_ci	default "-1"
18162306a36Sopenharmony_ci	help
18262306a36Sopenharmony_ci	  This option is the Linux counterpart to the
18362306a36Sopenharmony_ci	  CYGNUM_REDBOOT_FIS_DIRECTORY_BLOCK RedBoot compile time
18462306a36Sopenharmony_ci	  option.
18562306a36Sopenharmony_ci
18662306a36Sopenharmony_ci	  The option specifies which Flash sectors holds the RedBoot
18762306a36Sopenharmony_ci	  partition table.  A zero or positive value gives an absolute
18862306a36Sopenharmony_ci	  erase block number. A negative value specifies a number of
18962306a36Sopenharmony_ci	  sectors before the end of the device.
19062306a36Sopenharmony_ci
19162306a36Sopenharmony_ci	  For example "2" means block number 2, "-1" means the last
19262306a36Sopenharmony_ci	  block and "-2" means the penultimate block.
19362306a36Sopenharmony_ci
19462306a36Sopenharmony_ciconfig MTD_REDBOOT_PARTS_UNALLOCATED
19562306a36Sopenharmony_ci	bool "Include unallocated flash regions"
19662306a36Sopenharmony_ci	help
19762306a36Sopenharmony_ci	  If you need to register each unallocated flash region as a MTD
19862306a36Sopenharmony_ci	  'partition', enable this option.
19962306a36Sopenharmony_ci
20062306a36Sopenharmony_ciconfig MTD_REDBOOT_PARTS_READONLY
20162306a36Sopenharmony_ci	bool "Force read-only for RedBoot system images"
20262306a36Sopenharmony_ci	help
20362306a36Sopenharmony_ci	  If you need to force read-only for 'RedBoot', 'RedBoot Config' and
20462306a36Sopenharmony_ci	  'FIS directory' images, enable this option.
20562306a36Sopenharmony_ci
20662306a36Sopenharmony_ciendif # MTD_REDBOOT_PARTS
20762306a36Sopenharmony_ci
20862306a36Sopenharmony_ciconfig MTD_QCOMSMEM_PARTS
20962306a36Sopenharmony_ci	tristate "Qualcomm SMEM flash partition parser"
21062306a36Sopenharmony_ci	depends on QCOM_SMEM
21162306a36Sopenharmony_ci	help
21262306a36Sopenharmony_ci	  This provides support for parsing partitions from Shared Memory (SMEM)
21362306a36Sopenharmony_ci	  for NAND and SPI flash on Qualcomm platforms.
21462306a36Sopenharmony_ci
21562306a36Sopenharmony_ciconfig MTD_SERCOMM_PARTS
21662306a36Sopenharmony_ci	tristate "Sercomm partition table parser"
21762306a36Sopenharmony_ci	depends on MTD && RALINK
21862306a36Sopenharmony_ci	help
21962306a36Sopenharmony_ci	  This provides partitions table parser for devices with Sercomm
22062306a36Sopenharmony_ci	  partition map. This partition table contains real partition
22162306a36Sopenharmony_ci	  offsets, which may differ from device to device depending on the
22262306a36Sopenharmony_ci	  number and location of bad blocks on NAND.
223