15956d97fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
25956d97fSEmmanuel Vadot%YAML 1.2
35956d97fSEmmanuel Vadot---
45956d97fSEmmanuel Vadot$id: http://devicetree.org/schemas/mtd/mtd-physmap.yaml#
55956d97fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
65956d97fSEmmanuel Vadot
75956d97fSEmmanuel Vadottitle: CFI or JEDEC memory-mapped NOR flash, MTD-RAM (NVRAM...)
85956d97fSEmmanuel Vadot
95956d97fSEmmanuel Vadotmaintainers:
105956d97fSEmmanuel Vadot  - Rob Herring <robh@kernel.org>
115956d97fSEmmanuel Vadot
125956d97fSEmmanuel Vadotdescription: |
135956d97fSEmmanuel Vadot  Flash chips (Memory Technology Devices) are often used for solid state
145956d97fSEmmanuel Vadot  file systems on embedded devices.
155956d97fSEmmanuel Vadot
168bab661aSEmmanuel VadotallOf:
17*fac71e4eSEmmanuel Vadot  - $ref: mtd.yaml#
18cb7aa33aSEmmanuel Vadot  - $ref: /schemas/memory-controllers/mc-peripheral-props.yaml#
198bab661aSEmmanuel Vadot
205956d97fSEmmanuel Vadotproperties:
215956d97fSEmmanuel Vadot  compatible:
225956d97fSEmmanuel Vadot    oneOf:
235956d97fSEmmanuel Vadot      - items:
245956d97fSEmmanuel Vadot          - enum:
255956d97fSEmmanuel Vadot              - amd,s29gl01gp
265956d97fSEmmanuel Vadot              - amd,s29gl032a
275956d97fSEmmanuel Vadot              - amd,s29gl256n
285956d97fSEmmanuel Vadot              - amd,s29gl512n
295956d97fSEmmanuel Vadot              - arm,versatile-flash
30354d7675SEmmanuel Vadot              - arm,vexpress-flash
315956d97fSEmmanuel Vadot              - cortina,gemini-flash
325956d97fSEmmanuel Vadot              - cypress,hyperflash
335956d97fSEmmanuel Vadot              - ge,imp3a-firmware-mirror
345956d97fSEmmanuel Vadot              - ge,imp3a-paged-flash
355956d97fSEmmanuel Vadot              - gef,ppc9a-firmware-mirror
365956d97fSEmmanuel Vadot              - gef,ppc9a-paged-flash
375956d97fSEmmanuel Vadot              - gef,sbc310-firmware-mirror
385956d97fSEmmanuel Vadot              - gef,sbc310-paged-flash
395956d97fSEmmanuel Vadot              - gef,sbc610-firmware-mirror
405956d97fSEmmanuel Vadot              - gef,sbc610-paged-flash
415956d97fSEmmanuel Vadot              - intel,28f128j3
425956d97fSEmmanuel Vadot              - intel,dt28f160
435956d97fSEmmanuel Vadot              - intel,ixp4xx-flash
445956d97fSEmmanuel Vadot              - intel,JS28F128
455956d97fSEmmanuel Vadot              - intel,JS28F640
465956d97fSEmmanuel Vadot              - intel,PC28F640P30T85
475956d97fSEmmanuel Vadot              - numonyx,js28f00a
485956d97fSEmmanuel Vadot              - numonyx,js28f128
495956d97fSEmmanuel Vadot              - sst,sst39vf320
505956d97fSEmmanuel Vadot              - xlnx,xps-mch-emc-2.00.a
51c9ccf3a3SEmmanuel Vadot          - enum:
52c9ccf3a3SEmmanuel Vadot              - cfi-flash
53c9ccf3a3SEmmanuel Vadot              - jedec-flash
545956d97fSEmmanuel Vadot      - items:
555956d97fSEmmanuel Vadot          - enum:
565956d97fSEmmanuel Vadot              - cypress,cy7c1019dv33-10zsxi
575956d97fSEmmanuel Vadot              - arm,vexpress-psram
585956d97fSEmmanuel Vadot          - const: mtd-ram
595956d97fSEmmanuel Vadot      - enum:
605956d97fSEmmanuel Vadot          - cfi-flash
615956d97fSEmmanuel Vadot          - jedec-flash
625956d97fSEmmanuel Vadot          - mtd-ram
635956d97fSEmmanuel Vadot          - mtd-rom
645956d97fSEmmanuel Vadot
655956d97fSEmmanuel Vadot  reg:
665956d97fSEmmanuel Vadot    description: |
675956d97fSEmmanuel Vadot      It's possible to (optionally) define multiple "reg" tuples so that
685956d97fSEmmanuel Vadot      non-identical chips can be described in one node.
695956d97fSEmmanuel Vadot    minItems: 1
705956d97fSEmmanuel Vadot    maxItems: 8
715956d97fSEmmanuel Vadot
725956d97fSEmmanuel Vadot  bank-width:
735956d97fSEmmanuel Vadot    description: Width (in bytes) of the bank.  Equal to the device width times
745956d97fSEmmanuel Vadot      the number of interleaved chips.
755956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
765956d97fSEmmanuel Vadot    enum: [ 1, 2, 4 ]
775956d97fSEmmanuel Vadot
785956d97fSEmmanuel Vadot  device-width:
795956d97fSEmmanuel Vadot    description:
805956d97fSEmmanuel Vadot      Width of a single mtd chip. If omitted, assumed to be equal to 'bank-width'.
815956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
825956d97fSEmmanuel Vadot    enum: [ 1, 2 ]
835956d97fSEmmanuel Vadot
845956d97fSEmmanuel Vadot  no-unaligned-direct-access:
855956d97fSEmmanuel Vadot    type: boolean
865956d97fSEmmanuel Vadot    description: |
875956d97fSEmmanuel Vadot      Disables the default direct mapping of the flash.
885956d97fSEmmanuel Vadot
895956d97fSEmmanuel Vadot      On some platforms (e.g. MPC5200) a direct 1:1 mapping may cause problems
905956d97fSEmmanuel Vadot      with JFFS2 usage, as the local bus (LPB) doesn't support unaligned
915956d97fSEmmanuel Vadot      accesses as implemented in the JFFS2 code via memcpy(). By defining
925956d97fSEmmanuel Vadot      "no-unaligned-direct-access", the flash will not be exposed directly to
935956d97fSEmmanuel Vadot      the MTD users (e.g. JFFS2) any more.
945956d97fSEmmanuel Vadot
955956d97fSEmmanuel Vadot  linux,mtd-name:
965956d97fSEmmanuel Vadot    description:
975956d97fSEmmanuel Vadot      Allows specifying the mtd name for retro capability with physmap-flash
985956d97fSEmmanuel Vadot      drivers as boot loader pass the mtd partition via the old device name
995956d97fSEmmanuel Vadot      physmap-flash.
1005956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
1015956d97fSEmmanuel Vadot
1025956d97fSEmmanuel Vadot  use-advanced-sector-protection:
1035956d97fSEmmanuel Vadot    type: boolean
1045956d97fSEmmanuel Vadot    description: |
1055956d97fSEmmanuel Vadot      Enables support for the advanced sector protection (Spansion: PPB -
1065956d97fSEmmanuel Vadot      Persistent Protection Bits) locking.
1075956d97fSEmmanuel Vadot
1085956d97fSEmmanuel Vadot  erase-size:
1095956d97fSEmmanuel Vadot    description: The chip's physical erase block size in bytes.
1105956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
1115956d97fSEmmanuel Vadot
1125956d97fSEmmanuel Vadot  addr-gpios:
1135956d97fSEmmanuel Vadot    description:
1145956d97fSEmmanuel Vadot      List of GPIO descriptors that will be used to address the MSBs address
1155956d97fSEmmanuel Vadot      lines. The order goes from LSB to MSB.
1165956d97fSEmmanuel Vadot    minItems: 1
1175956d97fSEmmanuel Vadot    maxItems: 8
1185956d97fSEmmanuel Vadot
1195956d97fSEmmanuel Vadot  '#address-cells':
1205956d97fSEmmanuel Vadot    const: 1
1215956d97fSEmmanuel Vadot
1225956d97fSEmmanuel Vadot  '#size-cells':
1235956d97fSEmmanuel Vadot    const: 1
1245956d97fSEmmanuel Vadot
1255956d97fSEmmanuel Vadot  big-endian: true
1265956d97fSEmmanuel Vadot  little-endian: true
1275956d97fSEmmanuel Vadot
1285956d97fSEmmanuel Vadotrequired:
1295956d97fSEmmanuel Vadot  - compatible
1305956d97fSEmmanuel Vadot  - reg
1315956d97fSEmmanuel Vadot
132c9ccf3a3SEmmanuel Vadotif:
133c9ccf3a3SEmmanuel Vadot  properties:
134c9ccf3a3SEmmanuel Vadot    compatible:
135c9ccf3a3SEmmanuel Vadot      contains:
136c9ccf3a3SEmmanuel Vadot        const: cortina,gemini-flash
137c9ccf3a3SEmmanuel Vadotthen:
138c9ccf3a3SEmmanuel Vadot  properties:
139c9ccf3a3SEmmanuel Vadot    syscon:
140c9ccf3a3SEmmanuel Vadot      $ref: /schemas/types.yaml#/definitions/phandle
141c9ccf3a3SEmmanuel Vadot      description:
142c9ccf3a3SEmmanuel Vadot        Phandle to the syscon controller
143c9ccf3a3SEmmanuel Vadot  required:
144c9ccf3a3SEmmanuel Vadot    - syscon
145c9ccf3a3SEmmanuel Vadot
1465956d97fSEmmanuel Vadot# FIXME: A parent bus may define timing properties
1475956d97fSEmmanuel VadotadditionalProperties: true
1485956d97fSEmmanuel Vadot
1495956d97fSEmmanuel Vadotexamples:
1505956d97fSEmmanuel Vadot  - |
1515956d97fSEmmanuel Vadot
1525956d97fSEmmanuel Vadot    flash@ff000000 {
1535956d97fSEmmanuel Vadot        compatible = "cfi-flash";
1545956d97fSEmmanuel Vadot        reg = <0xff000000 0x01000000>;
1555956d97fSEmmanuel Vadot        bank-width = <4>;
1565956d97fSEmmanuel Vadot        device-width = <1>;
1575956d97fSEmmanuel Vadot
1585956d97fSEmmanuel Vadot        #address-cells = <1>;
1595956d97fSEmmanuel Vadot        #size-cells = <1>;
1605956d97fSEmmanuel Vadot        ranges = <0 0xff000000 0x01000000>;
1615956d97fSEmmanuel Vadot
1625956d97fSEmmanuel Vadot        fs@0 {
1635956d97fSEmmanuel Vadot            label = "fs";
1645956d97fSEmmanuel Vadot            reg = <0 0xf80000>;
1655956d97fSEmmanuel Vadot        };
1665956d97fSEmmanuel Vadot        firmware@f80000 {
1675956d97fSEmmanuel Vadot            label = "firmware";
1685956d97fSEmmanuel Vadot            reg = <0xf80000 0x80000>;
1695956d97fSEmmanuel Vadot            read-only;
1705956d97fSEmmanuel Vadot        };
1715956d97fSEmmanuel Vadot    };
1725956d97fSEmmanuel Vadot
1735956d97fSEmmanuel Vadot  - |
1745956d97fSEmmanuel Vadot    /* An example with multiple "reg" tuples */
1755956d97fSEmmanuel Vadot
1765956d97fSEmmanuel Vadot    flash@0 {
1775956d97fSEmmanuel Vadot        compatible = "intel,PC28F640P30T85", "cfi-flash";
1785956d97fSEmmanuel Vadot        reg = <0x00000000 0x02000000>,
1795956d97fSEmmanuel Vadot              <0x02000000 0x02000000>;
1805956d97fSEmmanuel Vadot        bank-width = <2>;
1815956d97fSEmmanuel Vadot
1825956d97fSEmmanuel Vadot        #address-cells = <1>;
1835956d97fSEmmanuel Vadot        #size-cells = <1>;
1845956d97fSEmmanuel Vadot        ranges = <0 0 0x04000000>;
1855956d97fSEmmanuel Vadot
1865956d97fSEmmanuel Vadot        partition@0 {
1875956d97fSEmmanuel Vadot            label = "test-part1";
1885956d97fSEmmanuel Vadot            reg = <0 0x04000000>;
1895956d97fSEmmanuel Vadot        };
1905956d97fSEmmanuel Vadot    };
1915956d97fSEmmanuel Vadot
1925956d97fSEmmanuel Vadot  - |
1935956d97fSEmmanuel Vadot    /* An example using SRAM */
1945956d97fSEmmanuel Vadot    bus {
1955956d97fSEmmanuel Vadot        #address-cells = <2>;
1965956d97fSEmmanuel Vadot        #size-cells = <1>;
1975956d97fSEmmanuel Vadot
1985956d97fSEmmanuel Vadot        sram@2,0 {
1995956d97fSEmmanuel Vadot            compatible = "mtd-ram";
2005956d97fSEmmanuel Vadot            reg = <2 0 0x00200000>;
2015956d97fSEmmanuel Vadot            bank-width = <2>;
2025956d97fSEmmanuel Vadot        };
2035956d97fSEmmanuel Vadot    };
2045956d97fSEmmanuel Vadot
2055956d97fSEmmanuel Vadot  - |
2065956d97fSEmmanuel Vadot    /* An example using addr-gpios */
2075956d97fSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
2085956d97fSEmmanuel Vadot
2095956d97fSEmmanuel Vadot    flash@20000000 {
2105956d97fSEmmanuel Vadot        compatible = "cfi-flash";
2115956d97fSEmmanuel Vadot        reg = <0x20000000 0x02000000>;
2125956d97fSEmmanuel Vadot        bank-width = <2>;
2135956d97fSEmmanuel Vadot        addr-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
2145956d97fSEmmanuel Vadot
2155956d97fSEmmanuel Vadot        #address-cells = <1>;
2165956d97fSEmmanuel Vadot        #size-cells = <1>;
2175956d97fSEmmanuel Vadot        ranges = <0 0x00000000 0x02000000>,
2185956d97fSEmmanuel Vadot                 <1 0x02000000 0x02000000>;
2195956d97fSEmmanuel Vadot
2205956d97fSEmmanuel Vadot        partition@0 {
2215956d97fSEmmanuel Vadot            label = "test-part1";
2225956d97fSEmmanuel Vadot            reg = <0 0x04000000>;
2235956d97fSEmmanuel Vadot        };
2245956d97fSEmmanuel Vadot    };
2255956d97fSEmmanuel Vadot...
226