diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-12 17:57:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-12 17:57:52 -0400 |
commit | 4dbf09fea60d158e60a30c419e0cfa1ea138dd57 (patch) | |
tree | 9530efcb3ca37e6664b9df41e8a33ea7286dba50 /drivers/memory | |
parent | 983dfa4b6ee556563f7963348e4e2f97fc8a15b8 (diff) | |
parent | 3008ba87093852f3756c5d33f584602e5e2a4aa4 (diff) |
Merge tag 'mtd/for-5.2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mtd/linux
Pull MTD updates from Richard Weinberger:
"MTD core changes:
- New AFS partition parser
- Update MAINTAINERS entry
- Use of fall-throughs markers
NAND core changes:
- Support having the bad block markers in either the first, second or
last page of a block. The combination of all three location is now
possible.
- Constification of NAND_OP_PARSER(_PATTERN) elements.
- Generic NAND DT bindings changed to yaml format (can be used to
check the proposed bindings. First platform to be fully supported:
sunxi.
- Stopped using several legacy hooks.
- Preparation to use the generic NAND layer with the addition of
several helpers and the removal of the struct nand_chip from
generic functions.
- Kconfig cleanup to prepare the introduction of external ECC engines
support.
- Fallthrough comments.
- Introduction of the SPI-mem dirmap API for SPI-NAND devices.
Raw NAND controller drivers changes:
- nandsim:
- Switch to ->exec-op().
- meson:
- Misc cleanups and fixes.
- New OOB layout.
- Sunxi:
- A23/A33 NAND DMA support.
- Ingenic:
- Full reorganization and cleanup.
- Clear separation between NAND controller and ECC engine.
- Support JZ4740 an JZ4725B.
- Denali:
- Clear controller/chip separation.
- ->exec_op() migration.
- Various cleanups.
- fsl_elbc:
- Enable software ECC support.
- Atmel:
- Sam9x60 support.
- GPMI:
- Introduce the GPMI_IS_MXS() macro.
- Various trivial/spelling/coding style fixes.
SPI NOR core changes:
- Print all JEDEC ID bytes on error
- Fix comment of spi_nor_find_best_erase_type()
- Add region locking flags for s25fl512s
SPI NOR controller drivers changes:
- intel-spi:
- Avoid crossing 4K address boundary on read/write
- Add support for Intel Comet Lake SPI serial flash"
* tag 'mtd/for-5.2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (120 commits)
mtd: part: fix incorrect format specifier for an unsigned long long
mtd: lpddr_cmds: Mark expected switch fall-through
mtd: phram: Mark expected switch fall-throughs
mtd: cfi_cmdset_0002: Mark expected switch fall-throughs
mtd: cfi_util: mark expected switch fall-throughs
MAINTAINERS: MTD Git repository is hosted on kernel.org
MAINTAINERS: Update jffs2 entry
mtd: afs: add v2 partition parsing
mtd: afs: factor the IIS read into partition parser
mtd: afs: factor footer parsing into the v1 part parsing
mtd: factor out v1 partition parsing
mtd: afs: simplify partition detection
mtd: afs: simplify partition parsing
mtd: partitions: Add OF support to AFS partitions
mtd: partitions: Add AFS partitions DT bindings
mtd: afs: Move AFS partition parser to parsers subdir
mtd: maps: Make uclinux_ram_map static
mtd: maps: Allow MTD_PHYSMAP with MTD_RAM
MAINTAINERS: Add myself as MTD maintainer
MAINTAINERS: Remove my name from the MTD and NAND entries
...
Diffstat (limited to 'drivers/memory')
-rw-r--r-- | drivers/memory/atmel-ebi.c | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c index c3748b414c27..0322df9dc249 100644 --- a/drivers/memory/atmel-ebi.c +++ b/drivers/memory/atmel-ebi.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/of_device.h> | 18 | #include <linux/of_device.h> |
19 | #include <linux/regmap.h> | 19 | #include <linux/regmap.h> |
20 | #include <soc/at91/atmel-sfr.h> | ||
20 | 21 | ||
21 | struct atmel_ebi_dev_config { | 22 | struct atmel_ebi_dev_config { |
22 | int cs; | 23 | int cs; |
@@ -36,6 +37,7 @@ struct atmel_ebi_dev { | |||
36 | struct atmel_ebi_caps { | 37 | struct atmel_ebi_caps { |
37 | unsigned int available_cs; | 38 | unsigned int available_cs; |
38 | unsigned int ebi_csa_offs; | 39 | unsigned int ebi_csa_offs; |
40 | const char *regmap_name; | ||
39 | void (*get_config)(struct atmel_ebi_dev *ebid, | 41 | void (*get_config)(struct atmel_ebi_dev *ebid, |
40 | struct atmel_ebi_dev_config *conf); | 42 | struct atmel_ebi_dev_config *conf); |
41 | int (*xlate_config)(struct atmel_ebi_dev *ebid, | 43 | int (*xlate_config)(struct atmel_ebi_dev *ebid, |
@@ -47,7 +49,7 @@ struct atmel_ebi_caps { | |||
47 | 49 | ||
48 | struct atmel_ebi { | 50 | struct atmel_ebi { |
49 | struct clk *clk; | 51 | struct clk *clk; |
50 | struct regmap *matrix; | 52 | struct regmap *regmap; |
51 | struct { | 53 | struct { |
52 | struct regmap *regmap; | 54 | struct regmap *regmap; |
53 | struct clk *clk; | 55 | struct clk *clk; |
@@ -357,7 +359,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np, | |||
357 | * one "atmel,smc-" property is present. | 359 | * one "atmel,smc-" property is present. |
358 | */ | 360 | */ |
359 | if (ebi->caps->ebi_csa_offs && apply) | 361 | if (ebi->caps->ebi_csa_offs && apply) |
360 | regmap_update_bits(ebi->matrix, | 362 | regmap_update_bits(ebi->regmap, |
361 | ebi->caps->ebi_csa_offs, | 363 | ebi->caps->ebi_csa_offs, |
362 | BIT(cs), 0); | 364 | BIT(cs), 0); |
363 | 365 | ||
@@ -372,6 +374,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np, | |||
372 | static const struct atmel_ebi_caps at91sam9260_ebi_caps = { | 374 | static const struct atmel_ebi_caps at91sam9260_ebi_caps = { |
373 | .available_cs = 0xff, | 375 | .available_cs = 0xff, |
374 | .ebi_csa_offs = AT91SAM9260_MATRIX_EBICSA, | 376 | .ebi_csa_offs = AT91SAM9260_MATRIX_EBICSA, |
377 | .regmap_name = "atmel,matrix", | ||
375 | .get_config = at91sam9_ebi_get_config, | 378 | .get_config = at91sam9_ebi_get_config, |
376 | .xlate_config = atmel_ebi_xslate_smc_config, | 379 | .xlate_config = atmel_ebi_xslate_smc_config, |
377 | .apply_config = at91sam9_ebi_apply_config, | 380 | .apply_config = at91sam9_ebi_apply_config, |
@@ -380,6 +383,7 @@ static const struct atmel_ebi_caps at91sam9260_ebi_caps = { | |||
380 | static const struct atmel_ebi_caps at91sam9261_ebi_caps = { | 383 | static const struct atmel_ebi_caps at91sam9261_ebi_caps = { |
381 | .available_cs = 0xff, | 384 | .available_cs = 0xff, |
382 | .ebi_csa_offs = AT91SAM9261_MATRIX_EBICSA, | 385 | .ebi_csa_offs = AT91SAM9261_MATRIX_EBICSA, |
386 | .regmap_name = "atmel,matrix", | ||
383 | .get_config = at91sam9_ebi_get_config, | 387 | .get_config = at91sam9_ebi_get_config, |
384 | .xlate_config = atmel_ebi_xslate_smc_config, | 388 | .xlate_config = atmel_ebi_xslate_smc_config, |
385 | .apply_config = at91sam9_ebi_apply_config, | 389 | .apply_config = at91sam9_ebi_apply_config, |
@@ -388,6 +392,7 @@ static const struct atmel_ebi_caps at91sam9261_ebi_caps = { | |||
388 | static const struct atmel_ebi_caps at91sam9263_ebi0_caps = { | 392 | static const struct atmel_ebi_caps at91sam9263_ebi0_caps = { |
389 | .available_cs = 0x3f, | 393 | .available_cs = 0x3f, |
390 | .ebi_csa_offs = AT91SAM9263_MATRIX_EBI0CSA, | 394 | .ebi_csa_offs = AT91SAM9263_MATRIX_EBI0CSA, |
395 | .regmap_name = "atmel,matrix", | ||
391 | .get_config = at91sam9_ebi_get_config, | 396 | .get_config = at91sam9_ebi_get_config, |
392 | .xlate_config = atmel_ebi_xslate_smc_config, | 397 | .xlate_config = atmel_ebi_xslate_smc_config, |
393 | .apply_config = at91sam9_ebi_apply_config, | 398 | .apply_config = at91sam9_ebi_apply_config, |
@@ -396,6 +401,7 @@ static const struct atmel_ebi_caps at91sam9263_ebi0_caps = { | |||
396 | static const struct atmel_ebi_caps at91sam9263_ebi1_caps = { | 401 | static const struct atmel_ebi_caps at91sam9263_ebi1_caps = { |
397 | .available_cs = 0x7, | 402 | .available_cs = 0x7, |
398 | .ebi_csa_offs = AT91SAM9263_MATRIX_EBI1CSA, | 403 | .ebi_csa_offs = AT91SAM9263_MATRIX_EBI1CSA, |
404 | .regmap_name = "atmel,matrix", | ||
399 | .get_config = at91sam9_ebi_get_config, | 405 | .get_config = at91sam9_ebi_get_config, |
400 | .xlate_config = atmel_ebi_xslate_smc_config, | 406 | .xlate_config = atmel_ebi_xslate_smc_config, |
401 | .apply_config = at91sam9_ebi_apply_config, | 407 | .apply_config = at91sam9_ebi_apply_config, |
@@ -404,6 +410,7 @@ static const struct atmel_ebi_caps at91sam9263_ebi1_caps = { | |||
404 | static const struct atmel_ebi_caps at91sam9rl_ebi_caps = { | 410 | static const struct atmel_ebi_caps at91sam9rl_ebi_caps = { |
405 | .available_cs = 0x3f, | 411 | .available_cs = 0x3f, |
406 | .ebi_csa_offs = AT91SAM9RL_MATRIX_EBICSA, | 412 | .ebi_csa_offs = AT91SAM9RL_MATRIX_EBICSA, |
413 | .regmap_name = "atmel,matrix", | ||
407 | .get_config = at91sam9_ebi_get_config, | 414 | .get_config = at91sam9_ebi_get_config, |
408 | .xlate_config = atmel_ebi_xslate_smc_config, | 415 | .xlate_config = atmel_ebi_xslate_smc_config, |
409 | .apply_config = at91sam9_ebi_apply_config, | 416 | .apply_config = at91sam9_ebi_apply_config, |
@@ -412,6 +419,7 @@ static const struct atmel_ebi_caps at91sam9rl_ebi_caps = { | |||
412 | static const struct atmel_ebi_caps at91sam9g45_ebi_caps = { | 419 | static const struct atmel_ebi_caps at91sam9g45_ebi_caps = { |
413 | .available_cs = 0x3f, | 420 | .available_cs = 0x3f, |
414 | .ebi_csa_offs = AT91SAM9G45_MATRIX_EBICSA, | 421 | .ebi_csa_offs = AT91SAM9G45_MATRIX_EBICSA, |
422 | .regmap_name = "atmel,matrix", | ||
415 | .get_config = at91sam9_ebi_get_config, | 423 | .get_config = at91sam9_ebi_get_config, |
416 | .xlate_config = atmel_ebi_xslate_smc_config, | 424 | .xlate_config = atmel_ebi_xslate_smc_config, |
417 | .apply_config = at91sam9_ebi_apply_config, | 425 | .apply_config = at91sam9_ebi_apply_config, |
@@ -420,6 +428,7 @@ static const struct atmel_ebi_caps at91sam9g45_ebi_caps = { | |||
420 | static const struct atmel_ebi_caps at91sam9x5_ebi_caps = { | 428 | static const struct atmel_ebi_caps at91sam9x5_ebi_caps = { |
421 | .available_cs = 0x3f, | 429 | .available_cs = 0x3f, |
422 | .ebi_csa_offs = AT91SAM9X5_MATRIX_EBICSA, | 430 | .ebi_csa_offs = AT91SAM9X5_MATRIX_EBICSA, |
431 | .regmap_name = "atmel,matrix", | ||
423 | .get_config = at91sam9_ebi_get_config, | 432 | .get_config = at91sam9_ebi_get_config, |
424 | .xlate_config = atmel_ebi_xslate_smc_config, | 433 | .xlate_config = atmel_ebi_xslate_smc_config, |
425 | .apply_config = at91sam9_ebi_apply_config, | 434 | .apply_config = at91sam9_ebi_apply_config, |
@@ -432,6 +441,15 @@ static const struct atmel_ebi_caps sama5d3_ebi_caps = { | |||
432 | .apply_config = sama5_ebi_apply_config, | 441 | .apply_config = sama5_ebi_apply_config, |
433 | }; | 442 | }; |
434 | 443 | ||
444 | static const struct atmel_ebi_caps sam9x60_ebi_caps = { | ||
445 | .available_cs = 0x3f, | ||
446 | .ebi_csa_offs = AT91_SFR_CCFG_EBICSA, | ||
447 | .regmap_name = "microchip,sfr", | ||
448 | .get_config = at91sam9_ebi_get_config, | ||
449 | .xlate_config = atmel_ebi_xslate_smc_config, | ||
450 | .apply_config = at91sam9_ebi_apply_config, | ||
451 | }; | ||
452 | |||
435 | static const struct of_device_id atmel_ebi_id_table[] = { | 453 | static const struct of_device_id atmel_ebi_id_table[] = { |
436 | { | 454 | { |
437 | .compatible = "atmel,at91sam9260-ebi", | 455 | .compatible = "atmel,at91sam9260-ebi", |
@@ -465,6 +483,10 @@ static const struct of_device_id atmel_ebi_id_table[] = { | |||
465 | .compatible = "atmel,sama5d3-ebi", | 483 | .compatible = "atmel,sama5d3-ebi", |
466 | .data = &sama5d3_ebi_caps, | 484 | .data = &sama5d3_ebi_caps, |
467 | }, | 485 | }, |
486 | { | ||
487 | .compatible = "microchip,sam9x60-ebi", | ||
488 | .data = &sam9x60_ebi_caps, | ||
489 | }, | ||
468 | { /* sentinel */ } | 490 | { /* sentinel */ } |
469 | }; | 491 | }; |
470 | 492 | ||
@@ -543,13 +565,14 @@ static int atmel_ebi_probe(struct platform_device *pdev) | |||
543 | 565 | ||
544 | /* | 566 | /* |
545 | * The sama5d3 does not provide an EBICSA register and thus does need | 567 | * The sama5d3 does not provide an EBICSA register and thus does need |
546 | * to access the matrix registers. | 568 | * to access it. |
547 | */ | 569 | */ |
548 | if (ebi->caps->ebi_csa_offs) { | 570 | if (ebi->caps->ebi_csa_offs) { |
549 | ebi->matrix = | 571 | ebi->regmap = |
550 | syscon_regmap_lookup_by_phandle(np, "atmel,matrix"); | 572 | syscon_regmap_lookup_by_phandle(np, |
551 | if (IS_ERR(ebi->matrix)) | 573 | ebi->caps->regmap_name); |
552 | return PTR_ERR(ebi->matrix); | 574 | if (IS_ERR(ebi->regmap)) |
575 | return PTR_ERR(ebi->regmap); | ||
553 | } | 576 | } |
554 | 577 | ||
555 | ret = of_property_read_u32(np, "#address-cells", &val); | 578 | ret = of_property_read_u32(np, "#address-cells", &val); |