Commit 1227db9e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull MTD updates from Miquel Raynal:
 "Core MTD changes:
   - mtdchar: add MEMREAD ioctl
   - Add ECC error accounting for each read request
   - always initialize 'stats' in struct mtd_oob_ops
   - Track maximum number of bitflips for each read request
   - Fix repeated word in comment
   - Move from strlcpy with unused retval to strscpy
   - Fix a typo in a comment
   - Add binding for U-Boot bootloader partitions

  MTD device drivers changes:
   - FTL: use container_of() rather than cast
   - docg3:
      - Use correct function names in comment blocks
      - Check the return value of devm_ioremap() in the probe
   - physmap-core: Fix NULL pointer dereferencing in
     of_select_probe_type()
   - parsers: add Broadcom's U-Boot parser

  Raw NAND core changes:
   - Replace of_gpio_named_count() by gpiod_count()
   - Remove misguided comment of nand_get_device()
   - bbt: Use the bitmap API to allocate bitmaps

  Raw NAND controller drivers changes:
   - Meson:
      - Stop supporting legacy clocks
      - Refine resource getting in probe
      - Convert bindings to yaml
      - Fix clock handling and update the bindings accordingly
      - Fix bit map use in meson_nfc_ecc_correct()
   - bcm47xx:
      - Fix spelling typo in comment
   - STM32 FMC2:
      - Switch to using devm_fwnode_gpiod_get()
      - Fix dma_map_sg error check
   - Cadence:
      - Remove an unneeded result variable
   - Marvell:
      - Fix error handle regarding dma_map_sg
   - Orion:
      - Use devm_clk_get_optional()
   - Cafe:
      - Use correct function name in comment block
   - Atmel:
      - Unmap streaming DMA mappings
   - Arasan:
      - Stop using 0 as NULL pointer
   - GPMI:
      - Fix typo 'the the' in comment
   - BRCM:
      - Add individual glue driver selection
      - Move Kconfig to driver folder
   - FSL: Fix none ECC mode
   - Intel:
      - Use devm_platform_ioremap_resource_byname()
      - Remove unused clk_rate member from struct ebu_nand
      - Remove unused nand_pa member from ebu_nand_cs
      - Don't re-define NAND_DATA_IFACE_CHECK_ONLY
      - Remove undocumented compatible string
      - Fix compatible string in the bindings
      - Read the chip-select line from the correct OF node
      - Fix maximum chip select value in the bindings"

* tag 'mtd/for-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (43 commits)
  mtd: rawnand: meson: stop supporting legacy clocks
  dt-bindings: nand: meson: convert txt to yaml
  mtd: rawnand: meson: refine resource getting in probe
  mtd: rawnand: meson: fix the clock
  dt-bindings: nand: meson: fix meson nfc clock
  mtd: rawnand: bcm47xx: fix spelling typo in comment
  mtd: rawnand: stm32_fmc2: switch to using devm_fwnode_gpiod_get()
  mtd: rawnand: cadence: Remove an unneeded result variable
  mtd: rawnand: Replace of_gpio_named_count() by gpiod_count()
  mtd: rawnand: marvell: Fix error handle regarding dma_map_sg
  mtd: rawnand: stm32_fmc2: Fix dma_map_sg error check
  mtd: rawnand: remove misguided comment of nand_get_device()
  mtd: rawnand: orion: Use devm_clk_get_optional()
  mtd: rawnand: cafe: Use correct function name in comment block
  mtd: rawnand: atmel: Unmap streaming DMA mappings
  mtd: rawnand: meson: fix bit map use in meson_nfc_ecc_correct()
  mtd: rawnand: arasan: stop using 0 as NULL pointer
  mtd: rawnand: gpmi: Fix typo 'the the' in comment
  mtd: rawnand: brcmnand: Add individual glue driver selection
  mtd: rawnand: brcmnand: Move Kconfig to driver folder
  ...
parents 94e8ca6e 63c30d70
Loading
Loading
Loading
Loading
+0 −60
Original line number Diff line number Diff line
Amlogic NAND Flash Controller (NFC) for GXBB/GXL/AXG family SoCs

This file documents the properties in addition to those available in
the MTD NAND bindings.

Required properties:
- compatible : contains one of:
  - "amlogic,meson-gxl-nfc"
  - "amlogic,meson-axg-nfc"
- clocks     :
	A list of phandle + clock-specifier pairs for the clocks listed
	in clock-names.

- clock-names: Should contain the following:
	"core" - NFC module gate clock
	"device" - device clock from eMMC sub clock controller
	"rx" - rx clock phase
	"tx" - tx clock phase

- amlogic,mmc-syscon	: Required for NAND clocks, it's shared with SD/eMMC
				controller port C

Optional children nodes:
Children nodes represent the available nand chips.

Other properties:
see Documentation/devicetree/bindings/mtd/nand-controller.yaml for generic bindings.

Example demonstrate on AXG SoC:

	sd_emmc_c_clkc: mmc@7000 {
		compatible = "amlogic,meson-axg-mmc-clkc", "syscon";
		reg = <0x0 0x7000 0x0 0x800>;
	};

	nand-controller@7800 {
		compatible = "amlogic,meson-axg-nfc";
		reg = <0x0 0x7800 0x0 0x100>;
		#address-cells = <1>;
		#size-cells = <0>;
		interrupts = <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>;

		clocks = <&clkc CLKID_SD_EMMC_C>,
			<&sd_emmc_c_clkc CLKID_MMC_DIV>,
			<&sd_emmc_c_clkc CLKID_MMC_PHASE_RX>,
			<&sd_emmc_c_clkc CLKID_MMC_PHASE_TX>;
		clock-names = "core", "device", "rx", "tx";
		amlogic,mmc-syscon = <&sd_emmc_c_clkc>;

		pinctrl-names = "default";
		pinctrl-0 = <&nand_pins>;

		nand@0 {
			reg = <0>;
			#address-cells = <1>;
			#size-cells = <1>;

			nand-on-flash-bbt;
		};
	};
+93 −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/amlogic,meson-nand.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Amlogic NAND Flash Controller (NFC) for GXBB/GXL/AXG family SoCs

allOf:
  - $ref: nand-controller.yaml

maintainers:
  - liang.yang@amlogic.com

properties:
  compatible:
    enum:
      - amlogic,meson-gxl-nfc
      - amlogic,meson-axg-nfc

  reg:
    maxItems: 2

  reg-names:
    items:
      - const: nfc
      - const: emmc

  interrupts:
    maxItems: 1

  clocks:
    minItems: 2

  clock-names:
    items:
      - const: core
      - const: device

patternProperties:
  "^nand@[0-7]$":
    type: object
    properties:
      reg:
        minimum: 0
        maximum: 1

      nand-ecc-mode:
        const: hw

      nand-ecc-step-size:
        const: 1024

      nand-ecc-strength:
        enum: [8, 16, 24, 30, 40, 50, 60]
        description: |
          The ECC configurations that can be supported are as follows.
            meson-gxl-nfc 8, 16, 24, 30, 40, 50, 60
            meson-axg-nfc 8

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/clock/axg-clkc.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    nand-controller@ffe07800 {
      compatible = "amlogic,meson-axg-nfc";
      reg = <0xffe07800 0x100>, <0xffe07000 0x800>;
      reg-names = "nfc", "emmc";
      interrupts = <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>;
      clocks = <&clkc CLKID_SD_EMMC_C>,  <&clkc CLKID_FCLK_DIV2>;
      clock-names = "core", "device";

      pinctrl-0 = <&nand_pins>;
      pinctrl-names = "default";

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

      nand@0 {
        reg = <0>;
      };
    };

...
+4 −4
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mtd/intel,lgm-nand.yaml#
$id: http://devicetree.org/schemas/mtd/intel,lgm-ebunand.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Intel LGM SoC NAND Controller Device Tree Bindings
@@ -14,7 +14,7 @@ maintainers:

properties:
  compatible:
    const: intel,lgm-nand
    const: intel,lgm-ebunand

  reg:
    maxItems: 6
@@ -51,7 +51,7 @@ patternProperties:
    properties:
      reg:
        minimum: 0
        maximum: 7
        maximum: 1

      nand-ecc-mode: true

@@ -75,7 +75,7 @@ additionalProperties: false
examples:
  - |
    nand-controller@e0f00000 {
      compatible = "intel,lgm-nand";
      compatible = "intel,lgm-ebunand";
      reg = <0xe0f00000 0x100>,
            <0xe1000000 0x300>,
            <0xe1400000 0x8000>,
+49 −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/partitions/u-boot.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: U-Boot bootloader partition

description: |
  U-Boot is a bootlodaer commonly used in embedded devices. It's almost always
  located on some kind of flash device.

  Device configuration is stored as a set of environment variables that are
  located in a (usually standalone) block of data.

maintainers:
  - Rafał Miłecki <rafal@milecki.pl>

allOf:
  - $ref: partition.yaml#

properties:
  compatible:
    oneOf:
      - const: brcm,u-boot
        description: |
          Broadcom stores environment variables inside a U-Boot partition. They
          can be identified by a custom header with magic value.

unevaluatedProperties: false

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

        partition@0 {
            compatible = "brcm,u-boot";
            reg = <0x0 0x100000>;
            label = "u-boot";
        };

        partition@100000 {
            reg = <0x100000 0x1ff00000>;
            label = "firmware";
        };
    };
+1 −1
Original line number Diff line number Diff line
@@ -461,7 +461,7 @@ static int block2mtd_setup(const char *val, const struct kernel_param *kp)
	   the device (even kmalloc() fails). Deter that work to
	   block2mtd_setup2(). */

	strlcpy(block2mtd_paramline, val, sizeof(block2mtd_paramline));
	strscpy(block2mtd_paramline, val, sizeof(block2mtd_paramline));

	return 0;
#endif
Loading