Add dma_alignment field to spi_master
Subsystems (2)
cover Add dma_alignment field to spi_master
Some SPI controllers have restrictions on DMAable buffers alignemt. Currently if the buffer supplied by protocol driver is not properly aligned, the controller silently performs transfer in PIO mode. Addition of dma_alignment field to spi_master allows protocol drivers to perform proper alignment.
Mike Rapoport (3):
SPI: add dma_alignment field to spi_master
pxa2xx_spi: set spi_master.dma_alignment = 8
spi_imx: set spi_master.dma_alignment = 4
drivers/spi/pxa2xx_spi.c | 2 ++ drivers/spi/spi_imx.c | 2 ++ include/linux/spi/spi.h | 6 ++++++ 3 files changed, 10 insertions(+), 0 deletions(-)
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
PATCH RESEND 1/3 SPI: add dma_alignment field to spi_master
Some SPI controllers have restrictions on DMAable buffers alignemt. Currently if the buffer supplied by protocol driver is not properly aligned, the controller silently performs transfer in PIO mode. Addition of dma_alignment field to spi_master allows protocol drivers to perform proper alignment.
--- include/linux/spi/spi.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
include/linux/spi/spi.h +6 -0
@@ -204,6 +204,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)* SPI slaves, and are numbered from zero to num_chipselects. * each slave has a chipselect signal, but it's common that not * every chipselect is connected to a slave. +* @dma_alignment: SPI controller constraint on DMA buffers alignment. * @setup: updates the device mode and clocking records used by a * device's SPI controller; protocol code may call this. This * must fail if an unrecognized or unsupported mode is requested.
@@ -239,6 +240,11 @@ struct spi_master {*/ u16 num_chipselect; +/* some SPI controllers pose alignment requirements on DMAable +* buffers; let protocol drivers know about these requirements. +*/ +u16 dma_alignment; +/* setup mode and clock, etc (spi driver may call many times) */ int (*setup)(struct spi_device *spi);
Signature · 9 lines
1.5.6.4 ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
PATCH RESEND 2/3 pxa2xx_spi: set spi_master.dma_alignment = 8
In reply to Mike Rapoport--- drivers/spi/pxa2xx_spi.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/spi/pxa2xx_spi.c +2 -0
@@ -55,6 +55,7 @@ MODULE_ALIAS("platform:pxa2xx-spi");#define RESET_DMA_CHANNEL (DCSR_NODESC | DMA_INT_MASK)#define IS_DMA_ALIGNED (x) ((((u32)(x)) & 0x07) == 0)#define MAX_DMA_LEN 8191 +#define DMA_ALIGNMENT 8/* * for testing SSCR1 changes that require SSP restart, basically
@@ -1440,6 +1441,7 @@ static int __init pxa2xx_spi_probe(struct platform_device *pdev) master->bus_num = pdev->id; master->num_chipselect = platform_info->num_chipselect; + master->dma_alignment =DMA_ALIGNMENT ; master->cleanup = cleanup; master->setup = setup; master->transfer = transfer;
Signature · 9 lines
1.5.6.4 ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
PATCH RESEND 3/3 spi_imx: set spi_master.dma_alignment = 4
In reply to Mike Rapoport--- drivers/spi/spi_imx.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/spi/spi_imx.c +2 -0
@@ -186,6 +186,7 @@#define QUEUE_STOPPED (1)#define IS_DMA_ALIGNED (x) (((u32)(x) & 0x03) == 0) +#define DMA_ALIGNMENT 4/*-------------------------------------------------------------------------*/
@@ -1481,6 +1482,7 @@ static int __init spi_imx_probe(struct platform_device *pdev) master->bus_num = pdev->id; master->num_chipselect = platform_info->num_chipselect; + master->dma_alignment =DMA_ALIGNMENT ; master->cleanup = cleanup; master->setup = setup; master->transfer = transfer;
Signature · 9 lines
1.5.6.4 ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
A message that is not in the archive (sent off-list or not yet received): cover.1234167048.git.mike-UTxiZqZC01RS1MOuV/[email protected]
David,
Any comments?
Quoted 16 lines · Mike Rapoport
Some SPI controllers have restrictions on DMAable buffers alignemt. Currently if the buffer supplied by protocol driver is not properly aligned, the controller silently performs transfer in PIO mode. Addition of
dma_alignmentfield tospi_masterallows protocol drivers to perform proper alignment.Mike Rapoport (3):
SPI: adddma_alignmentfield tospi_master
pxa2xx_spi: set spi_master.dma_alignment = 8
spi_imx: set spi_master.dma_alignment = 4drivers/spi/pxa2xx_spi.c | 2 ++ drivers/spi/spi_imx.c | 2 ++ include/linux/spi/spi.h | 6 ++++++ 3 files changed, 10 insertions(+), 0 deletions(-)
Signature · 10 lines
Sincerely yours, Mike. ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H