Skip to content

Commit 070a725

Browse files
committed
Merge tag 'mtd/for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
Pull mtd updates from Miquel Raynal: "MTD core: - Handle possible -EPROBE_DEFER from parse_mtd_partitions() - Constify buf in mtd_write_user_prot_reg() - Constify name param in mtd_bdi_init - Fix fall-through warnings for Clang - Get rid of Big MTD Lock ouf of mtdchar - Drop mtd_mutex usage from mtdchar_open() - Don't lock when recursively deleting partitions - Use module_mtd_blktrans() to register driver when relevant - Parse MTD as NVMEM cells - New OTP (one-time-programmable) erase ioctl - Require write permissions for locking and badblock ioctls - physmap: - Fix error return code of physmap_flash_remove() - physmap-bt1-rom: Fix unintentional stack access - ofpart parser: - Support Linksys Northstar partitions - Make symbol 'bcm4908_partitions_quirks' static - Limit parsing of deprecated DT syntax - Support BCM4908 fixed partitions - Qcom parser: - Incompatible with spi-nor 4k sectors - Fix error condition - Extend Qcom SMEM parser to SPI flash CFI: - Disable broken buffered writes for CFI chips within ID 0x2201 - Address a Coverity report for unused value SPI NOR core: - Add OTP support - Fix module unload while an op in progress - Add various cleanup patches - Add Michael and Pratyush as designated reviewers in MAINTAINERS SPI NOR controller drivers: - intel-spi: - Move platform data header to x86 subfolder NAND core: - Fix error handling in nand_prog_page_op() (x2) - Add a helper to retrieve the number of ECC bytes per step - Add a helper to retrieve the number of ECC steps - Let ECC engines advertize the exact number of steps - ECC Hamming: - Populate the public nsteps field - Use the public nsteps field - ECC BCH: - Populate the public nsteps field - Use the public nsteps field Raw NAND core: - Add support for secure regions in NAND memory - Try not to use the ECC private structures - Remove duplicate include in rawnand.h - BBT: - Skip bad blocks when searching for the BBT in NAND (APPLIED THEN REVERTED) Raw NAND controller drivers: - Qcom: - Convert bindings to YAML - Use dma_mapping_error() for error check - Add missing nand_cleanup() in error path - Return actual error code instead of -ENODEV - Update last code word register - Add helper to configure location register - Rename parameter name in macro - Add helper to check last code word - Convert nandc to chip in Read/Write helper - Update register macro name for 0x2c offset - GPMI: - Fix a double free in gpmi_nand_init - Rockchip: - Use flexible-array member instead of zero-length array - Atmel: - Update ecc_stats.corrected counter - MXC: - Remove unneeded of_match_ptr() - R852: - replace spin_lock_irqsave by spin_lock in hard IRQ - Brcmnand: - Move to polling in pio mode on oops write - Read/write oob during EDU transfer - Fix OOB R/W with Hamming ECC - FSMC: - Fix error code in fsmc_nand_probe() - OMAP: - Use ECC information from the generic structures SPI-NAND core: - Add missing MODULE_DEVICE_TABLE() SPI-NAND drivers: - gigadevice: Support GD5F1GQ5UExxG" * tag 'mtd/for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (89 commits) Revert "mtd: rawnand: bbt: Skip bad blocks when searching for the BBT in NAND" mtd: core: Constify buf in mtd_write_user_prot_reg() Revert "mtd: spi-nor: macronix: Add support for mx25l51245g" mtd: spi-nor: core: Fix an issue of releasing resources during read/write mtd: cfi_cmdset_0002: remove redundant assignment to variable timeo mtd: cfi_cmdset_0002: Disable buffered writes for AMD chip 0x2201 mtd: rawnand: qcom: Use dma_mapping_error() for error check mtd: rawnand: gpmi: Fix a double free in gpmi_nand_init mtd: rawnand: qcom: Add missing nand_cleanup() in error path mtd: rawnand: Add support for secure regions in NAND memory dt-bindings: mtd: Add a property to declare secure regions in NAND chips dt-bindings: mtd: Convert Qcom NANDc binding to YAML mtd: spi-nor: winbond: add OTP support to w25q32fw/jw mtd: spi-nor: implement OTP support for Winbond and similar flashes mtd: spi-nor: add OTP support mtd: spi-nor: swp: Improve code around spi_nor_check_lock_status_sr() mtd: spi-nor: Move Software Write Protection logic out of the core mtd: rawnand: bbt: Skip bad blocks when searching for the BBT in NAND include: linux: mtd: Remove duplicate include of nand.h mtd: parsers: ofpart: support Linksys Northstar partitions ...
2 parents e19eede + a881537 commit 070a725

71 files changed

Lines changed: 2154 additions & 942 deletions

Some content is hidden

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

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@ patternProperties:
143143
Ready/Busy pins. Active state refers to the NAND ready state and
144144
should be set to GPIOD_ACTIVE_HIGH unless the signal is inverted.
145145

146+
secure-regions:
147+
$ref: /schemas/types.yaml#/definitions/uint64-matrix
148+
description:
149+
Regions in the NAND chip which are protected using a secure element
150+
like Trustzone. This property contains the start address and size of
151+
the secure regions present.
152+
146153
required:
147154
- reg
148155

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mtd/partitions/linksys,ns-partitions.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Linksys Northstar partitioning
8+
9+
description: |
10+
Linksys devices based on Broadcom Northstar architecture often use two
11+
firmware partitions. One is used for regular booting, the other is treated as
12+
fallback.
13+
14+
This binding allows defining all fixed partitions and marking those containing
15+
firmware. System can use that information e.g. for booting or flashing
16+
purposes.
17+
18+
maintainers:
19+
- Rafał Miłecki <rafal@milecki.pl>
20+
21+
properties:
22+
compatible:
23+
const: linksys,ns-partitions
24+
25+
"#address-cells":
26+
enum: [ 1, 2 ]
27+
28+
"#size-cells":
29+
enum: [ 1, 2 ]
30+
31+
patternProperties:
32+
"^partition@[0-9a-f]+$":
33+
$ref: "partition.yaml#"
34+
properties:
35+
compatible:
36+
items:
37+
- const: linksys,ns-firmware
38+
- const: brcm,trx
39+
unevaluatedProperties: false
40+
41+
required:
42+
- "#address-cells"
43+
- "#size-cells"
44+
45+
additionalProperties: false
46+
47+
examples:
48+
- |
49+
partitions {
50+
compatible = "linksys,ns-partitions";
51+
#address-cells = <1>;
52+
#size-cells = <1>;
53+
54+
partition@0 {
55+
label = "boot";
56+
reg = <0x0 0x100000>;
57+
read-only;
58+
};
59+
60+
partition@100000 {
61+
label = "nvram";
62+
reg = <0x100000 0x100000>;
63+
};
64+
65+
partition@200000 {
66+
compatible = "linksys,ns-firmware", "brcm,trx";
67+
reg = <0x200000 0xf00000>;
68+
};
69+
70+
partition@1100000 {
71+
compatible = "linksys,ns-firmware", "brcm,trx";
72+
reg = <0x1100000 0xf00000>;
73+
};
74+
};
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mtd/partitions/nvmem-cells.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Nvmem cells
8+
9+
description: |
10+
Any partition containing the compatible "nvmem-cells" will register as a
11+
nvmem provider.
12+
Each direct subnodes represents a nvmem cell following the nvmem binding.
13+
Nvmem binding to declare nvmem-cells can be found in:
14+
Documentation/devicetree/bindings/nvmem/nvmem.yaml
15+
16+
maintainers:
17+
- Ansuel Smith <ansuelsmth@gmail.com>
18+
19+
allOf:
20+
- $ref: /schemas/nvmem/nvmem.yaml#
21+
22+
properties:
23+
compatible:
24+
const: nvmem-cells
25+
26+
required:
27+
- compatible
28+
29+
additionalProperties: true
30+
31+
examples:
32+
- |
33+
partitions {
34+
compatible = "fixed-partitions";
35+
#address-cells = <1>;
36+
#size-cells = <1>;
37+
38+
/* ... */
39+
40+
};
41+
art: art@1200000 {
42+
compatible = "nvmem-cells";
43+
reg = <0x1200000 0x0140000>;
44+
label = "art";
45+
read-only;
46+
#address-cells = <1>;
47+
#size-cells = <1>;
48+
49+
macaddr_gmac1: macaddr_gmac1@0 {
50+
reg = <0x0 0x6>;
51+
};
52+
53+
macaddr_gmac2: macaddr_gmac2@6 {
54+
reg = <0x6 0x6>;
55+
};
56+
57+
pre_cal_24g: pre_cal_24g@1000 {
58+
reg = <0x1000 0x2f20>;
59+
};
60+
61+
pre_cal_5g: pre_cal_5g@5000{
62+
reg = <0x5000 0x2f20>;
63+
};
64+
};
65+
- |
66+
partitions {
67+
compatible = "fixed-partitions";
68+
#address-cells = <1>;
69+
#size-cells = <1>;
70+
71+
partition@0 {
72+
label = "bootloader";
73+
reg = <0x000000 0x100000>;
74+
read-only;
75+
};
76+
77+
firmware@100000 {
78+
compatible = "brcm,trx";
79+
label = "firmware";
80+
reg = <0x100000 0xe00000>;
81+
};
82+
83+
calibration@f00000 {
84+
compatible = "nvmem-cells";
85+
label = "calibration";
86+
reg = <0xf00000 0x100000>;
87+
ranges = <0 0xf00000 0x100000>;
88+
#address-cells = <1>;
89+
#size-cells = <1>;
90+
91+
wifi0@0 {
92+
reg = <0x000000 0x080000>;
93+
};
94+
95+
wifi1@80000 {
96+
reg = <0x080000 0x080000>;
97+
};
98+
};
99+
};
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mtd/qcom,nandc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm NAND controller
8+
9+
maintainers:
10+
- Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
11+
12+
properties:
13+
compatible:
14+
enum:
15+
- qcom,ipq806x-nand
16+
- qcom,ipq4019-nand
17+
- qcom,ipq6018-nand
18+
- qcom,ipq8074-nand
19+
- qcom,sdx55-nand
20+
21+
reg:
22+
maxItems: 1
23+
24+
clocks:
25+
items:
26+
- description: Core Clock
27+
- description: Always ON Clock
28+
29+
clock-names:
30+
items:
31+
- const: core
32+
- const: aon
33+
34+
"#address-cells": true
35+
"#size-cells": true
36+
37+
patternProperties:
38+
"^nand@[a-f0-9]$":
39+
type: object
40+
properties:
41+
nand-bus-width:
42+
const: 8
43+
44+
nand-ecc-strength:
45+
enum: [1, 4, 8]
46+
47+
nand-ecc-step-size:
48+
enum:
49+
- 512
50+
51+
allOf:
52+
- $ref: "nand-controller.yaml#"
53+
54+
- if:
55+
properties:
56+
compatible:
57+
contains:
58+
const: qcom,ipq806x-nand
59+
then:
60+
properties:
61+
dmas:
62+
items:
63+
- description: rxtx DMA channel
64+
65+
dma-names:
66+
items:
67+
- const: rxtx
68+
69+
qcom,cmd-crci:
70+
$ref: /schemas/types.yaml#/definitions/uint32
71+
description:
72+
Must contain the ADM command type CRCI block instance number
73+
specified for the NAND controller on the given platform
74+
75+
qcom,data-crci:
76+
$ref: /schemas/types.yaml#/definitions/uint32
77+
description:
78+
Must contain the ADM data type CRCI block instance number
79+
specified for the NAND controller on the given platform
80+
81+
- if:
82+
properties:
83+
compatible:
84+
contains:
85+
enum:
86+
- qcom,ipq4019-nand
87+
- qcom,ipq6018-nand
88+
- qcom,ipq8074-nand
89+
- qcom,sdx55-nand
90+
91+
then:
92+
properties:
93+
dmas:
94+
items:
95+
- description: tx DMA channel
96+
- description: rx DMA channel
97+
- description: cmd DMA channel
98+
99+
dma-names:
100+
items:
101+
- const: tx
102+
- const: rx
103+
- const: cmd
104+
105+
required:
106+
- compatible
107+
- reg
108+
- clocks
109+
- clock-names
110+
111+
unevaluatedProperties: false
112+
113+
examples:
114+
- |
115+
#include <dt-bindings/clock/qcom,gcc-ipq806x.h>
116+
nand-controller@1ac00000 {
117+
compatible = "qcom,ipq806x-nand";
118+
reg = <0x1ac00000 0x800>;
119+
120+
clocks = <&gcc EBI2_CLK>,
121+
<&gcc EBI2_AON_CLK>;
122+
clock-names = "core", "aon";
123+
124+
dmas = <&adm_dma 3>;
125+
dma-names = "rxtx";
126+
qcom,cmd-crci = <15>;
127+
qcom,data-crci = <3>;
128+
129+
#address-cells = <1>;
130+
#size-cells = <0>;
131+
132+
nand@0 {
133+
reg = <0>;
134+
135+
nand-ecc-strength = <4>;
136+
nand-bus-width = <8>;
137+
138+
partitions {
139+
compatible = "fixed-partitions";
140+
#address-cells = <1>;
141+
#size-cells = <1>;
142+
143+
partition@0 {
144+
label = "boot-nand";
145+
reg = <0 0x58a0000>;
146+
};
147+
148+
partition@58a0000 {
149+
label = "fs-nand";
150+
reg = <0x58a0000 0x4000000>;
151+
};
152+
};
153+
};
154+
};
155+
156+
#include <dt-bindings/clock/qcom,gcc-ipq4019.h>
157+
nand-controller@79b0000 {
158+
compatible = "qcom,ipq4019-nand";
159+
reg = <0x79b0000 0x1000>;
160+
161+
clocks = <&gcc GCC_QPIC_CLK>,
162+
<&gcc GCC_QPIC_AHB_CLK>;
163+
clock-names = "core", "aon";
164+
165+
dmas = <&qpicbam 0>,
166+
<&qpicbam 1>,
167+
<&qpicbam 2>;
168+
dma-names = "tx", "rx", "cmd";
169+
170+
#address-cells = <1>;
171+
#size-cells = <0>;
172+
173+
nand@0 {
174+
reg = <0>;
175+
nand-ecc-strength = <4>;
176+
nand-bus-width = <8>;
177+
178+
partitions {
179+
compatible = "fixed-partitions";
180+
#address-cells = <1>;
181+
#size-cells = <1>;
182+
183+
partition@0 {
184+
label = "boot-nand";
185+
reg = <0 0x58a0000>;
186+
};
187+
188+
partition@58a0000 {
189+
label = "fs-nand";
190+
reg = <0x58a0000 0x4000000>;
191+
};
192+
};
193+
};
194+
};
195+
196+
...

0 commit comments

Comments
 (0)