Commit 69e9b12a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull MTD updates from Richard Weinberger:
 "MTD core changes:
   - Initial support for BCM4908 partitions

  Raw NAND controller drivers:
   - Intel: Fix an error handling path in 'ebu_dma_start()'
   - Tango: Remove the driver
   - Marvell: Convert comma to semicolon
   - MXC: Convert comma to semicolon
   - Qcom: Add support for Qcom SMEM parser

  Related MTD changes:
   - parsers: Add Qcom SMEM parser

  SPI NOR core changes:
   - Add non-uniform erase fixes.
   - Add Global Block Unlock command. It is defined by few flash
     vendors, and it is used for now just by sst.

  SPI NOR controller drivers changes:
   - intel-spi: Add support for Intel Alder Lake-P SPI serial flash.
   - hisi-sfc: Put child node np on error path"

* tag 'mtd/for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (23 commits)
  dt-bindings: mtd: add binding for BCM4908 partitions
  dt-bindings: mtd: move partition binding to its own file
  mtd: spi-nor: sst: Add support for Global Unlock on sst26vf
  mtd: spi-nor: Add Global Block Unlock command
  mtd: spi-nor: core: Add erase size check for erase command initialization
  mtd: spi-nor: core: Fix erase type discovery for overlaid region
  mtd: spi-nor: sfdp: Fix last erase region marking
  mtd: spi-nor: sfdp: Fix wrong erase type bitmask for overlaid region
  mtd: rawnand: intel: Fix an error handling path in 'ebu_dma_start()'
  mtd: rawnand: tango: Remove the driver
  mtd: rawnand: marvell: convert comma to semicolon
  mtd: st_spi_fsm: convert comma to semicolon
  mtd: convert comma to semicolon
  mtd: parsers: afs: Fix freeing the part name memory in failure
  mtd: parser: imagetag: fix error codes in bcm963xx_parse_imagetag_partitions()
  mtd: phram: use div_u64_rem to stop overwrite len in phram_setup
  mtd: remove redundant assignment to pointer eb
  mtd: spi-nor: hisi-sfc: Put child node np on error path
  mtd: spi-nor: intel-spi: Add support for Intel Alder Lake-P SPI serial flash
  mtd: rawnand: qcom: Add support for Qcom SMEM parser
  ...
parents 04471d3f 6e9dff6f
Loading
Loading
Loading
Loading
+70 −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/brcm,bcm4908-partitions.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Broadcom BCM4908 partitioning

description: |
  Broadcom BCM4908 CFE bootloader supports two firmware partitions. One is used
  for regular booting, the other is treated as fallback.

  This binding allows defining all fixed partitions and marking those containing
  firmware. System can use that information e.g. for booting or flashing
  purposes.

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

properties:
  compatible:
    const: brcm,bcm4908-partitions

  "#address-cells":
    enum: [ 1, 2 ]

  "#size-cells":
    enum: [ 1, 2 ]

patternProperties:
  "^partition@[0-9a-f]+$":
    $ref: "partition.yaml#"
    properties:
      compatible:
        const: brcm,bcm4908-firmware
    unevaluatedProperties: false

required:
  - "#address-cells"
  - "#size-cells"

additionalProperties: false

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

        partition@0 {
            label = "cferom";
            reg = <0x0 0x100000>;
        };

        partition@100000 {
            compatible = "brcm,bcm4908-firmware";
            reg = <0x100000 0xf00000>;
        };

        partition@1000000 {
            compatible = "brcm,bcm4908-firmware";
            reg = <0x1000000 0xf00000>;
        };

        partition@1f00000 {
            label = "calibration";
            reg = <0x1f00000 0x100000>;
        };
    };
+1 −32
Original line number Diff line number Diff line
@@ -27,38 +27,7 @@ properties:

patternProperties:
  "@[0-9a-f]+$":
    description: node describing a single flash partition
    type: object

    properties:
      reg:
        description: partition's offset and size within the flash
        maxItems: 1

      label:
        description: The label / name for this partition. If omitted, the label
          is taken from the node name (excluding the unit address).

      read-only:
        description: This parameter, if present, is a hint that this partition
          should only be mounted read-only. This is usually used for flash
          partitions containing early-boot firmware images or data which should
          not be clobbered.
        type: boolean

      lock:
        description: Do not unlock the partition at initialization time (not
          supported on all devices)
        type: boolean

      slc-mode:
        description: This parameter, if present, allows one to emulate SLC mode
          on a partition attached to an MLC NAND thus making this partition
          immune to paired-pages corruptions
        type: boolean

    required:
      - reg
    $ref: "partition.yaml#"

required:
  - "#address-cells"
+47 −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/partition.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Partition

description: |
  This binding describes a single flash partition. Each partition must have its
  relative offset and size specified. Depending on partition function extra
  properties can be used.

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

properties:
  reg:
    description: partition's offset and size within the flash
    maxItems: 1

  label:
    description: The label / name for this partition. If omitted, the label
      is taken from the node name (excluding the unit address).

  read-only:
    description: This parameter, if present, is a hint that this partition
      should only be mounted read-only. This is usually used for flash
      partitions containing early-boot firmware images or data which should
      not be clobbered.
    type: boolean

  lock:
    description: Do not unlock the partition at initialization time (not
      supported on all devices)
    type: boolean

  slc-mode:
    description: This parameter, if present, allows one to emulate SLC mode
      on a partition attached to an MLC NAND thus making this partition
      immune to paired-pages corruptions
    type: boolean

required:
  - reg

additionalProperties: true
+33 −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/qcom,smem-part.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm SMEM NAND flash partition parser binding

maintainers:
  - Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

description: |
  The Qualcomm SoCs supporting the NAND controller interface features a Shared
  Memory (SMEM) based partition table scheme. The maximum partitions supported
  varies between partition table revisions. V3 supports maximum 16 partitions
  and V4 supports 48 partitions.

properties:
  compatible:
    const: qcom,smem-part

required:
  - compatible

additionalProperties: false

examples:
  - |
    flash {
        partitions {
            compatible = "qcom,smem-part";
        };
    };
+5 −1
Original line number Diff line number Diff line
@@ -222,6 +222,7 @@ static int phram_setup(const char *val)
	uint64_t start;
	uint64_t len;
	uint64_t erasesize = PAGE_SIZE;
	uint32_t rem;
	int i, ret;

	if (strnlen(val, sizeof(buf)) >= sizeof(buf))
@@ -263,8 +264,11 @@ static int phram_setup(const char *val)
		}
	}

	if (erasesize)
		div_u64_rem(len, (uint32_t)erasesize, &rem);

	if (len == 0 || erasesize == 0 || erasesize > len
	    || erasesize > UINT_MAX || do_div(len, (uint32_t)erasesize) != 0) {
	    || erasesize > UINT_MAX || rem) {
		parse_err("illegal erasesize or len\n");
		goto error;
	}
Loading