Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1212741

Re: [PATCH] spi: ti-qspi: use 128 bit transfer mode for writing to flash

From Vignesh R <vigneshr@ti.com>
Newsgroups linux.kernel
Subject Re: [PATCH] spi: ti-qspi: use 128 bit transfer mode for writing to flash
Date 2015-08-25 09:00 +0200
Message-ID <q1gn9-7jI-29@gated-at.bofh.it> (permalink)
References <pZvqi-2fu-5@gated-at.bofh.it> <pZCi5-3Fh-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 08/20/2015 11:25 PM, Mark Brown wrote:
> On Thu, Aug 20, 2015 at 04:00:59PM +0530, Vignesh R wrote:
> 
>> -			writeb(*txbuf, qspi->base + QSPI_SPI_DATA_REG);
>> +			if (count >= QSPI_WLEN_MAX_BYTES) {
>> +				u32 *txp = (u32 *)txbuf;
>> +
>> +				data = cpu_to_be32(*txp++);
>> +				writel(data, qspi->base +
>> +				       QSPI_SPI_DATA_REG_3);
>> +				data = cpu_to_be32(*txp++);
>> +				writel(data, qspi->base +
>> +				       QSPI_SPI_DATA_REG_2);
>> +				data = cpu_to_be32(*txp++);
>> +				writel(data, qspi->base +
>> +				       QSPI_SPI_DATA_REG_1);
>> +				data = cpu_to_be32(*txp++);
>> +				writel(data, qspi->base +
>> +				       QSPI_SPI_DATA_REG);
>> +				xfer_len = QSPI_WLEN_MAX_BYTES;
>> +				cmd |= QSPI_WLEN(QSPI_WLEN_MAX_BITS);
>> +			} else {
>> +				writeb(*txbuf, qspi->base + QSPI_SPI_DATA_REG);
>> +				cmd = qspi->cmd | QSPI_WR_SNGL;
>> +				xfer_len = wlen;
>> +				cmd |= QSPI_WLEN(wlen);
>> +			}
> 
> It's a bit sad that this isn't able to do a Duff's device type thing and
> only kicks in for the full 128 bit FIFO size, it looks like it could do
> any number of words.
> 

Yes, any number of bytes can be transfered (max 16 bytes).
I will try to work on your suggestion. Thanks!

-- 
Regards
Vignesh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] spi: ti-qspi: use 128 bit transfer mode for writing to flash Vignesh R <vigneshr@ti.com> - 2015-08-20 12:40 +0200
  Re: [PATCH] spi: ti-qspi: use 128 bit transfer mode for writing to  flash Mark Brown <broonie@kernel.org> - 2015-08-20 20:00 +0200
    Re: [PATCH] spi: ti-qspi: use 128 bit transfer mode for writing to  flash Vignesh R <vigneshr@ti.com> - 2015-08-25 09:00 +0200

csiph-web