Skip to content

Commit 8541d8f

Browse files
committed
Merge tag 'mtd/for-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
Pull MTD updates from Miquel Raynal: "MTD changes: - mtdconcat finally makes it in, after several years of being merged and reverted - Baikal SoC support is being removed, so MTD bits are being removed as well - misc cleanups NAND changes: - SunXi driver support for new versions of the Allwinner NAND controller. - DT-binding improvements and cleanups. - A few fixes (Realtek ECC and Winbond SPI NAND), aside with the usual load of misc changes. SPI NOR fixes: - Enable die erase on MT35XU02GCBA. We knew this flash needed this fixup since 7f77c56 ("mtd: spi-nor: micron-st: add TODO for fixing mt35xu02gcba") but did not add it due to lack of hardware to test on. - Fix locking on some Winbond w25q series flashes. - Fix Auto Address Increment (AAI) writes on SST that flashes that start on odd address. The write enable latch needs to be set again after the single byte program" * tag 'mtd/for-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (44 commits) mtd: spinand: winbond: Declare the QE bit on W25NxxJW mtd: spi-nor: micron-st: Enable die erase support for MT35XU02GCBA mtd: spi-nor: winbond: Fix locking support for w25q256jw mtd: spi-nor: sst: Fix write enable before AAI sequence mtd: spi-nor: winbond: Fix locking support for w25q64jvm mtd: spi-nor: winbond: Fix locking support for w25q256jwm dt-bindings: mtd: mxc-nand: add missing compatible string and ref to nand-controller-legacy.yaml dt-bindings: mtd: gpmi-nand: ref to nand-controller-legacy.yaml dt-bindings: mtd: refactor NAND bindings and add nand-controller-legacy.yaml mtd: spinand: winbond: Clarify when to enable the HS bit mtd: rawnand: sunxi: introduce maximize variable user data length mtd: rawnand: sunxi: fix typos in comments mtd: rawnand: sunxi: change error prone variable name mtd: rawnand: sunxi: remove dead code mtd: rawnand: sunxi: make the code more self-explanatory mtd: rawnand: sunxi: replace hard coded value by a define - take2 mtd: rawnand: sunxi: do not count BBM bytes twice mtd: rawnand: sunxi: fix sunxi_nfc_hw_ecc_read_extra_oob mtd: rawnand: sunxi: sunxi_nand_ooblayout_free code clarification mtd: cmdlinepart: use a flexible array member ...
2 parents a436a0b + b2a4fe0 commit 8541d8f

40 files changed

Lines changed: 1120 additions & 434 deletions

Documentation/devicetree/bindings/mtd/gpmi-nand.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ required:
101101
unevaluatedProperties: false
102102

103103
allOf:
104-
- $ref: nand-controller.yaml
104+
- $ref: nand-controller-legacy.yaml
105105

106106
- if:
107107
properties:

Documentation/devicetree/bindings/mtd/mxc-nand.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,43 @@ maintainers:
1010
- Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
1111

1212
allOf:
13-
- $ref: nand-controller.yaml
13+
- $ref: nand-controller-legacy.yaml
1414

1515
properties:
1616
compatible:
1717
oneOf:
18-
- const: fsl,imx27-nand
18+
- enum:
19+
- fsl,imx25-nand
20+
- fsl,imx27-nand
21+
- fsl,imx51-nand
22+
- fsl,imx53-nand
23+
- items:
24+
- enum:
25+
- fsl,imx35-nand
26+
- const: fsl,imx25-nand
1927
- items:
2028
- enum:
2129
- fsl,imx31-nand
2230
- const: fsl,imx27-nand
2331
reg:
24-
maxItems: 1
32+
minItems: 1
33+
items:
34+
- description: IP register space
35+
- description: Nand flash internal buffer space
2536

2637
interrupts:
2738
maxItems: 1
2839

40+
clocks:
41+
maxItems: 1
42+
43+
dmas:
44+
maxItems: 1
45+
46+
dma-names:
47+
items:
48+
- const: rx-tx
49+
2950
required:
3051
- compatible
3152
- reg

Documentation/devicetree/bindings/mtd/nand-chip.yaml

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ maintainers:
1111

1212
allOf:
1313
- $ref: mtd.yaml#
14+
- $ref: nand-property.yaml
1415

1516
description: |
1617
This file covers the generic description of a NAND chip. It implies that the
@@ -22,51 +23,6 @@ properties:
2223
description:
2324
Contains the chip-select IDs.
2425

25-
nand-ecc-engine:
26-
description: |
27-
A phandle on the hardware ECC engine if any. There are
28-
basically three possibilities:
29-
1/ The ECC engine is part of the NAND controller, in this
30-
case the phandle should reference the parent node.
31-
2/ The ECC engine is part of the NAND part (on-die), in this
32-
case the phandle should reference the node itself.
33-
3/ The ECC engine is external, in this case the phandle should
34-
reference the specific ECC engine node.
35-
$ref: /schemas/types.yaml#/definitions/phandle
36-
37-
nand-use-soft-ecc-engine:
38-
description: Use a software ECC engine.
39-
type: boolean
40-
41-
nand-no-ecc-engine:
42-
description: Do not use any ECC correction.
43-
type: boolean
44-
45-
nand-ecc-algo:
46-
description:
47-
Desired ECC algorithm.
48-
$ref: /schemas/types.yaml#/definitions/string
49-
enum: [hamming, bch, rs]
50-
51-
nand-ecc-strength:
52-
description:
53-
Maximum number of bits that can be corrected per ECC step.
54-
$ref: /schemas/types.yaml#/definitions/uint32
55-
minimum: 1
56-
57-
nand-ecc-step-size:
58-
description:
59-
Number of data bytes covered by a single ECC step.
60-
$ref: /schemas/types.yaml#/definitions/uint32
61-
minimum: 1
62-
63-
secure-regions:
64-
description:
65-
Regions in the NAND chip which are protected using a secure element
66-
like Trustzone. This property contains the start address and size of
67-
the secure regions present.
68-
$ref: /schemas/types.yaml#/definitions/uint64-matrix
69-
7026
required:
7127
- reg
7228

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mtd/nand-controller-legacy.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NAND Controller Common Properties
8+
9+
maintainers:
10+
- Miquel Raynal <miquel.raynal@bootlin.com>
11+
- Richard Weinberger <richard@nod.at>
12+
13+
description: >
14+
The NAND controller should be represented with its own DT node, and
15+
all NAND chips attached to this controller should be defined as
16+
children nodes of the NAND controller. This representation should be
17+
enforced even for simple controllers supporting only one chip.
18+
19+
This is only for legacy nand controller, new controller should use
20+
nand-controller.yaml
21+
22+
properties:
23+
24+
"#address-cells":
25+
const: 1
26+
27+
"#size-cells":
28+
enum: [0, 1]
29+
30+
ranges: true
31+
32+
cs-gpios:
33+
description:
34+
Array of chip-select available to the controller. The first
35+
entries are a 1:1 mapping of the available chip-select on the
36+
NAND controller (even if they are not used). As many additional
37+
chip-select as needed may follow and should be phandles of GPIO
38+
lines. 'reg' entries of the NAND chip subnodes become indexes of
39+
this array when this property is present.
40+
minItems: 1
41+
maxItems: 8
42+
43+
partitions:
44+
type: object
45+
46+
required:
47+
- compatible
48+
49+
patternProperties:
50+
"^nand@[a-f0-9]$":
51+
type: object
52+
$ref: raw-nand-chip.yaml#
53+
54+
"^partition@[0-9a-f]+$":
55+
type: object
56+
$ref: /schemas/mtd/partitions/partition.yaml#/$defs/partition-node
57+
deprecated: true
58+
59+
allOf:
60+
- $ref: raw-nand-property.yaml#
61+
- $ref: nand-property.yaml#
62+
63+
# This is a generic file other binding inherit from and extend
64+
additionalProperties: true
65+

Documentation/devicetree/bindings/mtd/nand-controller.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ description: |
1616
children nodes of the NAND controller. This representation should be
1717
enforced even for simple controllers supporting only one chip.
1818
19+
select: false
20+
1921
properties:
2022
$nodename:
2123
pattern: "^nand-controller(@.*)?"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mtd/nand-property.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NAND Chip Common Properties
8+
9+
maintainers:
10+
- Miquel Raynal <miquel.raynal@bootlin.com>
11+
12+
description: |
13+
This file covers the generic properties of a NAND chip. It implies that the
14+
bus interface should not be taken into account: both raw NAND devices and
15+
SPI-NAND devices are concerned by this description.
16+
17+
properties:
18+
nand-ecc-engine:
19+
description: |
20+
A phandle on the hardware ECC engine if any. There are
21+
basically three possibilities:
22+
1/ The ECC engine is part of the NAND controller, in this
23+
case the phandle should reference the parent node.
24+
2/ The ECC engine is part of the NAND part (on-die), in this
25+
case the phandle should reference the node itself.
26+
3/ The ECC engine is external, in this case the phandle should
27+
reference the specific ECC engine node.
28+
$ref: /schemas/types.yaml#/definitions/phandle
29+
30+
nand-use-soft-ecc-engine:
31+
description: Use a software ECC engine.
32+
type: boolean
33+
34+
nand-no-ecc-engine:
35+
description: Do not use any ECC correction.
36+
type: boolean
37+
38+
nand-ecc-algo:
39+
description:
40+
Desired ECC algorithm.
41+
$ref: /schemas/types.yaml#/definitions/string
42+
enum: [hamming, bch, rs]
43+
44+
nand-ecc-strength:
45+
description:
46+
Maximum number of bits that can be corrected per ECC step.
47+
$ref: /schemas/types.yaml#/definitions/uint32
48+
minimum: 1
49+
50+
nand-ecc-step-size:
51+
description:
52+
Number of data bytes covered by a single ECC step.
53+
$ref: /schemas/types.yaml#/definitions/uint32
54+
minimum: 1
55+
56+
secure-regions:
57+
description:
58+
Regions in the NAND chip which are protected using a secure element
59+
like Trustzone. This property contains the start address and size of
60+
the secure regions present.
61+
$ref: /schemas/types.yaml#/definitions/uint64-matrix
62+
63+
# This file can be referenced by more specific devices (like spi-nands)
64+
additionalProperties: true

Documentation/devicetree/bindings/mtd/partitions/partition.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ properties:
5757
user space from
5858
type: boolean
5959

60+
part-concat-next:
61+
description: List of phandles to MTD partitions that need be concatenated
62+
with the current partition.
63+
$ref: /schemas/types.yaml#/definitions/phandle-array
64+
minItems: 1
65+
maxItems: 16
66+
items:
67+
maxItems: 1
68+
6069
align:
6170
$ref: /schemas/types.yaml#/definitions/uint32
6271
minimum: 2
@@ -180,4 +189,15 @@ examples:
180189
reg = <0x200000 0x100000>;
181190
align = <0x4000>;
182191
};
192+
193+
part0: partition@400000 {
194+
part-concat-next = <&part1>;
195+
label = "part0_0";
196+
reg = <0x400000 0x100000>;
197+
};
198+
199+
part1: partition@800000 {
200+
label = "part0_1";
201+
reg = <0x800000 0x800000>;
202+
};
183203
};

Documentation/devicetree/bindings/mtd/raw-nand-chip.yaml

Lines changed: 1 addition & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ maintainers:
1111

1212
allOf:
1313
- $ref: nand-chip.yaml#
14+
- $ref: raw-nand-property.yaml#
1415

1516
description: |
1617
The ECC strength and ECC step size properties define the user
@@ -31,79 +32,6 @@ properties:
3132
description:
3233
Contains the chip-select IDs.
3334

34-
nand-ecc-placement:
35-
description:
36-
Location of the ECC bytes. This location is unknown by default
37-
but can be explicitly set to "oob", if all ECC bytes are
38-
known to be stored in the OOB area, or "interleaved" if ECC
39-
bytes will be interleaved with regular data in the main area.
40-
$ref: /schemas/types.yaml#/definitions/string
41-
enum: [ oob, interleaved ]
42-
deprecated: true
43-
44-
nand-ecc-mode:
45-
description:
46-
Legacy ECC configuration mixing the ECC engine choice and
47-
configuration.
48-
$ref: /schemas/types.yaml#/definitions/string
49-
enum: [none, soft, soft_bch, hw, hw_syndrome, on-die]
50-
deprecated: true
51-
52-
nand-bus-width:
53-
description:
54-
Bus width to the NAND chip
55-
$ref: /schemas/types.yaml#/definitions/uint32
56-
enum: [8, 16]
57-
default: 8
58-
59-
nand-on-flash-bbt:
60-
description:
61-
With this property, the OS will search the device for a Bad
62-
Block Table (BBT). If not found, it will create one, reserve
63-
a few blocks at the end of the device to store it and update
64-
it as the device ages. Otherwise, the out-of-band area of a
65-
few pages of all the blocks will be scanned at boot time to
66-
find Bad Block Markers (BBM). These markers will help to
67-
build a volatile BBT in RAM.
68-
$ref: /schemas/types.yaml#/definitions/flag
69-
70-
nand-ecc-maximize:
71-
description:
72-
Whether or not the ECC strength should be maximized. The
73-
maximum ECC strength is both controller and chip
74-
dependent. The ECC engine has to select the ECC config
75-
providing the best strength and taking the OOB area size
76-
constraint into account. This is particularly useful when
77-
only the in-band area is used by the upper layers, and you
78-
want to make your NAND as reliable as possible.
79-
$ref: /schemas/types.yaml#/definitions/flag
80-
81-
nand-is-boot-medium:
82-
description:
83-
Whether or not the NAND chip is a boot medium. Drivers might
84-
use this information to select ECC algorithms supported by
85-
the boot ROM or similar restrictions.
86-
$ref: /schemas/types.yaml#/definitions/flag
87-
88-
nand-rb:
89-
description:
90-
Contains the native Ready/Busy IDs.
91-
$ref: /schemas/types.yaml#/definitions/uint32-array
92-
93-
rb-gpios:
94-
description:
95-
Contains one or more GPIO descriptor (the numper of descriptor
96-
depends on the number of R/B pins exposed by the flash) for the
97-
Ready/Busy pins. Active state refers to the NAND ready state and
98-
should be set to GPIOD_ACTIVE_HIGH unless the signal is inverted.
99-
100-
wp-gpios:
101-
description:
102-
Contains one GPIO descriptor for the Write Protect pin.
103-
Active state refers to the NAND Write Protect state and should be
104-
set to GPIOD_ACTIVE_LOW unless the signal is inverted.
105-
maxItems: 1
106-
10735
required:
10836
- reg
10937

0 commit comments

Comments
 (0)