Merge tag 'mtd/for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 17 Oct 2020 17:45:42 +0000 (10:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 17 Oct 2020 17:45:42 +0000 (10:45 -0700)
Pull MTD updates from Richard Weinberger:
 "NAND core changes:
   - Drop useless 'depends on' in Kconfig
   - Add an extra level in the Kconfig hierarchy
   - Trivial spellings
   - Dynamic allocation of the interface configurations
   - Dropping the default ONFI timing mode
   - Various cleanup (types, structures, naming, comments)
   - Hide the chip->data_interface indirection
   - Add the generic rb-gpios property
   - Add the ->choose_interface_config() hook
   - Introduce nand_choose_best_sdr_timings()
   - Use default values for tPROG_max and tBERS_max
   - Avoid redefining tR_max and tCCS_min
   - Add a helper to find the closest ONFI mode
   - bcm63xx MTD parsers: simplify CFE detection

  Raw NAND controller drivers changes:
   - fsl-upm: Deprecation of specific DT properties
   - fsl_upm: Driver rework and cleanup in favor of ->exec_op()
   - Ingenic: Cleanup ARRAY_SIZE() vs sizeof() use
   - brcmnand: ECC error handling on EDU transfers
   - brcmnand: Don't default to EDU transfers
   - qcom: Set BAM mode only if not set already
   - qcom: Avoid write to unavailable register
   - gpio: Driver rework in favor of ->exec_op()
   - tango: ->exec_op() conversion
   - mtk: ->exec_op() conversion

  Raw NAND chip drivers changes:
   - toshiba: Implement ->choose_interface_config() for TH58NVG2S3HBAI4
   - toshiba: Implement ->choose_interface_config() for TC58NVG0S3E
   - toshiba: Implement ->choose_interface_config() for TC58TEG5DCLTA00
   - hynix: Implement ->choose_interface_config() for H27UCG8T2ATR-BC

  HyperBus changes:
   - DMA support for TI's AM654 HyperBus controller driver.
   - HyperBus frontend driver for Renesas RPC-IF driver.

  SPI NOR core changes:
   - Support for Winbond w25q64jwm flash
   - Enable 4K sector support for mx25l12805d

  SPI NOR controller drivers changes:
   - intel-spi Add Alder Lake-S PCI ID

  MTD Core changes:
   - mtdoops: Don't run panic write twice
   - mtdconcat: Correctly handle panic write
   - Use DEFINE_SHOW_ATTRIBUTE"

* tag 'mtd/for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (76 commits)
  mtd: hyperbus: Fix build failure when only RPCIF_HYPERBUS is enabled
  mtd: hyperbus: add Renesas RPC-IF driver
  Revert "mtd: spi-nor: Prefer asynchronous probe"
  mtd: parsers: bcm63xx: Do not make it modular
  mtd: spear_smi: Enable compile testing
  mtd: maps: vmu-flash: fix typos for struct memcard
  mtd: physmap: Add Baikal-T1 physically mapped ROM support
  mtd: maps: vmu-flash: simplify the return expression of probe_maple_vmu
  mtd: onenand: simplify the return expression of onenand_transfer_auto_oob
  mtd: rawnand: cadence: remove a redundant dev_err call
  mtd: rawnand: ams-delta: Fix non-OF build warning
  mtd: rawnand: Don't overwrite the error code from nand_set_ecc_soft_ops()
  mtd: rawnand: Introduce nand_set_ecc_on_host_ops()
  mtd: rawnand: atmel: Check return values for nand_read_data_op
  mtd: rawnand: vf610: Remove unused function vf610_nfc_transfer_size()
  mtd: rawnand: qcom: Simplify with dev_err_probe()
  mtd: rawnand: marvell: Fix and update kerneldoc
  mtd: rawnand: marvell: Simplify with dev_err_probe()
  mtd: rawnand: gpmi: Simplify with dev_err_probe()
  mtd: rawnand: atmel: Simplify with dev_err_probe()
  ...

1  2 
Documentation/devicetree/bindings/mtd/nand-controller.yaml
arch/arm/mach-s3c24xx/mach-gta02.c
arch/arm/mach-s3c24xx/mach-rx1950.c
drivers/mtd/mtdcore.c

@@@ -55,6 -55,37 +55,37 @@@ patternProperties
          $ref: /schemas/types.yaml#/definitions/string
          enum: [none, soft, hw, hw_syndrome, hw_oob_first, on-die]
  
+       nand-ecc-engine:
+         allOf:
+           - $ref: /schemas/types.yaml#/definitions/phandle
+         description: |
+           A phandle on the hardware ECC engine if any. There are
+           basically three possibilities:
+           1/ The ECC engine is part of the NAND controller, in this
+           case the phandle should reference the parent node.
+           2/ The ECC engine is part of the NAND part (on-die), in this
+           case the phandle should reference the node itself.
+           3/ The ECC engine is external, in this case the phandle should
+           reference the specific ECC engine node.
+       nand-use-soft-ecc-engine:
+         type: boolean
+         description: Use a software ECC engine.
+       nand-no-ecc-engine:
+         type: boolean
+         description: Do not use any ECC correction.
+       nand-ecc-placement:
+         allOf:
+           - $ref: /schemas/types.yaml#/definitions/string
+           - enum: [ oob, interleaved ]
+         description:
+           Location of the ECC bytes. This location is unknown by default
+           but can be explicitly set to "oob", if all ECC bytes are
+           known to be stored in the OOB area, or "interleaved" if ECC
+           bytes will be interleaved with regular data in the main area.
        nand-ecc-algo:
          description:
            Desired ECC algorithm.
@@@ -128,8 -159,6 +159,8 @@@ required
    - "#address-cells"
    - "#size-cells"
  
 +additionalProperties: true
 +
  examples:
    - |
      nand-controller {
@@@ -15,7 -15,6 +15,7 @@@
  #include <linux/delay.h>
  #include <linux/timer.h>
  #include <linux/init.h>
 +#include <linux/gpio/machine.h>
  #include <linux/gpio.h>
  #include <linux/gpio_keys.h>
  #include <linux/workqueue.h>
@@@ -417,7 -416,7 +417,7 @@@ static struct s3c2410_platform_nand __i
        .twrph1         = 15,
        .nr_sets        = ARRAY_SIZE(gta02_nand_sets),
        .sets           = gta02_nand_sets,
-       .ecc_mode       = NAND_ECC_SOFT,
+       .engine_type    = NAND_ECC_ENGINE_TYPE_SOFT,
  };
  
  
@@@ -475,20 -474,6 +475,20 @@@ static struct platform_device gta02_but
        },
  };
  
 +static struct gpiod_lookup_table gta02_audio_gpio_table = {
 +      .dev_id = "neo1973-audio",
 +      .table = {
 +              GPIO_LOOKUP("GPIOJ", 2, "amp-shut", GPIO_ACTIVE_HIGH),
 +              GPIO_LOOKUP("GPIOJ", 1, "hp", GPIO_ACTIVE_HIGH),
 +              { },
 +      },
 +};
 +
 +static struct platform_device gta02_audio = {
 +      .name = "neo1973-audio",
 +      .id = -1,
 +};
 +
  static void __init gta02_map_io(void)
  {
        s3c24xx_init_io(gta02_iodesc, ARRAY_SIZE(gta02_iodesc));
@@@ -513,7 -498,6 +513,7 @@@ static struct platform_device *gta02_de
        &gta02_buttons_device,
        &s3c_device_adc,
        &s3c_device_ts,
 +      &gta02_audio,
  };
  
  static void gta02_poweroff(void)
@@@ -540,7 -524,6 +540,7 @@@ static void __init gta02_machine_init(v
  
        i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs));
  
 +      gpiod_add_lookup_table(&gta02_audio_gpio_table);
        platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
        pm_power_off = gta02_poweroff;
  
@@@ -620,7 -620,7 +620,7 @@@ static struct s3c2410_platform_nand rx1
        .twrph1 = 15,
        .nr_sets = ARRAY_SIZE(rx1950_nand_sets),
        .sets = rx1950_nand_sets,
-       .ecc_mode = NAND_ECC_SOFT,
+       .engine_type = NAND_ECC_ENGINE_TYPE_SOFT,
  };
  
  static struct s3c2410_udc_mach_info rx1950_udc_cfg __initdata = {
@@@ -728,20 -728,6 +728,20 @@@ static struct i2c_board_info rx1950_i2c
        },
  };
  
 +static struct gpiod_lookup_table rx1950_audio_gpio_table = {
 +      .dev_id = "rx1950-audio",
 +      .table = {
 +              GPIO_LOOKUP("GPIOG", 12, "hp-gpio", GPIO_ACTIVE_HIGH),
 +              GPIO_LOOKUP("GPIOA", 1, "speaker-power", GPIO_ACTIVE_HIGH),
 +              { },
 +      },
 +};
 +
 +static struct platform_device rx1950_audio = {
 +      .name = "rx1950-audio",
 +      .id = -1,
 +};
 +
  static struct platform_device *rx1950_devices[] __initdata = {
        &s3c2410_device_dclk,
        &s3c_device_lcd,
        &power_supply,
        &rx1950_battery,
        &rx1950_leds,
 +      &rx1950_audio,
  };
  
  static void __init rx1950_map_io(void)
@@@ -828,7 -813,6 +828,7 @@@ static void __init rx1950_init_machine(
        gpio_direction_output(S3C2410_GPJ(6), 0);
  
        pwm_add_table(rx1950_pwm_lookup, ARRAY_SIZE(rx1950_pwm_lookup));
 +      gpiod_add_lookup_table(&rx1950_audio_gpio_table);
        platform_add_devices(rx1950_devices, ARRAY_SIZE(rx1950_devices));
  
        i2c_register_board_info(0, rx1950_i2c_devices,
diff --combined drivers/mtd/mtdcore.c
@@@ -335,7 -335,7 +335,7 @@@ static const struct device_type mtd_dev
        .release        = mtd_release,
  };
  
- static int mtd_partid_show(struct seq_file *s, void *p)
+ static int mtd_partid_debug_show(struct seq_file *s, void *p)
  {
        struct mtd_info *mtd = s->private;
  
        return 0;
  }
  
- static int mtd_partid_debugfs_open(struct inode *inode, struct file *file)
- {
-       return single_open(file, mtd_partid_show, inode->i_private);
- }
- static const struct file_operations mtd_partid_debug_fops = {
-       .open           = mtd_partid_debugfs_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
- };
+ DEFINE_SHOW_ATTRIBUTE(mtd_partid_debug);
  
- static int mtd_partname_show(struct seq_file *s, void *p)
+ static int mtd_partname_debug_show(struct seq_file *s, void *p)
  {
        struct mtd_info *mtd = s->private;
  
        return 0;
  }
  
- static int mtd_partname_debugfs_open(struct inode *inode, struct file *file)
- {
-       return single_open(file, mtd_partname_show, inode->i_private);
- }
- static const struct file_operations mtd_partname_debug_fops = {
-       .open           = mtd_partname_debugfs_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
- };
+ DEFINE_SHOW_ATTRIBUTE(mtd_partname_debug);
  
  static struct dentry *dfs_dir_mtd;
  
@@@ -2196,8 -2176,6 +2176,8 @@@ static struct backing_dev_info * __ini
        bdi = bdi_alloc(NUMA_NO_NODE);
        if (!bdi)
                return ERR_PTR(-ENOMEM);
 +      bdi->ra_pages = 0;
 +      bdi->io_pages = 0;
  
        /*
         * We put '-0' suffix to the name to get the same name format as we