xref: /linux/drivers/mtd/parsers/Kconfig (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
211f74023SLinus Walleijconfig MTD_BCM47XX_PARTS
311f74023SLinus Walleij	tristate "BCM47XX partitioning parser"
411f74023SLinus Walleij	depends on BCM47XX || ARCH_BCM_5301X
511f74023SLinus Walleij	help
611f74023SLinus Walleij	  This provides partitions parser for devices based on BCM47xx
711f74023SLinus Walleij	  boards.
811f74023SLinus Walleij
9ac37d352SLinus Walleijconfig MTD_BCM63XX_PARTS
10b597cc75SFlorian Fainelli	bool "BCM63XX CFE partitioning parser"
11ac37d352SLinus Walleij	depends on BCM63XX || BMIPS_GENERIC || COMPILE_TEST
12ac37d352SLinus Walleij	select CRC32
13ac37d352SLinus Walleij	select MTD_PARSER_IMAGETAG
14ac37d352SLinus Walleij	help
15ac37d352SLinus Walleij	  This provides partition parsing for BCM63xx devices with CFE
16ac37d352SLinus Walleij	  bootloaders.
17ac37d352SLinus Walleij
18002181f5SRafał Miłeckiconfig MTD_BRCM_U_BOOT
19002181f5SRafał Miłecki	tristate "Broadcom's U-Boot partition parser"
20085679b1SLukas Bulwahn	depends on ARCH_BCMBCA || COMPILE_TEST
21002181f5SRafał Miłecki	help
22002181f5SRafał Miłecki	  Broadcom uses a custom way of storing U-Boot environment variables.
23002181f5SRafał Miłecki	  They are placed inside U-Boot partition itself at unspecified offset.
24002181f5SRafał Miłecki	  It's possible to locate them by looking for a custom header with a
25002181f5SRafał Miłecki	  magic value. This driver does that and creates subpartitions for
26002181f5SRafał Miłecki	  each found environment variables block.
27002181f5SRafał Miłecki
28a3f12a35SLinus Walleijconfig MTD_CMDLINE_PARTS
29a3f12a35SLinus Walleij	tristate "Command line partition table parsing"
30a3f12a35SLinus Walleij	depends on MTD
31a3f12a35SLinus Walleij	help
32a3f12a35SLinus Walleij	  Allow generic configuration of the MTD partition tables via the kernel
33a3f12a35SLinus Walleij	  command line. Multiple flash resources are supported for hardware where
34a3f12a35SLinus Walleij	  different kinds of flash memory are available.
35a3f12a35SLinus Walleij
36a3f12a35SLinus Walleij	  You will still need the parsing functions to be called by the driver
37a3f12a35SLinus Walleij	  for your particular device. It won't happen automatically. The
38a3f12a35SLinus Walleij	  SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for
39a3f12a35SLinus Walleij	  example.
40a3f12a35SLinus Walleij
41a3f12a35SLinus Walleij	  The format for the command line is as follows:
42a3f12a35SLinus Walleij
43a3f12a35SLinus Walleij	  mtdparts=<mtddef>[;<mtddef]
44a3f12a35SLinus Walleij	  <mtddef>  := <mtd-id>:<partdef>[,<partdef>]
45a3f12a35SLinus Walleij	  <partdef> := <size>[@offset][<name>][ro]
46a3f12a35SLinus Walleij	  <mtd-id>  := unique id used in mapping driver/device
47a3f12a35SLinus Walleij	  <size>    := standard linux memsize OR "-" to denote all
48a3f12a35SLinus Walleij	  remaining space
49a3f12a35SLinus Walleij	  <name>    := (NAME)
50a3f12a35SLinus Walleij
51a3f12a35SLinus Walleij	  Due to the way Linux handles the command line, no spaces are
52a3f12a35SLinus Walleij	  allowed in the partition definition, including mtd id's and partition
53a3f12a35SLinus Walleij	  names.
54a3f12a35SLinus Walleij
55a3f12a35SLinus Walleij	  Examples:
56a3f12a35SLinus Walleij
57a3f12a35SLinus Walleij	  1 flash resource (mtd-id "sa1100"), with 1 single writable partition:
58a3f12a35SLinus Walleij	  mtdparts=sa1100:-
59a3f12a35SLinus Walleij
60a3f12a35SLinus Walleij	  Same flash, but 2 named partitions, the first one being read-only:
61a3f12a35SLinus Walleij	  mtdparts=sa1100:256k(ARMboot)ro,-(root)
62a3f12a35SLinus Walleij
63a3f12a35SLinus Walleij	  If unsure, say 'N'.
64a3f12a35SLinus Walleij
65c5da56f7SLinus Walleijconfig MTD_OF_PARTS
66c5da56f7SLinus Walleij	tristate "OpenFirmware (device tree) partitioning parser"
67c5da56f7SLinus Walleij	default y
68c5da56f7SLinus Walleij	depends on OF
69c5da56f7SLinus Walleij	help
70c5da56f7SLinus Walleij	  This provides a open firmware device tree partition parser
71c5da56f7SLinus Walleij	  which derives the partition map from the children of the
72c5da56f7SLinus Walleij	  flash memory node, as described in
73f902baa9SMiquel Raynal	  Documentation/devicetree/bindings/mtd/mtd.yaml.
74c5da56f7SLinus Walleij
75bb17230cSRafał Miłeckiconfig MTD_OF_PARTS_BCM4908
76bb17230cSRafał Miłecki	bool "BCM4908 partitioning support"
777bb49d77SWilliam Zhang	depends on MTD_OF_PARTS && (ARCH_BCMBCA || COMPILE_TEST)
787bb49d77SWilliam Zhang	default ARCH_BCMBCA
79bb17230cSRafał Miłecki	help
80bb17230cSRafał Miłecki	  This provides partitions parser for BCM4908 family devices
81bb17230cSRafał Miłecki	  that can have multiple "firmware" partitions. It takes care of
82bb17230cSRafał Miłecki	  finding currently used one and backup ones.
83bb17230cSRafał Miłecki
847134a2d0SRafał Miłeckiconfig MTD_OF_PARTS_LINKSYS_NS
857134a2d0SRafał Miłecki	bool "Linksys Northstar partitioning support"
867bb49d77SWilliam Zhang	depends on MTD_OF_PARTS && (ARCH_BCM_5301X || ARCH_BCMBCA || COMPILE_TEST)
877134a2d0SRafał Miłecki	default ARCH_BCM_5301X
887134a2d0SRafał Miłecki	help
897134a2d0SRafał Miłecki	  This provides partitions parser for Linksys devices based on Broadcom
907134a2d0SRafał Miłecki	  Northstar architecture. Linksys commonly uses fixed flash layout with
917134a2d0SRafał Miłecki	  two "firmware" partitions. Currently used firmware has to be detected
927134a2d0SRafał Miłecki	  using CFE environment variable.
937134a2d0SRafał Miłecki
94dd84cb02SJonas Gorskiconfig MTD_PARSER_IMAGETAG
95dd84cb02SJonas Gorski	tristate "Parser for BCM963XX Image Tag format partitions"
96dd84cb02SJonas Gorski	depends on BCM63XX || BMIPS_GENERIC || COMPILE_TEST
97dd84cb02SJonas Gorski	select CRC32
98dd84cb02SJonas Gorski	help
99dd84cb02SJonas Gorski	  Image Tag is the firmware header used by broadcom on their xDSL line
100dd84cb02SJonas Gorski	  of devices. It is used to describe the offsets and lengths of kernel
101dd84cb02SJonas Gorski	  and rootfs partitions.
102dd84cb02SJonas Gorski	  This driver adds support for parsing a partition with an Image Tag
103dd84cb02SJonas Gorski	  header and creates up to two partitions, kernel and rootfs.
104dd84cb02SJonas Gorski
1052aa3b8e1SLinus Walleijconfig MTD_AFS_PARTS
1062aa3b8e1SLinus Walleij	tristate "ARM Firmware Suite partition parsing"
1072aa3b8e1SLinus Walleij	depends on (ARM || ARM64)
1082aa3b8e1SLinus Walleij	help
1092aa3b8e1SLinus Walleij	  The ARM Firmware Suite allows the user to divide flash devices into
1102aa3b8e1SLinus Walleij	  multiple 'images'. Each such image has a header containing its name
1112aa3b8e1SLinus Walleij	  and offset/size etc.
1122aa3b8e1SLinus Walleij
1132aa3b8e1SLinus Walleij	  If you need code which can detect and parse these tables, and
1142aa3b8e1SLinus Walleij	  register MTD 'partitions' corresponding to each image detected,
1152aa3b8e1SLinus Walleij	  enable this option.
1162aa3b8e1SLinus Walleij
1172aa3b8e1SLinus Walleij	  You will still need the parsing functions to be called by the driver
1182aa3b8e1SLinus Walleij	  for your particular device. It won't happen automatically. The
1192aa3b8e1SLinus Walleij	  'physmap' map driver (CONFIG_MTD_PHYSMAP) does this, for example.
1202aa3b8e1SLinus Walleij
12100a35880SRafał Miłeckiconfig MTD_PARSER_TPLINK_SAFELOADER
12200a35880SRafał Miłecki	tristate "TP-Link Safeloader partitions parser"
12300a35880SRafał Miłecki	depends on MTD && (ARCH_BCM_5301X || ATH79 || SOC_MT7620 || SOC_MT7621 || COMPILE_TEST)
12400a35880SRafał Miłecki	help
12500a35880SRafał Miłecki	  TP-Link home routers use flash partitions to store various data. Info
12600a35880SRafał Miłecki	  about flash space layout is stored in a partitions table using a
12700a35880SRafał Miłecki	  custom ASCII-based format.
12800a35880SRafał Miłecki
12900a35880SRafał Miłecki	  That format was first found in devices with SafeLoader bootloader and
13000a35880SRafał Miłecki	  was named after it. Later it was adapted to CFE and U-Boot
13100a35880SRafał Miłecki	  bootloaders.
13200a35880SRafał Miłecki
13300a35880SRafał Miłecki	  This driver reads partitions table, parses it and creates MTD
13400a35880SRafał Miłecki	  partitions.
13500a35880SRafał Miłecki
13699352afeSRafał Miłeckiconfig MTD_PARSER_TRX
13799352afeSRafał Miłecki	tristate "Parser for TRX format partitions"
1382365f91cSINAGAKI Hiroshi	depends on MTD && (BCM47XX || ARCH_BCM_5301X || ARCH_MEDIATEK || RALINK || COMPILE_TEST)
13999352afeSRafał Miłecki	help
14099352afeSRafał Miłecki	  TRX is a firmware format used by Broadcom on their devices. It
14199352afeSRafał Miłecki	  may contain up to 3/4 partitions (depending on the version).
14299352afeSRafał Miłecki	  This driver will parse TRX header and report at least two partitions:
14399352afeSRafał Miłecki	  kernel and rootfs.
1448a4580e4SAndrea Adami
1458a4580e4SAndrea Adamiconfig MTD_SHARPSL_PARTS
1468a4580e4SAndrea Adami	tristate "Sharp SL Series NAND flash partition parser"
147*4080d536SLukas Bulwahn	depends on MTD_NAND_SHARPSL || COMPILE_TEST
1488a4580e4SAndrea Adami	help
1498a4580e4SAndrea Adami	  This provides the read-only FTL logic necessary to read the partition
1508a4580e4SAndrea Adami	  table from the NAND flash of Sharp SL Series (Zaurus) and the MTD
1518a4580e4SAndrea Adami	  partition parser using this code.
15243f1fd01SLinus Walleij
15343f1fd01SLinus Walleijconfig MTD_REDBOOT_PARTS
15443f1fd01SLinus Walleij	tristate "RedBoot partition table parsing"
15543f1fd01SLinus Walleij	help
15643f1fd01SLinus Walleij	  RedBoot is a ROM monitor and bootloader which deals with multiple
15743f1fd01SLinus Walleij	  'images' in flash devices by putting a table one of the erase
15843f1fd01SLinus Walleij	  blocks on the device, similar to a partition table, which gives
15943f1fd01SLinus Walleij	  the offsets, lengths and names of all the images stored in the
16043f1fd01SLinus Walleij	  flash.
16143f1fd01SLinus Walleij
16243f1fd01SLinus Walleij	  If you need code which can detect and parse this table, and register
16343f1fd01SLinus Walleij	  MTD 'partitions' corresponding to each image in the table, enable
16443f1fd01SLinus Walleij	  this option.
16543f1fd01SLinus Walleij
16643f1fd01SLinus Walleij	  You will still need the parsing functions to be called by the driver
16743f1fd01SLinus Walleij	  for your particular device. It won't happen automatically. The
16843f1fd01SLinus Walleij	  SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for
16943f1fd01SLinus Walleij	  example.
17043f1fd01SLinus Walleij
17143f1fd01SLinus Walleijif MTD_REDBOOT_PARTS
17243f1fd01SLinus Walleij
17343f1fd01SLinus Walleijconfig MTD_REDBOOT_DIRECTORY_BLOCK
17443f1fd01SLinus Walleij	int "Location of RedBoot partition table"
17543f1fd01SLinus Walleij	default "-1"
17643f1fd01SLinus Walleij	help
17743f1fd01SLinus Walleij	  This option is the Linux counterpart to the
17843f1fd01SLinus Walleij	  CYGNUM_REDBOOT_FIS_DIRECTORY_BLOCK RedBoot compile time
17943f1fd01SLinus Walleij	  option.
18043f1fd01SLinus Walleij
18143f1fd01SLinus Walleij	  The option specifies which Flash sectors holds the RedBoot
18243f1fd01SLinus Walleij	  partition table.  A zero or positive value gives an absolute
18343f1fd01SLinus Walleij	  erase block number. A negative value specifies a number of
18443f1fd01SLinus Walleij	  sectors before the end of the device.
18543f1fd01SLinus Walleij
18643f1fd01SLinus Walleij	  For example "2" means block number 2, "-1" means the last
18743f1fd01SLinus Walleij	  block and "-2" means the penultimate block.
18843f1fd01SLinus Walleij
18943f1fd01SLinus Walleijconfig MTD_REDBOOT_PARTS_UNALLOCATED
19043f1fd01SLinus Walleij	bool "Include unallocated flash regions"
19143f1fd01SLinus Walleij	help
19243f1fd01SLinus Walleij	  If you need to register each unallocated flash region as a MTD
19343f1fd01SLinus Walleij	  'partition', enable this option.
19443f1fd01SLinus Walleij
19543f1fd01SLinus Walleijconfig MTD_REDBOOT_PARTS_READONLY
19643f1fd01SLinus Walleij	bool "Force read-only for RedBoot system images"
19743f1fd01SLinus Walleij	help
19843f1fd01SLinus Walleij	  If you need to force read-only for 'RedBoot', 'RedBoot Config' and
19943f1fd01SLinus Walleij	  'FIS directory' images, enable this option.
20043f1fd01SLinus Walleij
20143f1fd01SLinus Walleijendif # MTD_REDBOOT_PARTS
202803eb124SManivannan Sadhasivam
203803eb124SManivannan Sadhasivamconfig MTD_QCOMSMEM_PARTS
2041ca890d3SBaruch Siach	tristate "Qualcomm SMEM flash partition parser"
205803eb124SManivannan Sadhasivam	depends on QCOM_SMEM
206803eb124SManivannan Sadhasivam	help
207803eb124SManivannan Sadhasivam	  This provides support for parsing partitions from Shared Memory (SMEM)
2081ca890d3SBaruch Siach	  for NAND and SPI flash on Qualcomm platforms.
2099b78ef0cSMikhail Zhilkin
2109b78ef0cSMikhail Zhilkinconfig MTD_SERCOMM_PARTS
2119b78ef0cSMikhail Zhilkin	tristate "Sercomm partition table parser"
2129b78ef0cSMikhail Zhilkin	depends on MTD && RALINK
2139b78ef0cSMikhail Zhilkin	help
2149b78ef0cSMikhail Zhilkin	  This provides partitions table parser for devices with Sercomm
2159b78ef0cSMikhail Zhilkin	  partition map. This partition table contains real partition
2169b78ef0cSMikhail Zhilkin	  offsets, which may differ from device to device depending on the
2179b78ef0cSMikhail Zhilkin	  number and location of bad blocks on NAND.
218