mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
Core changes:
* Support non-uniform erase size * Support controllers with limited TX fifo size Driver changes: * m25p80: Re-issue a WREN command after each write access * cadence: Pass a proper dir value to dma_[un]map_single() * fsl-qspi: Check fsl_qspi_get_seqid() return val make sure 4B addressing opcodes are properly handled * intel-spi: Add a new PCI entry for Ice Lake -----BEGIN PGP SIGNATURE----- iQI5BAABCAAjBQJbwJx7HBxib3Jpcy5icmV6aWxsb25AYm9vdGxpbi5jb20ACgkQ Ze02AX4ItwALIg//aRM/Nk7izL1XuZpYQdqWh+Gwvxnd7KPx7o/XRxuORzj/7Cep YTvkcIrxnc5/0wI43FEpMJT6ACVZ3fUVfOR5eUezMlqlrxwwxaeNLDSysEbvANXB rBwznfD9Nt92fykVOU6pInIuVcg6qB9iysegWidzQFPd7wVtg9R/7soP5apfAbD7 OcS+R2LAXEApcgm8qzG3rLdpeApZ9pcGJYe/uCSFDCw7cWBHJzNwfVndjyZw1ieW sLFHlHdjybq9CURmjiIvCrnxLsmRkuvt51ij8Lr1Y6fsmSseeuwuOKKyzTDvo3Re NMkf/InvH5Nh+O0VD8rvwvpXTlRwcCvPuWfw7fTW8jLM+dhSZa+wAzavauv2LEzW 9f1i+goFv+/ys+7I9spXvGJvZEuvdGHX14Eg5F6WufqTOUMwuZz7mhbbGRnn2cbD XW7YEVecUSWx57yFZ/PcI3ePVgd4G67kwjccsPyZyq2/aThSvbf4n9+FQ4V1o1nC 8cb8MAEoAxyzE6jZPOb06FNNctBVtgHQVagsuwWZ3k2q7Pcg9z8r0iwqcqvJp9Pg nPiSEu4oAHA4QG5NeEvL2Ickt/Mu/il3JDFrsq3xfSUo0i8ANrl3shv2FRW/mLYV 8bqlbCYoQsciEglbmEaoGj37OsZNDq0HzK9TWmimLMQp9fsV4f+92+rXYEI= =j2Li -----END PGP SIGNATURE----- Merge tag 'spi-nor/for-4.20' of git://git.infradead.org/linux-mtd into mtd/next Core changes: * Support non-uniform erase size * Support controllers with limited TX fifo size Driver changes: * m25p80: Re-issue a WREN command after each write access * cadence: Pass a proper dir value to dma_[un]map_single() * fsl-qspi: Check fsl_qspi_get_seqid() return val make sure 4B addressing opcodes are properly handled * intel-spi: Add a new PCI entry for Ice Lake
This commit is contained in:
commit
5cc1b66e63
6 changed files with 1001 additions and 86 deletions
|
|
@ -70,7 +70,6 @@ static ssize_t m25p80_write(struct spi_nor *nor, loff_t to, size_t len,
|
|||
SPI_MEM_OP_ADDR(nor->addr_width, to, 1),
|
||||
SPI_MEM_OP_NO_DUMMY,
|
||||
SPI_MEM_OP_DATA_OUT(len, buf, 1));
|
||||
size_t remaining = len;
|
||||
int ret;
|
||||
|
||||
/* get transfer protocols. */
|
||||
|
|
@ -81,22 +80,16 @@ static ssize_t m25p80_write(struct spi_nor *nor, loff_t to, size_t len,
|
|||
if (nor->program_opcode == SPINOR_OP_AAI_WP && nor->sst_write_second)
|
||||
op.addr.nbytes = 0;
|
||||
|
||||
while (remaining) {
|
||||
op.data.nbytes = remaining < UINT_MAX ? remaining : UINT_MAX;
|
||||
ret = spi_mem_adjust_op_size(flash->spimem, &op);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = spi_mem_adjust_op_size(flash->spimem, &op);
|
||||
if (ret)
|
||||
return ret;
|
||||
op.data.nbytes = len < op.data.nbytes ? len : op.data.nbytes;
|
||||
|
||||
ret = spi_mem_exec_op(flash->spimem, &op);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = spi_mem_exec_op(flash->spimem, &op);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
op.addr.val += op.data.nbytes;
|
||||
remaining -= op.data.nbytes;
|
||||
op.data.buf.out += op.data.nbytes;
|
||||
}
|
||||
|
||||
return len;
|
||||
return op.data.nbytes;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -959,7 +959,7 @@ static int cqspi_direct_read_execute(struct spi_nor *nor, u_char *buf,
|
|||
return 0;
|
||||
}
|
||||
|
||||
dma_dst = dma_map_single(nor->dev, buf, len, DMA_DEV_TO_MEM);
|
||||
dma_dst = dma_map_single(nor->dev, buf, len, DMA_FROM_DEVICE);
|
||||
if (dma_mapping_error(nor->dev, dma_dst)) {
|
||||
dev_err(nor->dev, "dma mapping failed\n");
|
||||
return -ENOMEM;
|
||||
|
|
@ -994,7 +994,7 @@ static int cqspi_direct_read_execute(struct spi_nor *nor, u_char *buf,
|
|||
}
|
||||
|
||||
err_unmap:
|
||||
dma_unmap_single(nor->dev, dma_dst, len, DMA_DEV_TO_MEM);
|
||||
dma_unmap_single(nor->dev, dma_dst, len, DMA_FROM_DEVICE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -478,6 +478,7 @@ static int fsl_qspi_get_seqid(struct fsl_qspi *q, u8 cmd)
|
|||
{
|
||||
switch (cmd) {
|
||||
case SPINOR_OP_READ_1_1_4:
|
||||
case SPINOR_OP_READ_1_1_4_4B:
|
||||
return SEQID_READ;
|
||||
case SPINOR_OP_WREN:
|
||||
return SEQID_WREN;
|
||||
|
|
@ -543,6 +544,9 @@ fsl_qspi_runcmd(struct fsl_qspi *q, u8 cmd, unsigned int addr, int len)
|
|||
|
||||
/* trigger the LUT now */
|
||||
seqid = fsl_qspi_get_seqid(q, cmd);
|
||||
if (seqid < 0)
|
||||
return seqid;
|
||||
|
||||
qspi_writel(q, (seqid << QUADSPI_IPCR_SEQID_SHIFT) | len,
|
||||
base + QUADSPI_IPCR);
|
||||
|
||||
|
|
@ -671,7 +675,7 @@ static void fsl_qspi_set_map_addr(struct fsl_qspi *q)
|
|||
* causes the controller to clear the buffer, and use the sequence pointed
|
||||
* by the QUADSPI_BFGENCR[SEQID] to initiate a read from the flash.
|
||||
*/
|
||||
static void fsl_qspi_init_ahb_read(struct fsl_qspi *q)
|
||||
static int fsl_qspi_init_ahb_read(struct fsl_qspi *q)
|
||||
{
|
||||
void __iomem *base = q->iobase;
|
||||
int seqid;
|
||||
|
|
@ -696,8 +700,13 @@ static void fsl_qspi_init_ahb_read(struct fsl_qspi *q)
|
|||
|
||||
/* Set the default lut sequence for AHB Read. */
|
||||
seqid = fsl_qspi_get_seqid(q, q->nor[0].read_opcode);
|
||||
if (seqid < 0)
|
||||
return seqid;
|
||||
|
||||
qspi_writel(q, seqid << QUADSPI_BFGENCR_SEQID_SHIFT,
|
||||
q->iobase + QUADSPI_BFGENCR);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* This function was used to prepare and enable QSPI clock */
|
||||
|
|
@ -805,9 +814,7 @@ static int fsl_qspi_nor_setup_last(struct fsl_qspi *q)
|
|||
fsl_qspi_init_lut(q);
|
||||
|
||||
/* Init for AHB read */
|
||||
fsl_qspi_init_ahb_read(q);
|
||||
|
||||
return 0;
|
||||
return fsl_qspi_init_ahb_read(q);
|
||||
}
|
||||
|
||||
static const struct of_device_id fsl_qspi_dt_ids[] = {
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ static void intel_spi_pci_remove(struct pci_dev *pdev)
|
|||
static const struct pci_device_id intel_spi_pci_ids[] = {
|
||||
{ PCI_VDEVICE(INTEL, 0x18e0), (unsigned long)&bxt_info },
|
||||
{ PCI_VDEVICE(INTEL, 0x19e0), (unsigned long)&bxt_info },
|
||||
{ PCI_VDEVICE(INTEL, 0x34a4), (unsigned long)&bxt_info },
|
||||
{ PCI_VDEVICE(INTEL, 0xa1a4), (unsigned long)&bxt_info },
|
||||
{ PCI_VDEVICE(INTEL, 0xa224), (unsigned long)&bxt_info },
|
||||
{ },
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue