Skip to content

Commit cc07b0a

Browse files
committed
Merge tag 'mtd/for-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
Pull MTD updates from Miquel Raynal: "MTD core: - Bad blocks increment is skipped if the block is already known bad (improves user statistics relevance) - Expose the OOB layout via debugfs Raw NAND: - Add support for Loongson-2K1000 and Loongson-2K0500 NAND controllers, including extra features, such as chip select and 6-byte NAND ID reading support - Drop the s3c2410 driver SPI NAND: - Important SPI NAND continuous read improvements and fixes - Add support for FudanMicro FM25S01A - Add support for continuous reads in Gigadevice vendor driver ECC: - Add support for the Realtek ECC engine SPI NOR: - Some flashes can't perform reads or writes with start or end being an odd number in Octal DTR mode. File systems like UBIFS can request such reads or writes, causing the transaction to error out. Pad the read or write transactions with extra bytes to avoid this problem. And the usual amount of various miscellaneous fixes" * tag 'mtd/for-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (46 commits) mtd: rawnand: sunxi: drop unused module alias mtd: rawnand: stm32_fmc2: drop unused module alias mtd: rawnand: rockchip: drop unused module alias mtd: rawnand: pl353: drop unused module alias mtd: rawnand: omap2: drop unused module alias mtd: rawnand: atmel: drop unused module alias mtd: onenand: omap2: drop unused module alias mtd: hyperbus: hbmc-am654: drop unused module alias mtd: jedec_probe: use struct_size() helper for cfiq allocation mtd: cfi: use struct_size() helper for cfiq allocation mtd: nand: raw: gpmi: fix clocks when CONFIG_PM=N mtd: rawnand: omap2: fix device leak on probe failure mtd: rawnand: atmel: Fix error handling path in atmel_nand_controller_add_nands mtd: nand: realtek-ecc: Add Realtek external ECC engine support dt-bindings: mtd: Add realtek,rtl9301-ecc mtd: spinand: repeat reading in regular mode if continuous reading fails mtd: spinand: try a regular dirmap if creating a dirmap for continuous reading fails mtd: spinand: fix direct mapping creation sizes mtd: rawnand: fsmc: Default to autodetect buswidth mtd: nand: move nand_check_erased_ecc_chunk() to nand/core ...
2 parents 20f868d + efebdf4 commit cc07b0a

Some content is hidden

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

49 files changed

+2257
-2457
lines changed

Documentation/devicetree/bindings/mtd/loongson,ls1b-nand-controller.yaml

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
$id: http://devicetree.org/schemas/mtd/loongson,ls1b-nand-controller.yaml#
55
$schema: http://devicetree.org/meta-schemas/core.yaml#
66

7-
title: Loongson-1 NAND Controller
7+
title: Loongson NAND Controller
88

99
maintainers:
1010
- Keguang Zhang <[email protected]>
11+
- Binbin Zhou <[email protected]>
1112

1213
description:
13-
The Loongson-1 NAND controller abstracts all supported operations,
14+
The Loongson NAND controller abstracts all supported operations,
1415
meaning it does not support low-level access to raw NAND flash chips.
1516
Moreover, the controller is paired with the DMA engine to perform
1617
READ and PROGRAM functions.
@@ -24,18 +25,23 @@ properties:
2425
- enum:
2526
- loongson,ls1b-nand-controller
2627
- loongson,ls1c-nand-controller
28+
- loongson,ls2k0500-nand-controller
29+
- loongson,ls2k1000-nand-controller
2730
- items:
2831
- enum:
2932
- loongson,ls1a-nand-controller
3033
- const: loongson,ls1b-nand-controller
3134

3235
reg:
33-
maxItems: 2
36+
minItems: 2
37+
maxItems: 3
3438

3539
reg-names:
40+
minItems: 2
3641
items:
3742
- const: nand
3843
- const: nand-dma
44+
- const: dma-config
3945

4046
dmas:
4147
maxItems: 1
@@ -52,6 +58,27 @@ required:
5258

5359
unevaluatedProperties: false
5460

61+
if:
62+
properties:
63+
compatible:
64+
contains:
65+
enum:
66+
- loongson,ls2k1000-nand-controller
67+
68+
then:
69+
properties:
70+
reg:
71+
minItems: 3
72+
reg-names:
73+
minItems: 3
74+
75+
else:
76+
properties:
77+
reg:
78+
maxItems: 2
79+
reg-names:
80+
maxItems: 2
81+
5582
examples:
5683
- |
5784
nand-controller@1fe78000 {
@@ -70,3 +97,26 @@ examples:
7097
nand-ecc-algo = "hamming";
7198
};
7299
};
100+
101+
- |
102+
nand-controller@1fe26000 {
103+
compatible = "loongson,ls2k1000-nand-controller";
104+
reg = <0x1fe26000 0x24>,
105+
<0x1fe26040 0x4>,
106+
<0x1fe00438 0x8>;
107+
reg-names = "nand", "nand-dma", "dma-config";
108+
dmas = <&apbdma0 0>;
109+
dma-names = "rxtx";
110+
111+
#address-cells = <1>;
112+
#size-cells = <0>;
113+
114+
nand@0 {
115+
reg = <0>;
116+
label = "ls2k1000-nand";
117+
nand-use-soft-ecc-engine;
118+
nand-ecc-algo = "bch";
119+
nand-ecc-strength = <8>;
120+
nand-ecc-step-size = <512>;
121+
};
122+
};
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mtd/realtek,rtl9301-ecc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Realtek SoCs NAND ECC engine
8+
9+
maintainers:
10+
- Markus Stockhausen <[email protected]>
11+
12+
properties:
13+
compatible:
14+
const: realtek,rtl9301-ecc
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+
soc {
34+
#address-cells = <1>;
35+
#size-cells = <1>;
36+
37+
ecc0: ecc@1a600 {
38+
compatible = "realtek,rtl9301-ecc";
39+
reg = <0x1a600 0x54>;
40+
};
41+
};

Documentation/devicetree/bindings/mtd/samsung-s3c2410.txt

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

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17241,7 +17241,7 @@ F: Documentation/devicetree/bindings/*/loongson,ls1*.yaml
1724117241
F: arch/mips/include/asm/mach-loongson32/
1724217242
F: arch/mips/loongson32/
1724317243
F: drivers/*/*loongson1*
17244-
F: drivers/mtd/nand/raw/loongson1-nand-controller.c
17244+
F: drivers/mtd/nand/raw/loongson-nand-controller.c
1724517245
F: drivers/net/ethernet/stmicro/stmmac/dwmac-loongson1.c
1724617246
F: sound/soc/loongson/loongson1_ac97.c
1724717247

drivers/mtd/chips/cfi_probe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static int __xipram cfi_chip_setup(struct map_info *map,
208208
if (!num_erase_regions)
209209
return 0;
210210

211-
cfi->cfiq = kmalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL);
211+
cfi->cfiq = kmalloc(struct_size(cfi->cfiq, EraseRegionInfo, num_erase_regions), GFP_KERNEL);
212212
if (!cfi->cfiq)
213213
return 0;
214214

drivers/mtd/chips/jedec_probe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,7 +1953,7 @@ static void jedec_reset(u32 base, struct map_info *map, struct cfi_private *cfi)
19531953
* as they will ignore the writes and don't care what address
19541954
* the F0 is written to */
19551955
if (cfi->addr_unlock1) {
1956-
pr_debug( "reset unlock called %x %x \n",
1956+
pr_debug("reset unlock called %x %x\n",
19571957
cfi->addr_unlock1,cfi->addr_unlock2);
19581958
cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
19591959
cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL);
@@ -1985,7 +1985,7 @@ static int cfi_jedec_setup(struct map_info *map, struct cfi_private *cfi, int in
19851985

19861986
num_erase_regions = jedec_table[index].nr_regions;
19871987

1988-
cfi->cfiq = kmalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL);
1988+
cfi->cfiq = kmalloc(struct_size(cfi->cfiq, EraseRegionInfo, num_erase_regions), GFP_KERNEL);
19891989
if (!cfi->cfiq) {
19901990
//xx printk(KERN_WARNING "%s: kmalloc failed for CFI ident structure\n", map->name);
19911991
return 0;

drivers/mtd/ftl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static int build_maps(partition_t *part)
263263

264264
/* Set up virtual page map */
265265
blocks = le32_to_cpu(header.FormattedSize) >> header.BlockSize;
266-
part->VirtualBlockMap = vmalloc(array_size(blocks, sizeof(uint32_t)));
266+
part->VirtualBlockMap = vmalloc_array(blocks, sizeof(uint32_t));
267267
if (!part->VirtualBlockMap)
268268
goto out_XferInfo;
269269

drivers/mtd/hyperbus/hbmc-am654.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,5 +272,4 @@ module_platform_driver(am654_hbmc_platform_driver);
272272

273273
MODULE_DESCRIPTION("HBMC driver for AM654 SoC");
274274
MODULE_LICENSE("GPL v2");
275-
MODULE_ALIAS("platform:hbmc-am654");
276275
MODULE_AUTHOR("Vignesh Raghavendra <[email protected]>");

drivers/mtd/lpddr/lpddr_cmds.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static int wait_for_ready(struct map_info *map, struct flchip *chip,
142142
if (dsr & DSR_READY_STATUS)
143143
break;
144144
if (!timeo) {
145-
printk(KERN_ERR "%s: Flash timeout error state %d \n",
145+
printk(KERN_ERR "%s: Flash timeout error state %d\n",
146146
map->name, chip_state);
147147
ret = -ETIME;
148148
break;
@@ -186,7 +186,7 @@ static int wait_for_ready(struct map_info *map, struct flchip *chip,
186186
if (dsr & DSR_ERR) {
187187
/* Clear DSR*/
188188
map_write(map, CMD(~(DSR_ERR)), map->pfow_base + PFOW_DSR);
189-
printk(KERN_WARNING"%s: Bad status on wait: 0x%x \n",
189+
printk(KERN_WARNING"%s: Bad status on wait: 0x%x\n",
190190
map->name, dsr);
191191
print_drs_error(dsr);
192192
ret = -EIO;
@@ -321,7 +321,7 @@ static int chip_ready(struct map_info *map, struct flchip *chip, int mode)
321321
/* Resume and pretend we weren't here. */
322322
put_chip(map, chip);
323323
printk(KERN_ERR "%s: suspend operation failed."
324-
"State may be wrong \n", map->name);
324+
"State may be wrong\n", map->name);
325325
return -EIO;
326326
}
327327
chip->erase_suspended = 1;
@@ -468,7 +468,7 @@ static int do_write_buffer(struct map_info *map, struct flchip *chip,
468468
chip->state = FL_WRITING;
469469
ret = wait_for_ready(map, chip, (1<<lpddr->qinfo->ProgBufferTime));
470470
if (ret) {
471-
printk(KERN_WARNING"%s Buffer program error: %d at %lx; \n",
471+
printk(KERN_WARNING"%s Buffer program error: %d at %lx\n",
472472
map->name, ret, adr);
473473
goto out;
474474
}
@@ -736,7 +736,7 @@ static int do_xxlock(struct mtd_info *mtd, loff_t adr, uint32_t len, int thunk)
736736

737737
ret = wait_for_ready(map, chip, 1);
738738
if (ret) {
739-
printk(KERN_ERR "%s: block unlock error status %d \n",
739+
printk(KERN_ERR "%s: block unlock error status %d\n",
740740
map->name, ret);
741741
goto out;
742742
}

drivers/mtd/lpddr/qinfo_probe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static long lpddr_get_qinforec_pos(struct map_info *map, char *id_str)
5555
return minor | (major << bankwidth);
5656
}
5757
}
58-
printk(KERN_ERR"%s qinfo id string is wrong! \n", map->name);
58+
printk(KERN_ERR"%s qinfo id string is wrong!\n", map->name);
5959
BUG();
6060
return -1;
6161
}
@@ -112,7 +112,7 @@ static int lpddr_pfow_present(struct map_info *map, struct lpddr_private *lpddr)
112112

113113
return 1; /* "PFOW" is found */
114114
out:
115-
printk(KERN_WARNING"%s: PFOW string at 0x%lx is not found \n",
115+
printk(KERN_WARNING"%s: PFOW string at 0x%lx is not found\n",
116116
map->name, map->pfow_base);
117117
return 0;
118118
}

0 commit comments

Comments
 (0)