Commit cc07b0a3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
  ...
parents 20f868da efebdf4b
Loading
Loading
Loading
Loading
+53 −3
Original line number Diff line number Diff line
@@ -4,13 +4,14 @@
$id: http://devicetree.org/schemas/mtd/loongson,ls1b-nand-controller.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Loongson-1 NAND Controller
title: Loongson NAND Controller

maintainers:
  - Keguang Zhang <keguang.zhang@gmail.com>
  - Binbin Zhou <zhoubinbin@loongson.cn>

description:
  The Loongson-1 NAND controller abstracts all supported operations,
  The Loongson NAND controller abstracts all supported operations,
  meaning it does not support low-level access to raw NAND flash chips.
  Moreover, the controller is paired with the DMA engine to perform
  READ and PROGRAM functions.
@@ -24,18 +25,23 @@ properties:
      - enum:
          - loongson,ls1b-nand-controller
          - loongson,ls1c-nand-controller
          - loongson,ls2k0500-nand-controller
          - loongson,ls2k1000-nand-controller
      - items:
          - enum:
              - loongson,ls1a-nand-controller
          - const: loongson,ls1b-nand-controller

  reg:
    maxItems: 2
    minItems: 2
    maxItems: 3

  reg-names:
    minItems: 2
    items:
      - const: nand
      - const: nand-dma
      - const: dma-config

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

unevaluatedProperties: false

if:
  properties:
    compatible:
      contains:
        enum:
          - loongson,ls2k1000-nand-controller

then:
  properties:
    reg:
      minItems: 3
    reg-names:
      minItems: 3

else:
  properties:
    reg:
      maxItems: 2
    reg-names:
      maxItems: 2

examples:
  - |
    nand-controller@1fe78000 {
@@ -70,3 +97,26 @@ examples:
            nand-ecc-algo = "hamming";
        };
    };

  - |
    nand-controller@1fe26000 {
        compatible = "loongson,ls2k1000-nand-controller";
        reg = <0x1fe26000 0x24>,
              <0x1fe26040 0x4>,
              <0x1fe00438 0x8>;
        reg-names = "nand", "nand-dma", "dma-config";
        dmas = <&apbdma0 0>;
        dma-names = "rxtx";

        #address-cells = <1>;
        #size-cells = <0>;

        nand@0 {
            reg = <0>;
            label = "ls2k1000-nand";
            nand-use-soft-ecc-engine;
            nand-ecc-algo = "bch";
            nand-ecc-strength = <8>;
            nand-ecc-step-size = <512>;
        };
    };
+41 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mtd/realtek,rtl9301-ecc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Realtek SoCs NAND ECC engine

maintainers:
  - Markus Stockhausen <markus.stockhausen@gmx.de>

properties:
  compatible:
    const: realtek,rtl9301-ecc

  reg:
    maxItems: 1

  clocks:
    maxItems: 1

  interrupts:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    soc {
        #address-cells = <1>;
        #size-cells = <1>;

        ecc0: ecc@1a600 {
            compatible = "realtek,rtl9301-ecc";
            reg = <0x1a600 0x54>;
        };
    };
+0 −56
Original line number Diff line number Diff line
* Samsung S3C2410 and compatible NAND flash controller

Required properties:
- compatible : The possible values are:
	"samsung,s3c2410-nand"
	"samsung,s3c2412-nand"
	"samsung,s3c2440-nand"
- reg : register's location and length.
- #address-cells, #size-cells : see nand-controller.yaml
- clocks : phandle to the nand controller clock
- clock-names : must contain "nand"

Optional child nodes:
Child nodes representing the available nand chips.

Optional child properties:
- nand-ecc-mode : see nand-controller.yaml
- nand-on-flash-bbt : see nand-controller.yaml

Each child device node may optionally contain a 'partitions' sub-node,
which further contains sub-nodes describing the flash partition mapping.
See mtd.yaml for more detail.

Example:

nand-controller@4e000000 {
	compatible = "samsung,s3c2440-nand";
	reg = <0x4e000000 0x40>;

	#address-cells = <1>;
        #size-cells = <0>;

	clocks = <&clocks HCLK_NAND>;
	clock-names = "nand";

	nand {
		nand-ecc-mode = "soft";
		nand-on-flash-bbt;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "u-boot";
				reg = <0 0x040000>;
			};

			partition@40000 {
				label = "kernel";
				reg = <0x040000 0x500000>;
			};
		};
	};
};
+1 −1
Original line number Diff line number Diff line
@@ -17241,7 +17241,7 @@ F: Documentation/devicetree/bindings/*/loongson,ls1*.yaml
F:	arch/mips/include/asm/mach-loongson32/
F:	arch/mips/loongson32/
F:	drivers/*/*loongson1*
F:	drivers/mtd/nand/raw/loongson1-nand-controller.c
F:	drivers/mtd/nand/raw/loongson-nand-controller.c
F:	drivers/net/ethernet/stmicro/stmmac/dwmac-loongson1.c
F:	sound/soc/loongson/loongson1_ac97.c
+1 −1
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ static int __xipram cfi_chip_setup(struct map_info *map,
	if (!num_erase_regions)
		return 0;

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

Loading