Skip to content

Commit e35a4a4

Browse files
committed
Merge tag 'mtd/changes-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
Pull MTD updates from Miquel Raynal: "There has been a lot of activity in the MTD subsystem recently, with a number of SPI-NOR cleanups as well as the introduction of ECC engines that can be used by SPI controllers (hence a few SPI patches in here). Core MTD changes: - Replace the expert mode symbols with a single helper - Fix misuses of of_match_ptr() - Remove partid and partname debugfs files - tests: Fix eraseblock read speed miscalculation for lower partition sizes - TRX parser: Allow to use on MediaTek MIPS SoCs MTD driver changes: - spear_smi: use GFP_KERNEL - mchp48l640: Add SPI ID table - mchp23k256: Add SPI ID table - blkdevs: Avoid soft lockups with some mtd/spi devices - aspeed-smc: Improve probe resilience Hyperbus changes: - HBMC_AM654 should depend on ARCH_K3 NAND core changes: - ECC: - Add infrastructure to support hardware engines - Add a new helper to retrieve the ECC context - Provide a helper to retrieve a pilelined engine device NAND-ECC changes: - Macronix ECC engine: - Add Macronix external ECC engine support - Support SPI pipelined mode - Make two read-only arrays static const - Fix compile test issue Raw NAND core changes: - Fix misuses of of_match_node() - Rework of_get_nand_bus_width() - Remove of_get_nand_on_flash_bbt() wrapper - Protect access to rawnand devices while in suspend - bindings: Document the wp-gpios property Rax NAND controller driver changes: - atmel: Fix refcount issue in atmel_nand_controller_init - nandsim: - Add NS_PAGE_BYTE_SHIFT macro to replace the repeat pattern - Merge repeat codes in ns_switch_state - Replace overflow check with kzalloc to single kcalloc - rockchip: Fix platform_get_irq.cocci warning - stm32_fmc2: Add NAND Write Protect support - pl353: Set the nand chip node as the flash node - brcmnand: Fix sparse warnings in bcma_nand - omap_elm: Remove redundant variable 'errors' - gpmi: - Support fast edo timings for mx28 - Validate controller clock rate - Fix controller timings setting - brcmnand: - Add BCMA shim - BCMA controller uses command shift of 0 - Allow platform data instantation - Add platform data structure for BCMA - Allow working without interrupts - Move OF operations out of brcmnand_init_cs() - Avoid pdev in brcmnand_init_cs() - Allow SoC to provide I/O operations - Assign soc as early as possible Onenand changes: - Check for error irq SPI-NAND core changes: - Delay a little bit the dirmap creation - Create direct mapping descriptors for ECC operations SPI-NAND driver changes: - macronix: Use random program load SPI NOR core changes: - Move vendor specific code out of the core into vendor drivers. - Unify all function and object names in the vendor modules. - Make setup() callback optional to improve readability. - Skip erase logic when the SPI_NOR_NO_ERASE flag is set at flash declaration. SPI changes: - Macronix SPI controller: - Fix the transmit path - Create a helper to configure the controller before an operation - Create a helper to ease the start of an operation - Add support for direct mapping - Add support for pipelined ECC operations - spi-mem: - Introduce a capability structure - Check the controller extra capabilities - cadence-quadspi/mxic: Provide capability structures - Kill the spi_mem_dtr_supports_op() helper - Add an ecc parameter to the spi_mem_op structure Binding changes: - Dropped mtd/cortina,gemini-flash.txt - Convert BCM47xx partitions to json-schema - Vendor prefixes: Clarify Macronix prefix - SPI NAND: Convert spi-nand description file to yaml - Raw NAND chip: Create a NAND chip description - Raw NAND controller: - Harmonize the property types - Fix a comment in the examples - Fix the reg property description - Describe Macronix NAND ECC engine - Macronix SPI controller: - Document the nand-ecc-engine property - Convert to yaml - The interrupt property is not mandatory" * tag 'mtd/changes-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (104 commits) mtd: nand: ecc: mxic: Fix compile test issue mtd: nand: mxic-ecc: make two read-only arrays static const mtd: hyperbus: HBMC_AM654 should depend on ARCH_K3 mtd: core: Remove partid and partname debugfs files dt-bindings: mtd: partitions: convert BCM47xx to the json-schema mtd: tests: Fix eraseblock read speed miscalculation for lower partition sizes mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init mtd: rawnand: rockchip: fix platform_get_irq.cocci warning mtd: spi-nor: Skip erase logic when SPI_NOR_NO_ERASE is set mtd: spi-nor: renumber flags mtd: spi-nor: slightly change code style in spi_nor_sr_ready() mtd: spi-nor: spansion: rename vendor specific functions and defines mtd: spi-nor: spansion: convert USE_CLSR to a manufacturer flag mtd: spi-nor: move all spansion specifics into spansion.c mtd: spi-nor: spansion: slightly rework control flow in late_init() mtd: spi-nor: micron-st: rename vendor specific functions and defines mtd: spi-nor: micron-st: convert USE_FSR to a manufacturer flag mtd: spi-nor: move all micron-st specifics into micron-st.c mtd: spi-nor: xilinx: correct the debug message mtd: spi-nor: xilinx: rename vendor specific functions and defines ...
2 parents 8eb48fc + 6cadd42 commit e35a4a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2921
-999
lines changed

Documentation/devicetree/bindings/mtd/cortina,gemini-flash.txt

Lines changed: 0 additions & 24 deletions
This file was deleted.

Documentation/devicetree/bindings/mtd/mtd-physmap.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ properties:
4444
- numonyx,js28f128
4545
- sst,sst39vf320
4646
- xlnx,xps-mch-emc-2.00.a
47-
- const: cfi-flash
47+
- enum:
48+
- cfi-flash
49+
- jedec-flash
4850
- items:
4951
- enum:
5052
- cypress,cy7c1019dv33-10zsxi
@@ -127,6 +129,20 @@ required:
127129
- compatible
128130
- reg
129131

132+
if:
133+
properties:
134+
compatible:
135+
contains:
136+
const: cortina,gemini-flash
137+
then:
138+
properties:
139+
syscon:
140+
$ref: /schemas/types.yaml#/definitions/phandle
141+
description:
142+
Phandle to the syscon controller
143+
required:
144+
- syscon
145+
130146
# FIXME: A parent bus may define timing properties
131147
additionalProperties: true
132148

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mtd/mxicy,nand-ecc-engine.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Macronix NAND ECC engine device tree bindings
8+
9+
maintainers:
10+
- Miquel Raynal <[email protected]>
11+
12+
properties:
13+
compatible:
14+
const: mxicy,nand-ecc-engine-rev3
15+
16+
reg:
17+
maxItems: 1
18+
19+
clocks:
20+
maxItems: 1
21+
22+
interrupts:
23+
maxItems: 1
24+
25+
required:
26+
- compatible
27+
- reg
28+
29+
additionalProperties: false
30+
31+
examples:
32+
- |
33+
/* External configuration */
34+
spi_controller0: spi@43c30000 {
35+
compatible = "mxicy,mx25f0a-spi";
36+
reg = <0x43c30000 0x10000>, <0xa0000000 0x4000000>;
37+
reg-names = "regs", "dirmap";
38+
clocks = <&clkwizard 0>, <&clkwizard 1>, <&clkc 15>;
39+
clock-names = "send_clk", "send_dly_clk", "ps_clk";
40+
#address-cells = <1>;
41+
#size-cells = <0>;
42+
43+
flash@0 {
44+
compatible = "spi-nand";
45+
reg = <0>;
46+
nand-ecc-engine = <&ecc_engine0>;
47+
};
48+
};
49+
50+
ecc_engine0: ecc@43c40000 {
51+
compatible = "mxicy,nand-ecc-engine-rev3";
52+
reg = <0x43c40000 0x10000>;
53+
};
54+
55+
- |
56+
/* Pipelined configuration */
57+
spi_controller1: spi@43c30000 {
58+
compatible = "mxicy,mx25f0a-spi";
59+
reg = <0x43c30000 0x10000>, <0xa0000000 0x4000000>;
60+
reg-names = "regs", "dirmap";
61+
clocks = <&clkwizard 0>, <&clkwizard 1>, <&clkc 15>;
62+
clock-names = "send_clk", "send_dly_clk", "ps_clk";
63+
#address-cells = <1>;
64+
#size-cells = <0>;
65+
nand-ecc-engine = <&ecc_engine1>;
66+
67+
flash@0 {
68+
compatible = "spi-nand";
69+
reg = <0>;
70+
nand-ecc-engine = <&spi_controller1>;
71+
};
72+
};
73+
74+
ecc_engine1: ecc@43c40000 {
75+
compatible = "mxicy,nand-ecc-engine-rev3";
76+
reg = <0x43c40000 0x10000>;
77+
};
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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-chip.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NAND Chip and NAND Controller Generic Binding
8+
9+
maintainers:
10+
- Miquel Raynal <[email protected]>
11+
12+
description: |
13+
This file covers the generic description 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+
reg:
19+
description:
20+
Contains the chip-select IDs.
21+
22+
nand-ecc-engine:
23+
description: |
24+
A phandle on the hardware ECC engine if any. There are
25+
basically three possibilities:
26+
1/ The ECC engine is part of the NAND controller, in this
27+
case the phandle should reference the parent node.
28+
2/ The ECC engine is part of the NAND part (on-die), in this
29+
case the phandle should reference the node itself.
30+
3/ The ECC engine is external, in this case the phandle should
31+
reference the specific ECC engine node.
32+
$ref: /schemas/types.yaml#/definitions/phandle
33+
34+
nand-use-soft-ecc-engine:
35+
description: Use a software ECC engine.
36+
type: boolean
37+
38+
nand-no-ecc-engine:
39+
description: Do not use any ECC correction.
40+
type: boolean
41+
42+
nand-ecc-algo:
43+
description:
44+
Desired ECC algorithm.
45+
$ref: /schemas/types.yaml#/definitions/string
46+
enum: [hamming, bch, rs]
47+
48+
nand-ecc-strength:
49+
description:
50+
Maximum number of bits that can be corrected per ECC step.
51+
$ref: /schemas/types.yaml#/definitions/uint32
52+
minimum: 1
53+
54+
nand-ecc-step-size:
55+
description:
56+
Number of data bytes covered by a single ECC step.
57+
$ref: /schemas/types.yaml#/definitions/uint32
58+
minimum: 1
59+
60+
secure-regions:
61+
description:
62+
Regions in the NAND chip which are protected using a secure element
63+
like Trustzone. This property contains the start address and size of
64+
the secure regions present.
65+
$ref: /schemas/types.yaml#/definitions/uint64-matrix
66+
67+
required:
68+
- reg
69+
70+
additionalProperties: true

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

Lines changed: 16 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -39,60 +39,34 @@ properties:
3939
ranges: true
4040

4141
cs-gpios:
42-
minItems: 1
43-
maxItems: 8
4442
description:
4543
Array of chip-select available to the controller. The first
4644
entries are a 1:1 mapping of the available chip-select on the
4745
NAND controller (even if they are not used). As many additional
4846
chip-select as needed may follow and should be phandles of GPIO
4947
lines. 'reg' entries of the NAND chip subnodes become indexes of
5048
this array when this property is present.
49+
minItems: 1
50+
maxItems: 8
5151

5252
patternProperties:
5353
"^nand@[a-f0-9]$":
5454
type: object
55+
$ref: "nand-chip.yaml#"
56+
5557
properties:
5658
reg:
5759
description:
58-
Contains the native Ready/Busy IDs.
59-
60-
nand-ecc-engine:
61-
allOf:
62-
- $ref: /schemas/types.yaml#/definitions/phandle
63-
description: |
64-
A phandle on the hardware ECC engine if any. There are
65-
basically three possibilities:
66-
1/ The ECC engine is part of the NAND controller, in this
67-
case the phandle should reference the parent node.
68-
2/ The ECC engine is part of the NAND part (on-die), in this
69-
case the phandle should reference the node itself.
70-
3/ The ECC engine is external, in this case the phandle should
71-
reference the specific ECC engine node.
72-
73-
nand-use-soft-ecc-engine:
74-
type: boolean
75-
description: Use a software ECC engine.
76-
77-
nand-no-ecc-engine:
78-
type: boolean
79-
description: Do not use any ECC correction.
60+
Contains the chip-select IDs.
8061

8162
nand-ecc-placement:
82-
allOf:
83-
- $ref: /schemas/types.yaml#/definitions/string
84-
- enum: [ oob, interleaved ]
8563
description:
8664
Location of the ECC bytes. This location is unknown by default
8765
but can be explicitly set to "oob", if all ECC bytes are
8866
known to be stored in the OOB area, or "interleaved" if ECC
8967
bytes will be interleaved with regular data in the main area.
90-
91-
nand-ecc-algo:
92-
description:
93-
Desired ECC algorithm.
9468
$ref: /schemas/types.yaml#/definitions/string
95-
enum: [hamming, bch, rs]
69+
enum: [ oob, interleaved ]
9670

9771
nand-bus-width:
9872
description:
@@ -102,7 +76,6 @@ patternProperties:
10276
default: 8
10377

10478
nand-on-flash-bbt:
105-
$ref: /schemas/types.yaml#/definitions/flag
10679
description:
10780
With this property, the OS will search the device for a Bad
10881
Block Table (BBT). If not found, it will create one, reserve
@@ -111,21 +84,9 @@ patternProperties:
11184
few pages of all the blocks will be scanned at boot time to
11285
find Bad Block Markers (BBM). These markers will help to
11386
build a volatile BBT in RAM.
114-
115-
nand-ecc-strength:
116-
description:
117-
Maximum number of bits that can be corrected per ECC step.
118-
$ref: /schemas/types.yaml#/definitions/uint32
119-
minimum: 1
120-
121-
nand-ecc-step-size:
122-
description:
123-
Number of data bytes covered by a single ECC step.
124-
$ref: /schemas/types.yaml#/definitions/uint32
125-
minimum: 1
87+
$ref: /schemas/types.yaml#/definitions/flag
12688

12789
nand-ecc-maximize:
128-
$ref: /schemas/types.yaml#/definitions/flag
12990
description:
13091
Whether or not the ECC strength should be maximized. The
13192
maximum ECC strength is both controller and chip
@@ -134,18 +95,19 @@ patternProperties:
13495
constraint into account. This is particularly useful when
13596
only the in-band area is used by the upper layers, and you
13697
want to make your NAND as reliable as possible.
98+
$ref: /schemas/types.yaml#/definitions/flag
13799

138100
nand-is-boot-medium:
139-
$ref: /schemas/types.yaml#/definitions/flag
140101
description:
141102
Whether or not the NAND chip is a boot medium. Drivers might
142103
use this information to select ECC algorithms supported by
143104
the boot ROM or similar restrictions.
105+
$ref: /schemas/types.yaml#/definitions/flag
144106

145107
nand-rb:
146-
$ref: /schemas/types.yaml#/definitions/uint32-array
147108
description:
148109
Contains the native Ready/Busy IDs.
110+
$ref: /schemas/types.yaml#/definitions/uint32-array
149111

150112
rb-gpios:
151113
description:
@@ -154,12 +116,12 @@ patternProperties:
154116
Ready/Busy pins. Active state refers to the NAND ready state and
155117
should be set to GPIOD_ACTIVE_HIGH unless the signal is inverted.
156118

157-
secure-regions:
158-
$ref: /schemas/types.yaml#/definitions/uint64-matrix
119+
wp-gpios:
159120
description:
160-
Regions in the NAND chip which are protected using a secure element
161-
like Trustzone. This property contains the start address and size of
162-
the secure regions present.
121+
Contains one GPIO descriptor for the Write Protect pin.
122+
Active state refers to the NAND Write Protect state and should be
123+
set to GPIOD_ACTIVE_LOW unless the signal is inverted.
124+
maxItems: 1
163125

164126
required:
165127
- reg
@@ -181,10 +143,7 @@ examples:
181143
182144
nand@0 {
183145
reg = <0>; /* Native CS */
184-
nand-use-soft-ecc-engine;
185-
nand-ecc-algo = "bch";
186-
187-
/* controller specific properties */
146+
/* NAND chip specific properties */
188147
};
189148
190149
nand@1 {

Documentation/devicetree/bindings/mtd/partitions/brcm,bcm947xx-cfe-partitions.txt

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)