Skip to content

Commit e030dbf

Browse files
author
Linus Torvalds
committed
Merge branch 'ioat-md-accel-for-linus' of git://lost.foo-projects.org/~dwillia2/git/iop
* 'ioat-md-accel-for-linus' of git://lost.foo-projects.org/~dwillia2/git/iop: (28 commits) ioatdma: add the unisys "i/oat" pci vendor/device id ARM: Add drivers/dma to arch/arm/Kconfig iop3xx: surface the iop3xx DMA and AAU units to the iop-adma driver iop13xx: surface the iop13xx adma units to the iop-adma driver dmaengine: driver for the iop32x, iop33x, and iop13xx raid engines md: remove raid5 compute_block and compute_parity5 md: handle_stripe5 - request io processing in raid5_run_ops md: handle_stripe5 - add request/completion logic for async expand ops md: handle_stripe5 - add request/completion logic for async read ops md: handle_stripe5 - add request/completion logic for async check ops md: handle_stripe5 - add request/completion logic for async compute ops md: handle_stripe5 - add request/completion logic for async write ops md: common infrastructure for running operations with raid5_run_ops md: raid5_run_ops - run stripe operations outside sh->lock raid5: replace custom debug PRINTKs with standard pr_debug raid5: refactor handle_stripe5 and handle_stripe6 (v3) async_tx: add the async_tx api xor: make 'xor_blocks' a library routine for use with async_tx dmaengine: make clients responsible for managing channels dmaengine: refactor dmaengine around dma_async_tx_descriptor ...
2 parents 12a2296 + 3039f07 commit e030dbf

45 files changed

Lines changed: 8003 additions & 2389 deletions

File tree

Some content is hidden

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

‎Documentation/networking/ip-sysctl.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,12 @@ tcp_workaround_signed_windows - BOOLEAN
433433
not receive a window scaling option from them.
434434
Default: 0
435435

436+
tcp_dma_copybreak - INTEGER
437+
Lower limit, in bytes, of the size of socket reads that will be
438+
offloaded to a DMA copy engine, if one is present in the system
439+
and CONFIG_NET_DMA is enabled.
440+
Default: 4096
441+
436442
CIPSOv4 Variables:
437443

438444
cipso_cache_enable - BOOLEAN

‎arch/arm/Kconfig‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,8 @@ source "drivers/mmc/Kconfig"
10421042

10431043
source "drivers/rtc/Kconfig"
10441044

1045+
source "drivers/dma/Kconfig"
1046+
10451047
endmenu
10461048

10471049
source "fs/Kconfig"

‎arch/arm/mach-iop13xx/setup.c‎

Lines changed: 214 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <asm/hardware.h>
2626
#include <asm/irq.h>
2727
#include <asm/io.h>
28+
#include <asm/hardware/iop_adma.h>
2829

2930
#define IOP13XX_UART_XTAL 33334000
3031
#define IOP13XX_SETUP_DEBUG 0
@@ -236,19 +237,143 @@ static unsigned long iq8134x_probe_flash_size(void)
236237
}
237238
#endif
238239

240+
/* ADMA Channels */
241+
static struct resource iop13xx_adma_0_resources[] = {
242+
[0] = {
243+
.start = IOP13XX_ADMA_PHYS_BASE(0),
244+
.end = IOP13XX_ADMA_UPPER_PA(0),
245+
.flags = IORESOURCE_MEM,
246+
},
247+
[1] = {
248+
.start = IRQ_IOP13XX_ADMA0_EOT,
249+
.end = IRQ_IOP13XX_ADMA0_EOT,
250+
.flags = IORESOURCE_IRQ
251+
},
252+
[2] = {
253+
.start = IRQ_IOP13XX_ADMA0_EOC,
254+
.end = IRQ_IOP13XX_ADMA0_EOC,
255+
.flags = IORESOURCE_IRQ
256+
},
257+
[3] = {
258+
.start = IRQ_IOP13XX_ADMA0_ERR,
259+
.end = IRQ_IOP13XX_ADMA0_ERR,
260+
.flags = IORESOURCE_IRQ
261+
}
262+
};
263+
264+
static struct resource iop13xx_adma_1_resources[] = {
265+
[0] = {
266+
.start = IOP13XX_ADMA_PHYS_BASE(1),
267+
.end = IOP13XX_ADMA_UPPER_PA(1),
268+
.flags = IORESOURCE_MEM,
269+
},
270+
[1] = {
271+
.start = IRQ_IOP13XX_ADMA1_EOT,
272+
.end = IRQ_IOP13XX_ADMA1_EOT,
273+
.flags = IORESOURCE_IRQ
274+
},
275+
[2] = {
276+
.start = IRQ_IOP13XX_ADMA1_EOC,
277+
.end = IRQ_IOP13XX_ADMA1_EOC,
278+
.flags = IORESOURCE_IRQ
279+
},
280+
[3] = {
281+
.start = IRQ_IOP13XX_ADMA1_ERR,
282+
.end = IRQ_IOP13XX_ADMA1_ERR,
283+
.flags = IORESOURCE_IRQ
284+
}
285+
};
286+
287+
static struct resource iop13xx_adma_2_resources[] = {
288+
[0] = {
289+
.start = IOP13XX_ADMA_PHYS_BASE(2),
290+
.end = IOP13XX_ADMA_UPPER_PA(2),
291+
.flags = IORESOURCE_MEM,
292+
},
293+
[1] = {
294+
.start = IRQ_IOP13XX_ADMA2_EOT,
295+
.end = IRQ_IOP13XX_ADMA2_EOT,
296+
.flags = IORESOURCE_IRQ
297+
},
298+
[2] = {
299+
.start = IRQ_IOP13XX_ADMA2_EOC,
300+
.end = IRQ_IOP13XX_ADMA2_EOC,
301+
.flags = IORESOURCE_IRQ
302+
},
303+
[3] = {
304+
.start = IRQ_IOP13XX_ADMA2_ERR,
305+
.end = IRQ_IOP13XX_ADMA2_ERR,
306+
.flags = IORESOURCE_IRQ
307+
}
308+
};
309+
310+
static u64 iop13xx_adma_dmamask = DMA_64BIT_MASK;
311+
static struct iop_adma_platform_data iop13xx_adma_0_data = {
312+
.hw_id = 0,
313+
.pool_size = PAGE_SIZE,
314+
};
315+
316+
static struct iop_adma_platform_data iop13xx_adma_1_data = {
317+
.hw_id = 1,
318+
.pool_size = PAGE_SIZE,
319+
};
320+
321+
static struct iop_adma_platform_data iop13xx_adma_2_data = {
322+
.hw_id = 2,
323+
.pool_size = PAGE_SIZE,
324+
};
325+
326+
/* The ids are fixed up later in iop13xx_platform_init */
327+
static struct platform_device iop13xx_adma_0_channel = {
328+
.name = "iop-adma",
329+
.id = 0,
330+
.num_resources = 4,
331+
.resource = iop13xx_adma_0_resources,
332+
.dev = {
333+
.dma_mask = &iop13xx_adma_dmamask,
334+
.coherent_dma_mask = DMA_64BIT_MASK,
335+
.platform_data = (void *) &iop13xx_adma_0_data,
336+
},
337+
};
338+
339+
static struct platform_device iop13xx_adma_1_channel = {
340+
.name = "iop-adma",
341+
.id = 0,
342+
.num_resources = 4,
343+
.resource = iop13xx_adma_1_resources,
344+
.dev = {
345+
.dma_mask = &iop13xx_adma_dmamask,
346+
.coherent_dma_mask = DMA_64BIT_MASK,
347+
.platform_data = (void *) &iop13xx_adma_1_data,
348+
},
349+
};
350+
351+
static struct platform_device iop13xx_adma_2_channel = {
352+
.name = "iop-adma",
353+
.id = 0,
354+
.num_resources = 4,
355+
.resource = iop13xx_adma_2_resources,
356+
.dev = {
357+
.dma_mask = &iop13xx_adma_dmamask,
358+
.coherent_dma_mask = DMA_64BIT_MASK,
359+
.platform_data = (void *) &iop13xx_adma_2_data,
360+
},
361+
};
362+
239363
void __init iop13xx_map_io(void)
240364
{
241365
/* Initialize the Static Page Table maps */
242366
iotable_init(iop13xx_std_desc, ARRAY_SIZE(iop13xx_std_desc));
243367
}
244368

245-
static int init_uart = 0;
246-
static int init_i2c = 0;
369+
static int init_uart;
370+
static int init_i2c;
371+
static int init_adma;
247372

248373
void __init iop13xx_platform_init(void)
249374
{
250375
int i;
251-
u32 uart_idx, i2c_idx, plat_idx;
376+
u32 uart_idx, i2c_idx, adma_idx, plat_idx;
252377
struct platform_device *iop13xx_devices[IQ81340_MAX_PLAT_DEVICES];
253378

254379
/* set the bases so we can read the device id */
@@ -294,6 +419,12 @@ void __init iop13xx_platform_init(void)
294419
}
295420
}
296421

422+
if (init_adma == IOP13XX_INIT_ADMA_DEFAULT) {
423+
init_adma |= IOP13XX_INIT_ADMA_0;
424+
init_adma |= IOP13XX_INIT_ADMA_1;
425+
init_adma |= IOP13XX_INIT_ADMA_2;
426+
}
427+
297428
plat_idx = 0;
298429
uart_idx = 0;
299430
i2c_idx = 0;
@@ -332,6 +463,56 @@ void __init iop13xx_platform_init(void)
332463
}
333464
}
334465

466+
/* initialize adma channel ids and capabilities */
467+
adma_idx = 0;
468+
for (i = 0; i < IQ81340_NUM_ADMA; i++) {
469+
struct iop_adma_platform_data *plat_data;
470+
if ((init_adma & (1 << i)) && IOP13XX_SETUP_DEBUG)
471+
printk(KERN_INFO
472+
"Adding adma%d to platform device list\n", i);
473+
switch (init_adma & (1 << i)) {
474+
case IOP13XX_INIT_ADMA_0:
475+
iop13xx_adma_0_channel.id = adma_idx++;
476+
iop13xx_devices[plat_idx++] = &iop13xx_adma_0_channel;
477+
plat_data = &iop13xx_adma_0_data;
478+
dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
479+
dma_cap_set(DMA_XOR, plat_data->cap_mask);
480+
dma_cap_set(DMA_DUAL_XOR, plat_data->cap_mask);
481+
dma_cap_set(DMA_ZERO_SUM, plat_data->cap_mask);
482+
dma_cap_set(DMA_MEMSET, plat_data->cap_mask);
483+
dma_cap_set(DMA_MEMCPY_CRC32C, plat_data->cap_mask);
484+
dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
485+
break;
486+
case IOP13XX_INIT_ADMA_1:
487+
iop13xx_adma_1_channel.id = adma_idx++;
488+
iop13xx_devices[plat_idx++] = &iop13xx_adma_1_channel;
489+
plat_data = &iop13xx_adma_1_data;
490+
dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
491+
dma_cap_set(DMA_XOR, plat_data->cap_mask);
492+
dma_cap_set(DMA_DUAL_XOR, plat_data->cap_mask);
493+
dma_cap_set(DMA_ZERO_SUM, plat_data->cap_mask);
494+
dma_cap_set(DMA_MEMSET, plat_data->cap_mask);
495+
dma_cap_set(DMA_MEMCPY_CRC32C, plat_data->cap_mask);
496+
dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
497+
break;
498+
case IOP13XX_INIT_ADMA_2:
499+
iop13xx_adma_2_channel.id = adma_idx++;
500+
iop13xx_devices[plat_idx++] = &iop13xx_adma_2_channel;
501+
plat_data = &iop13xx_adma_2_data;
502+
dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
503+
dma_cap_set(DMA_XOR, plat_data->cap_mask);
504+
dma_cap_set(DMA_DUAL_XOR, plat_data->cap_mask);
505+
dma_cap_set(DMA_ZERO_SUM, plat_data->cap_mask);
506+
dma_cap_set(DMA_MEMSET, plat_data->cap_mask);
507+
dma_cap_set(DMA_MEMCPY_CRC32C, plat_data->cap_mask);
508+
dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
509+
dma_cap_set(DMA_PQ_XOR, plat_data->cap_mask);
510+
dma_cap_set(DMA_PQ_UPDATE, plat_data->cap_mask);
511+
dma_cap_set(DMA_PQ_ZERO_SUM, plat_data->cap_mask);
512+
break;
513+
}
514+
}
515+
335516
#ifdef CONFIG_MTD_PHYSMAP
336517
iq8134x_flash_resource.end = iq8134x_flash_resource.start +
337518
iq8134x_probe_flash_size() - 1;
@@ -399,5 +580,35 @@ static int __init iop13xx_init_i2c_setup(char *str)
399580
return 1;
400581
}
401582

583+
static int __init iop13xx_init_adma_setup(char *str)
584+
{
585+
if (str) {
586+
while (*str != '\0') {
587+
switch (*str) {
588+
case '0':
589+
init_adma |= IOP13XX_INIT_ADMA_0;
590+
break;
591+
case '1':
592+
init_adma |= IOP13XX_INIT_ADMA_1;
593+
break;
594+
case '2':
595+
init_adma |= IOP13XX_INIT_ADMA_2;
596+
break;
597+
case ',':
598+
case '=':
599+
break;
600+
default:
601+
PRINTK("\"iop13xx_init_adma\" malformed"
602+
" at character: \'%c\'", *str);
603+
*(str + 1) = '\0';
604+
init_adma = IOP13XX_INIT_ADMA_DEFAULT;
605+
}
606+
str++;
607+
}
608+
}
609+
return 1;
610+
}
611+
612+
__setup("iop13xx_init_adma", iop13xx_init_adma_setup);
402613
__setup("iop13xx_init_uart", iop13xx_init_uart_setup);
403614
__setup("iop13xx_init_i2c", iop13xx_init_i2c_setup);

‎arch/arm/mach-iop32x/glantank.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ static void __init glantank_init_machine(void)
180180
platform_device_register(&iop3xx_i2c1_device);
181181
platform_device_register(&glantank_flash_device);
182182
platform_device_register(&glantank_serial_device);
183+
platform_device_register(&iop3xx_dma_0_channel);
184+
platform_device_register(&iop3xx_dma_1_channel);
183185

184186
pm_power_off = glantank_power_off;
185187
}

‎arch/arm/mach-iop32x/iq31244.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,14 @@ static void __init iq31244_init_machine(void)
298298
platform_device_register(&iop3xx_i2c1_device);
299299
platform_device_register(&iq31244_flash_device);
300300
platform_device_register(&iq31244_serial_device);
301+
platform_device_register(&iop3xx_dma_0_channel);
302+
platform_device_register(&iop3xx_dma_1_channel);
301303

302304
if (is_ep80219())
303305
pm_power_off = ep80219_power_off;
306+
307+
if (!is_80219())
308+
platform_device_register(&iop3xx_aau_channel);
304309
}
305310

306311
static int __init force_ep80219_setup(char *str)

‎arch/arm/mach-iop32x/iq80321.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ static void __init iq80321_init_machine(void)
181181
platform_device_register(&iop3xx_i2c1_device);
182182
platform_device_register(&iq80321_flash_device);
183183
platform_device_register(&iq80321_serial_device);
184+
platform_device_register(&iop3xx_dma_0_channel);
185+
platform_device_register(&iop3xx_dma_1_channel);
186+
platform_device_register(&iop3xx_aau_channel);
184187
}
185188

186189
MACHINE_START(IQ80321, "Intel IQ80321")

‎arch/arm/mach-iop32x/n2100.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ static void __init n2100_init_machine(void)
245245
platform_device_register(&iop3xx_i2c0_device);
246246
platform_device_register(&n2100_flash_device);
247247
platform_device_register(&n2100_serial_device);
248+
platform_device_register(&iop3xx_dma_0_channel);
249+
platform_device_register(&iop3xx_dma_1_channel);
248250

249251
pm_power_off = n2100_power_off;
250252

‎arch/arm/mach-iop33x/iq80331.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ static void __init iq80331_init_machine(void)
136136
platform_device_register(&iop33x_uart0_device);
137137
platform_device_register(&iop33x_uart1_device);
138138
platform_device_register(&iq80331_flash_device);
139+
platform_device_register(&iop3xx_dma_0_channel);
140+
platform_device_register(&iop3xx_dma_1_channel);
141+
platform_device_register(&iop3xx_aau_channel);
139142
}
140143

141144
MACHINE_START(IQ80331, "Intel IQ80331")

‎arch/arm/mach-iop33x/iq80332.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ static void __init iq80332_init_machine(void)
136136
platform_device_register(&iop33x_uart0_device);
137137
platform_device_register(&iop33x_uart1_device);
138138
platform_device_register(&iq80332_flash_device);
139+
platform_device_register(&iop3xx_dma_0_channel);
140+
platform_device_register(&iop3xx_dma_1_channel);
141+
platform_device_register(&iop3xx_aau_channel);
139142
}
140143

141144
MACHINE_START(IQ80332, "Intel IQ80332")

‎arch/arm/plat-iop/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ obj-$(CONFIG_ARCH_IOP32X) += setup.o
1212
obj-$(CONFIG_ARCH_IOP32X) += time.o
1313
obj-$(CONFIG_ARCH_IOP32X) += io.o
1414
obj-$(CONFIG_ARCH_IOP32X) += cp6.o
15+
obj-$(CONFIG_ARCH_IOP32X) += adma.o
1516

1617
# IOP33X
1718
obj-$(CONFIG_ARCH_IOP33X) += gpio.o
@@ -21,6 +22,7 @@ obj-$(CONFIG_ARCH_IOP33X) += setup.o
2122
obj-$(CONFIG_ARCH_IOP33X) += time.o
2223
obj-$(CONFIG_ARCH_IOP33X) += io.o
2324
obj-$(CONFIG_ARCH_IOP33X) += cp6.o
25+
obj-$(CONFIG_ARCH_IOP33X) += adma.o
2426

2527
# IOP13XX
2628
obj-$(CONFIG_ARCH_IOP13XX) += cp6.o

0 commit comments

Comments
 (0)