Skip to content

Commit 3f06962

Browse files
committed
Merge tag 'mtd/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
Pull MTD updates from Miquel Raynal: "This contains the following changes for MTD: MTD core changes: - New Hyperbus framework - New _is_locked (concat) implementation - Various cleanups NAND core changes: - use longest matching pattern in ->exec_op() default parser - export NAND operation tracer - add flag to indicate panic_write in MTD - use kzalloc() instead of kmalloc() and memset() Raw NAND controller drivers changes: - brcmnand: - fix BCH ECC layout for large page NAND parts - fallback to detected ecc-strength, ecc-step-size - when oops in progress use pio and interrupt polling - code refactor code to introduce helper functions - add support for v7.3 controller - FSMC: - use nand_op_trace for operation tracing - GPMI: - move all driver code into single file - various cleanups (including dmaengine changes) - use runtime PM to manage clocks - implement exec_op - MTK: - correct low level time calculation of r/w cycle - improve data sampling timing for read cycle - add validity check for CE# pin setting - fix wrongly assigned OOB buffer pointer issue - re-license MTK NAND driver as Dual MIT/GPL - STM32: - manage the get_irq error case - increase DMA completion timeouts Raw NAND chips drivers changes: - Macronix: add read-retry support Onenand driver changes: - add support for 8Gb datasize chips - avoid fall-through warnings SPI-NAND changes: - define macros for page-read ops with three-byte addresses - add support for two-byte device IDs and then for GigaDevice GD5F1GQ4UFxxG - add initial support for Paragon PN26G0xA - handle the case where the last page read has bitflips SPI-NOR core changes: - add support for the mt25ql02g and w25q16jv flashes - print error in case of jedec read id fails - is25lp256: add post BFPT fix to correct the addr_width SPI NOR controller drivers changes: - intel-spi: Add support for Intel Elkhart Lake SPI serial flash - smt32: remove the driver as the driver was replaced by spi-stm32-qspi.c - cadence-quadspi: add reset control" * tag 'mtd/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (60 commits) mtd: concat: implement _is_locked mtd operation mtd: concat: refactor concat_lock/concat_unlock mtd: abi: do not use C++ style comments in uapi header mtd: afs: remove unneeded NULL check mtd: rawnand: stm32_fmc2: increase DMA completion timeouts mtd: rawnand: Use kzalloc() instead of kmalloc() and memset() mtd: hyperbus: Add driver for TI's HyperBus memory controller mtd: spinand: read returns badly if the last page has bitflips mtd: spinand: Add initial support for Paragon PN26G0xA mtd: rawnand: mtk: Re-license MTK NAND driver as Dual MIT/GPL mtd: rawnand: gpmi: remove double assignment to block_size dt-bindings: mtd: brcmnand: Add brcmnand, brcmnand-v7.3 support mtd: rawnand: brcmnand: Add support for v7.3 controller mtd: rawnand: brcmnand: Refactored code to introduce helper functions mtd: rawnand: brcmnand: When oops in progress use pio and interrupt polling mtd: Add flag to indicate panic_write mtd: rawnand: Add Macronix NAND read retry support mtd: onenand: Avoid fall-through warnings mtd: spinand: Add support for GigaDevice GD5F1GQ4UFxxG mtd: spinand: Add support for two-byte device IDs ...
2 parents 2260840 + 46ce10d commit 3f06962

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2624
-2490
lines changed

Documentation/devicetree/bindings/mtd/brcm,brcmnand.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Required properties:
2828
brcm,brcmnand-v7.0
2929
brcm,brcmnand-v7.1
3030
brcm,brcmnand-v7.2
31+
brcm,brcmnand-v7.3
3132
brcm,brcmnand
3233
- reg : the register start and length for NAND register region.
3334
(optional) Flash DMA register range (if present)
@@ -101,10 +102,10 @@ Required properties:
101102
number (e.g., 0, 1, 2, etc.)
102103
- #address-cells : see partition.txt
103104
- #size-cells : see partition.txt
104-
- nand-ecc-strength : see nand-controller.yaml
105-
- nand-ecc-step-size : must be 512 or 1024. See nand-controller.yaml
106105

107106
Optional properties:
107+
- nand-ecc-strength : see nand-controller.yaml
108+
- nand-ecc-step-size : must be 512 or 1024. See nand-controller.yaml
108109
- nand-on-flash-bbt : boolean, to enable the on-flash BBT for this
109110
chip-select. See nand-controller.yaml
110111
- brcm,nand-oob-sector-size : integer, to denote the spare area sector size

Documentation/devicetree/bindings/mtd/cadence-quadspi.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ custom properties:
3535
(qspi_n_ss_out).
3636
- cdns,tslch-ns : Delay in nanoseconds between setting qspi_n_ss_out low
3737
and first bit transfer.
38+
- resets : Must contain an entry for each entry in reset-names.
39+
See ../reset/reset.txt for details.
40+
- reset-names : Must include either "qspi" and/or "qspi-ocp".
3841

3942
Example:
4043

@@ -50,6 +53,8 @@ Example:
5053
cdns,fifo-depth = <128>;
5154
cdns,fifo-width = <4>;
5255
cdns,trigger-address = <0x00000000>;
56+
resets = <&rst QSPI_RESET>, <&rst QSPI_OCP_RESET>;
57+
reset-names = "qspi", "qspi-ocp";
5358

5459
flash0: n25q00@0 {
5560
...
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Bindings for HyperFlash NOR flash chips compliant with Cypress HyperBus
2+
specification and supports Cypress CFI specification 1.5 command set.
3+
4+
Required properties:
5+
- compatible : "cypress,hyperflash", "cfi-flash" for HyperFlash NOR chips
6+
- reg : Address of flash's memory map
7+
8+
Example:
9+
10+
flash@0 {
11+
compatible = "cypress,hyperflash", "cfi-flash";
12+
reg = <0x0 0x4000000>;
13+
};

Documentation/devicetree/bindings/mtd/stm32-quadspi.txt

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Bindings for HyperBus Memory Controller (HBMC) on TI's K3 family of SoCs
2+
3+
Required properties:
4+
- compatible : "ti,am654-hbmc" for AM654 SoC
5+
- reg : Two entries:
6+
First entry pointed to the register space of HBMC controller
7+
Second entry pointing to the memory map region dedicated for
8+
MMIO access to attached flash devices
9+
- ranges : Address translation from offset within CS to allocated MMIO
10+
space in SoC
11+
12+
Optional properties:
13+
- mux-controls : phandle to the multiplexer that controls selection of
14+
HBMC vs OSPI inside Flash SubSystem (FSS). Default is OSPI,
15+
if property is absent.
16+
See Documentation/devicetree/bindings/mux/reg-mux.txt
17+
for mmio-mux binding details
18+
19+
Example:
20+
21+
system-controller@47000000 {
22+
compatible = "syscon", "simple-mfd";
23+
reg = <0x0 0x47000000 0x0 0x100>;
24+
#address-cells = <2>;
25+
#size-cells = <2>;
26+
ranges;
27+
28+
hbmc_mux: multiplexer {
29+
compatible = "mmio-mux";
30+
#mux-control-cells = <1>;
31+
mux-reg-masks = <0x4 0x2>; /* 0: reg 0x4, bit 1 */
32+
};
33+
};
34+
35+
hbmc: hyperbus@47034000 {
36+
compatible = "ti,am654-hbmc";
37+
reg = <0x0 0x47034000 0x0 0x100>,
38+
<0x5 0x00000000 0x1 0x0000000>;
39+
power-domains = <&k3_pds 55>;
40+
#address-cells = <2>;
41+
#size-cells = <1>;
42+
ranges = <0x0 0x0 0x5 0x00000000 0x4000000>, /* CS0 - 64MB */
43+
<0x1 0x0 0x5 0x04000000 0x4000000>; /* CS1 - 64MB */
44+
mux-controls = <&hbmc_mux 0>;
45+
46+
/* Slave flash node */
47+
flash@0,0 {
48+
compatible = "cypress,hyperflash", "cfi-flash";
49+
reg = <0x0 0x0 0x4000000>;
50+
};
51+
};

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7435,6 +7435,14 @@ F: include/asm-generic/mshyperv.h
74357435
F: tools/hv/
74367436
F: Documentation/ABI/stable/sysfs-bus-vmbus
74377437

7438+
HYPERBUS SUPPORT
7439+
M: Vignesh Raghavendra <vigneshr@ti.com>
7440+
S: Supported
7441+
F: drivers/mtd/hyperbus/
7442+
F: include/linux/mtd/hyperbus.h
7443+
F: Documentation/devicetree/bindings/mtd/cypress,hyperflash.txt
7444+
F: Documentation/devicetree/bindings/mtd/ti,am654-hbmc.txt
7445+
74387446
HYPERVISOR VIRTUAL CONSOLE DRIVER
74397447
L: linuxppc-dev@lists.ozlabs.org
74407448
S: Odd Fixes

drivers/dma/mxs-dma.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/of_device.h>
2525
#include <linux/of_dma.h>
2626
#include <linux/list.h>
27+
#include <linux/dma/mxs-dma.h>
2728

2829
#include <asm/irq.h>
2930

@@ -77,6 +78,7 @@
7778
#define BM_CCW_COMMAND (3 << 0)
7879
#define CCW_CHAIN (1 << 2)
7980
#define CCW_IRQ (1 << 3)
81+
#define CCW_WAIT4RDY (1 << 5)
8082
#define CCW_DEC_SEM (1 << 6)
8183
#define CCW_WAIT4END (1 << 7)
8284
#define CCW_HALT_ON_TERM (1 << 8)
@@ -477,16 +479,16 @@ static void mxs_dma_free_chan_resources(struct dma_chan *chan)
477479
* ......
478480
* ->device_prep_slave_sg(0);
479481
* ......
480-
* ->device_prep_slave_sg(DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
482+
* ->device_prep_slave_sg(DMA_CTRL_ACK);
481483
* ......
482484
* [3] If there are more than two DMA commands in the DMA chain, the code
483485
* should be:
484486
* ......
485487
* ->device_prep_slave_sg(0); // First
486488
* ......
487-
* ->device_prep_slave_sg(DMA_PREP_INTERRUPT [| DMA_CTRL_ACK]);
489+
* ->device_prep_slave_sg(DMA_CTRL_ACK]);
488490
* ......
489-
* ->device_prep_slave_sg(DMA_PREP_INTERRUPT | DMA_CTRL_ACK); // Last
491+
* ->device_prep_slave_sg(DMA_CTRL_ACK); // Last
490492
* ......
491493
*/
492494
static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
@@ -500,13 +502,12 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
500502
struct scatterlist *sg;
501503
u32 i, j;
502504
u32 *pio;
503-
bool append = flags & DMA_PREP_INTERRUPT;
504-
int idx = append ? mxs_chan->desc_count : 0;
505+
int idx = 0;
505506

506-
if (mxs_chan->status == DMA_IN_PROGRESS && !append)
507-
return NULL;
507+
if (mxs_chan->status == DMA_IN_PROGRESS)
508+
idx = mxs_chan->desc_count;
508509

509-
if (sg_len + (append ? idx : 0) > NUM_CCW) {
510+
if (sg_len + idx > NUM_CCW) {
510511
dev_err(mxs_dma->dma_device.dev,
511512
"maximum number of sg exceeded: %d > %d\n",
512513
sg_len, NUM_CCW);
@@ -520,7 +521,7 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
520521
* If the sg is prepared with append flag set, the sg
521522
* will be appended to the last prepared sg.
522523
*/
523-
if (append) {
524+
if (idx) {
524525
BUG_ON(idx < 1);
525526
ccw = &mxs_chan->ccw[idx - 1];
526527
ccw->next = mxs_chan->ccw_phys + sizeof(*ccw) * idx;
@@ -541,12 +542,14 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
541542
ccw->bits = 0;
542543
ccw->bits |= CCW_IRQ;
543544
ccw->bits |= CCW_DEC_SEM;
544-
if (flags & DMA_CTRL_ACK)
545+
if (flags & MXS_DMA_CTRL_WAIT4END)
545546
ccw->bits |= CCW_WAIT4END;
546547
ccw->bits |= CCW_HALT_ON_TERM;
547548
ccw->bits |= CCW_TERM_FLUSH;
548549
ccw->bits |= BF_CCW(sg_len, PIO_NUM);
549550
ccw->bits |= BF_CCW(MXS_DMA_CMD_NO_XFER, COMMAND);
551+
if (flags & MXS_DMA_CTRL_WAIT4RDY)
552+
ccw->bits |= CCW_WAIT4RDY;
550553
} else {
551554
for_each_sg(sgl, sg, sg_len, i) {
552555
if (sg_dma_len(sg) > MAX_XFER_BYTES) {
@@ -573,7 +576,7 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
573576
ccw->bits &= ~CCW_CHAIN;
574577
ccw->bits |= CCW_IRQ;
575578
ccw->bits |= CCW_DEC_SEM;
576-
if (flags & DMA_CTRL_ACK)
579+
if (flags & MXS_DMA_CTRL_WAIT4END)
577580
ccw->bits |= CCW_WAIT4END;
578581
}
579582
}

drivers/mtd/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,4 +274,6 @@ source "drivers/mtd/spi-nor/Kconfig"
274274

275275
source "drivers/mtd/ubi/Kconfig"
276276

277+
source "drivers/mtd/hyperbus/Kconfig"
278+
277279
endif # MTD

drivers/mtd/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ obj-y += chips/ lpddr/ maps/ devices/ nand/ tests/
3434

3535
obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/
3636
obj-$(CONFIG_MTD_UBI) += ubi/
37+
obj-$(CONFIG_MTD_HYPERBUS) += hyperbus/

0 commit comments

Comments
 (0)