0001 # SPDX-License-Identifier: GPL-2.0
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/mtd/mtd-physmap.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: CFI or JEDEC memory-mapped NOR flash, MTD-RAM (NVRAM...)
0008
0009 maintainers:
0010 - Rob Herring <robh@kernel.org>
0011
0012 description: |
0013 Flash chips (Memory Technology Devices) are often used for solid state
0014 file systems on embedded devices.
0015
0016 properties:
0017 compatible:
0018 oneOf:
0019 - items:
0020 - enum:
0021 - amd,s29gl01gp
0022 - amd,s29gl032a
0023 - amd,s29gl256n
0024 - amd,s29gl512n
0025 - arm,versatile-flash
0026 - arm,vexpress-flash
0027 - cortina,gemini-flash
0028 - cypress,hyperflash
0029 - ge,imp3a-firmware-mirror
0030 - ge,imp3a-paged-flash
0031 - gef,ppc9a-firmware-mirror
0032 - gef,ppc9a-paged-flash
0033 - gef,sbc310-firmware-mirror
0034 - gef,sbc310-paged-flash
0035 - gef,sbc610-firmware-mirror
0036 - gef,sbc610-paged-flash
0037 - intel,28f128j3
0038 - intel,dt28f160
0039 - intel,ixp4xx-flash
0040 - intel,JS28F128
0041 - intel,JS28F640
0042 - intel,PC28F640P30T85
0043 - numonyx,js28f00a
0044 - numonyx,js28f128
0045 - sst,sst39vf320
0046 - xlnx,xps-mch-emc-2.00.a
0047 - enum:
0048 - cfi-flash
0049 - jedec-flash
0050 - items:
0051 - enum:
0052 - cypress,cy7c1019dv33-10zsxi
0053 - arm,vexpress-psram
0054 - const: mtd-ram
0055 - enum:
0056 - cfi-flash
0057 - jedec-flash
0058 - mtd-ram
0059 - mtd-rom
0060
0061 reg:
0062 description: |
0063 It's possible to (optionally) define multiple "reg" tuples so that
0064 non-identical chips can be described in one node.
0065 minItems: 1
0066 maxItems: 8
0067
0068 bank-width:
0069 description: Width (in bytes) of the bank. Equal to the device width times
0070 the number of interleaved chips.
0071 $ref: /schemas/types.yaml#/definitions/uint32
0072 enum: [ 1, 2, 4 ]
0073
0074 device-width:
0075 description:
0076 Width of a single mtd chip. If omitted, assumed to be equal to 'bank-width'.
0077 $ref: /schemas/types.yaml#/definitions/uint32
0078 enum: [ 1, 2 ]
0079
0080 no-unaligned-direct-access:
0081 type: boolean
0082 description: |
0083 Disables the default direct mapping of the flash.
0084
0085 On some platforms (e.g. MPC5200) a direct 1:1 mapping may cause problems
0086 with JFFS2 usage, as the local bus (LPB) doesn't support unaligned
0087 accesses as implemented in the JFFS2 code via memcpy(). By defining
0088 "no-unaligned-direct-access", the flash will not be exposed directly to
0089 the MTD users (e.g. JFFS2) any more.
0090
0091 linux,mtd-name:
0092 description:
0093 Allows specifying the mtd name for retro capability with physmap-flash
0094 drivers as boot loader pass the mtd partition via the old device name
0095 physmap-flash.
0096 $ref: /schemas/types.yaml#/definitions/string
0097
0098 use-advanced-sector-protection:
0099 type: boolean
0100 description: |
0101 Enables support for the advanced sector protection (Spansion: PPB -
0102 Persistent Protection Bits) locking.
0103
0104 erase-size:
0105 description: The chip's physical erase block size in bytes.
0106 $ref: /schemas/types.yaml#/definitions/uint32
0107
0108 addr-gpios:
0109 description:
0110 List of GPIO descriptors that will be used to address the MSBs address
0111 lines. The order goes from LSB to MSB.
0112 minItems: 1
0113 maxItems: 8
0114
0115 '#address-cells':
0116 const: 1
0117
0118 '#size-cells':
0119 const: 1
0120
0121 big-endian: true
0122 little-endian: true
0123
0124 patternProperties:
0125 '@[0-9a-f]+$':
0126 $ref: partitions/partition.yaml
0127
0128 required:
0129 - compatible
0130 - reg
0131
0132 if:
0133 properties:
0134 compatible:
0135 contains:
0136 const: cortina,gemini-flash
0137 then:
0138 properties:
0139 syscon:
0140 $ref: /schemas/types.yaml#/definitions/phandle
0141 description:
0142 Phandle to the syscon controller
0143 required:
0144 - syscon
0145
0146 # FIXME: A parent bus may define timing properties
0147 additionalProperties: true
0148
0149 examples:
0150 - |
0151
0152 flash@ff000000 {
0153 compatible = "cfi-flash";
0154 reg = <0xff000000 0x01000000>;
0155 bank-width = <4>;
0156 device-width = <1>;
0157
0158 #address-cells = <1>;
0159 #size-cells = <1>;
0160 ranges = <0 0xff000000 0x01000000>;
0161
0162 fs@0 {
0163 label = "fs";
0164 reg = <0 0xf80000>;
0165 };
0166 firmware@f80000 {
0167 label ="firmware";
0168 reg = <0xf80000 0x80000>;
0169 read-only;
0170 };
0171 };
0172
0173 - |
0174 /* An example with multiple "reg" tuples */
0175
0176 flash@0 {
0177 compatible = "intel,PC28F640P30T85", "cfi-flash";
0178 reg = <0x00000000 0x02000000>,
0179 <0x02000000 0x02000000>;
0180 bank-width = <2>;
0181
0182 #address-cells = <1>;
0183 #size-cells = <1>;
0184 ranges = <0 0 0x04000000>;
0185
0186 partition@0 {
0187 label = "test-part1";
0188 reg = <0 0x04000000>;
0189 };
0190 };
0191
0192 - |
0193 /* An example using SRAM */
0194 bus {
0195 #address-cells = <2>;
0196 #size-cells = <1>;
0197
0198 sram@2,0 {
0199 compatible = "mtd-ram";
0200 reg = <2 0 0x00200000>;
0201 bank-width = <2>;
0202 };
0203 };
0204
0205 - |
0206 /* An example using addr-gpios */
0207 #include <dt-bindings/gpio/gpio.h>
0208
0209 flash@20000000 {
0210 compatible = "cfi-flash";
0211 reg = <0x20000000 0x02000000>;
0212 bank-width = <2>;
0213 addr-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
0214
0215 #address-cells = <1>;
0216 #size-cells = <1>;
0217 ranges = <0 0x00000000 0x02000000>,
0218 <1 0x02000000 0x02000000>;
0219
0220 partition@0 {
0221 label = "test-part1";
0222 reg = <0 0x04000000>;
0223 };
0224 };
0225 ...