Commit 9ce47e43 authored by Miquel Raynal's avatar Miquel Raynal
Browse files

Merge tag 'nand/for-5.17' into mtd/next



Raw NAND core:
* Export nand_read_page_hwecc_oob_first()

GPMC memory controller for OMAP2 NAND controller:
* GPMC:
  - Add support for AM64 SoC and allow build on K3 platforms
  - Use a compatible match table when checking for NAND controller
  - Use platform_get_irq() to get the interrupt

Raw NAND controller drivers:
* OMAP2 NAND controller:
  - Document the missing 'rb-gpios' DT property
  - Drop unused variable
  - Fix force_8bit flag behaviour for DMA mode
  - Move to exec_op interface
  - Use platform_get_irq() to get the interrupt
* Renesas:
  - Add new NAND controller driver with its bindings and MAINTAINERS entry
* Onenand:
  - Remove redundant variable ooblen
* MPC5121:
  - Remove unused variable in ads5121_select_chip()
* GPMI:
  - Add ERR007117 protection for nfc_apply_timings
  - Remove explicit default gpmi clock setting for i.MX6
  - Use platform_get_irq_byname() to get the interrupt
  - Remove unneeded variable
* Ingenic:
  - JZ4740 needs 'oob_first' read page function
* Davinci:
  - Rewrite function description
  - Avoid duplicated page read
  - Don't calculate ECC when reading page

Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parents bee38713 2997e487
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -23,13 +23,20 @@ properties:
    items:
      - enum:
          - ti,am3352-gpmc
          - ti,am64-gpmc
          - ti,omap2420-gpmc
          - ti,omap2430-gpmc
          - ti,omap3430-gpmc
          - ti,omap4430-gpmc

  reg:
    maxItems: 1
    minItems: 1
    maxItems: 2

  reg-names:
    items:
      - const: cfg
      - const: data

  interrupts:
    maxItems: 1
@@ -44,6 +51,9 @@ properties:
    items:
      - const: fck

  power-domains:
    maxItems: 1

  dmas:
    items:
      - description: DMA channel for GPMC NAND prefetch
@@ -133,6 +143,17 @@ required:
  - "#address-cells"
  - "#size-cells"

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: ti,am64-gpmc
    then:
      required:
        - reg-names
        - power-domains

additionalProperties: false

examples:
+61 −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/renesas-nandc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Renesas R-Car Gen3 & RZ/N1x NAND flash controller device tree bindings

maintainers:
  - Miquel Raynal <miquel.raynal@bootlin.com>

allOf:
  - $ref: "nand-controller.yaml"

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - renesas,r9a06g032-nandc
          - const: renesas,rzn1-nandc

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    items:
      - description: APB host controller clock
      - description: External NAND bus clock

  clock-names:
    items:
      - const: hclk
      - const: eclk

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

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/clock/r9a06g032-sysctrl.h>

    nand-controller@40102000 {
        compatible = "renesas,r9a06g032-nandc", "renesas,rzn1-nandc";
        reg = <0x40102000 0x2000>;
        interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&sysctrl R9A06G032_HCLK_NAND>, <&sysctrl R9A06G032_CLK_NAND>;
        clock-names = "hclk", "eclk";
        #address-cells = <1>;
        #size-cells = <0>;
    };
+9 −1
Original line number Diff line number Diff line
@@ -16,7 +16,10 @@ description:

properties:
  compatible:
    const: ti,omap2-nand
    items:
      - enum:
          - ti,am64-nand
          - ti,omap2-nand

  reg:
    maxItems: 1
@@ -53,6 +56,11 @@ properties:
    enum: [8, 16]
    default: 8

  rb-gpios:
    description:
      GPIO connection to R/B signal from NAND chip
    maxItems: 1

patternProperties:
  "@[0-9a-f]+$":
    $ref: "/schemas/mtd/partitions/partition.yaml"
+8 −0
Original line number Diff line number Diff line
@@ -16275,6 +16275,14 @@ S: Supported
F:	Documentation/devicetree/bindings/iio/adc/renesas,rzg2l-adc.yaml
F:	drivers/iio/adc/rzg2l_adc.c
RENESAS R-CAR GEN3 & RZ/N1 NAND CONTROLLER DRIVER
M:	Miquel Raynal <miquel.raynal@bootlin.com>
L:	linux-mtd@lists.infradead.org
L:	linux-renesas-soc@vger.kernel.org
S:	Maintained
F:	Documentation/devicetree/bindings/mtd/renesas-nandc.yaml
F:	drivers/mtd/nand/raw/renesas-nand-controller.c
RESET CONTROLLER FRAMEWORK
M:	Philipp Zabel <p.zabel@pengutronix.de>
S:	Maintained
+33 −17
Original line number Diff line number Diff line
@@ -237,6 +237,7 @@ struct gpmc_device {
	struct omap3_gpmc_regs context;
	int nirqs;
	unsigned int is_suspended:1;
	struct resource *data;
};

static struct irq_domain *gpmc_irq_domain;
@@ -1456,12 +1457,18 @@ static void gpmc_mem_exit(void)
	}
}

static void gpmc_mem_init(void)
static void gpmc_mem_init(struct gpmc_device *gpmc)
{
	int cs;

	if (!gpmc->data) {
		/* All legacy devices have same data IO window */
		gpmc_mem_root.start = GPMC_MEM_START;
		gpmc_mem_root.end = GPMC_MEM_END;
	} else {
		gpmc_mem_root.start = gpmc->data->start;
		gpmc_mem_root.end = gpmc->data->end;
	}

	/* Reserve all regions that has been set up by bootloader */
	for (cs = 0; cs < gpmc_cs_num; cs++) {
@@ -1888,6 +1895,7 @@ static const struct of_device_id gpmc_dt_ids[] = {
	{ .compatible = "ti,omap3430-gpmc" },	/* omap3430 & omap3630 */
	{ .compatible = "ti,omap4430-gpmc" },	/* omap4430 & omap4460 & omap543x */
	{ .compatible = "ti,am3352-gpmc" },	/* am335x devices */
	{ .compatible = "ti,am64-gpmc" },
	{ }
};

@@ -2175,7 +2183,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
		}
	}

	if (of_device_is_compatible(child, "ti,omap2-nand")) {
	if (of_match_node(omap_nand_ids, child)) {
		/* NAND specific setup */
		val = 8;
		of_property_read_u32(child, "nand-bus-width", &val);
@@ -2502,21 +2510,29 @@ static int gpmc_probe(struct platform_device *pdev)
	gpmc->dev = &pdev->dev;
	platform_set_drvdata(pdev, gpmc);

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res)
		return -ENOENT;

	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg");
	if (!res) {
		/* legacy DT */
		gpmc_base = devm_platform_ioremap_resource(pdev, 0);
		if (IS_ERR(gpmc_base))
			return PTR_ERR(gpmc_base);
	} else {
		gpmc_base = devm_ioremap_resource(&pdev->dev, res);
		if (IS_ERR(gpmc_base))
			return PTR_ERR(gpmc_base);

	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
		res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "data");
		if (!res) {
		dev_err(&pdev->dev, "Failed to get resource: irq\n");
			dev_err(&pdev->dev, "couldn't get data reg resource\n");
			return -ENOENT;
		}

	gpmc->irq = res->start;
		gpmc->data = res;
	}

	gpmc->irq = platform_get_irq(pdev, 0);
	if (gpmc->irq < 0)
		return gpmc->irq;

	gpmc_l3_clk = devm_clk_get(&pdev->dev, "fck");
	if (IS_ERR(gpmc_l3_clk)) {
@@ -2562,7 +2578,7 @@ static int gpmc_probe(struct platform_device *pdev)
	dev_info(gpmc->dev, "GPMC revision %d.%d\n", GPMC_REVISION_MAJOR(l),
		 GPMC_REVISION_MINOR(l));

	gpmc_mem_init();
	gpmc_mem_init(gpmc);
	rc = gpmc_gpio_init(gpmc);
	if (rc)
		goto gpio_init_failed;
Loading