diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-26 14:59:44 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-26 14:59:44 -0500 |
commit | dcf81c1af839b77b44404453ecae6e5ac5a75f05 (patch) | |
tree | 289dcbda5fbca34e7e0cf028908b9b517fa8b8b2 /arch/arm/mach-integrator | |
parent | 34e5f4f198ddd36a82dc12164de7fc4f5430e09d (diff) | |
parent | 75c06963dd947252271ffa6107a25cddb2b8f362 (diff) |
Merge branch 'amba' into for-armsoc
Diffstat (limited to 'arch/arm/mach-integrator')
-rw-r--r-- | arch/arm/mach-integrator/core.c | 70 | ||||
-rw-r--r-- | arch/arm/mach-integrator/impd1.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-integrator/integrator_cp.c | 49 |
3 files changed, 25 insertions, 103 deletions
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c index 019f0ab08f66..15b87f26ac96 100644 --- a/arch/arm/mach-integrator/core.c +++ b/arch/arm/mach-integrator/core.c | |||
@@ -35,67 +35,23 @@ | |||
35 | 35 | ||
36 | static struct amba_pl010_data integrator_uart_data; | 36 | static struct amba_pl010_data integrator_uart_data; |
37 | 37 | ||
38 | static struct amba_device rtc_device = { | 38 | #define INTEGRATOR_RTC_IRQ { IRQ_RTCINT } |
39 | .dev = { | 39 | #define INTEGRATOR_UART0_IRQ { IRQ_UARTINT0 } |
40 | .init_name = "mb:15", | 40 | #define INTEGRATOR_UART1_IRQ { IRQ_UARTINT1 } |
41 | }, | 41 | #define KMI0_IRQ { IRQ_KMIINT0 } |
42 | .res = { | 42 | #define KMI1_IRQ { IRQ_KMIINT1 } |
43 | .start = INTEGRATOR_RTC_BASE, | ||
44 | .end = INTEGRATOR_RTC_BASE + SZ_4K - 1, | ||
45 | .flags = IORESOURCE_MEM, | ||
46 | }, | ||
47 | .irq = { IRQ_RTCINT, NO_IRQ }, | ||
48 | }; | ||
49 | 43 | ||
50 | static struct amba_device uart0_device = { | 44 | static AMBA_APB_DEVICE(rtc, "mb:15", 0, |
51 | .dev = { | 45 | INTEGRATOR_RTC_BASE, INTEGRATOR_RTC_IRQ, NULL); |
52 | .init_name = "mb:16", | ||
53 | .platform_data = &integrator_uart_data, | ||
54 | }, | ||
55 | .res = { | ||
56 | .start = INTEGRATOR_UART0_BASE, | ||
57 | .end = INTEGRATOR_UART0_BASE + SZ_4K - 1, | ||
58 | .flags = IORESOURCE_MEM, | ||
59 | }, | ||
60 | .irq = { IRQ_UARTINT0, NO_IRQ }, | ||
61 | }; | ||
62 | 46 | ||
63 | static struct amba_device uart1_device = { | 47 | static AMBA_APB_DEVICE(uart0, "mb:16", 0, |
64 | .dev = { | 48 | INTEGRATOR_UART0_BASE, INTEGRATOR_UART0_IRQ, &integrator_uart_data); |
65 | .init_name = "mb:17", | ||
66 | .platform_data = &integrator_uart_data, | ||
67 | }, | ||
68 | .res = { | ||
69 | .start = INTEGRATOR_UART1_BASE, | ||
70 | .end = INTEGRATOR_UART1_BASE + SZ_4K - 1, | ||
71 | .flags = IORESOURCE_MEM, | ||
72 | }, | ||
73 | .irq = { IRQ_UARTINT1, NO_IRQ }, | ||
74 | }; | ||
75 | 49 | ||
76 | static struct amba_device kmi0_device = { | 50 | static AMBA_APB_DEVICE(uart1, "mb:17", 0, |
77 | .dev = { | 51 | INTEGRATOR_UART1_BASE, INTEGRATOR_UART1_IRQ, &integrator_uart_data); |
78 | .init_name = "mb:18", | ||
79 | }, | ||
80 | .res = { | ||
81 | .start = KMI0_BASE, | ||
82 | .end = KMI0_BASE + SZ_4K - 1, | ||
83 | .flags = IORESOURCE_MEM, | ||
84 | }, | ||
85 | .irq = { IRQ_KMIINT0, NO_IRQ }, | ||
86 | }; | ||
87 | 52 | ||
88 | static struct amba_device kmi1_device = { | 53 | static AMBA_APB_DEVICE(kmi0, "mb:18", 0, KMI0_BASE, KMI0_IRQ, NULL); |
89 | .dev = { | 54 | static AMBA_APB_DEVICE(kmi1, "mb:19", 0, KMI1_BASE, KMI1_IRQ, NULL); |
90 | .init_name = "mb:19", | ||
91 | }, | ||
92 | .res = { | ||
93 | .start = KMI1_BASE, | ||
94 | .end = KMI1_BASE + SZ_4K - 1, | ||
95 | .flags = IORESOURCE_MEM, | ||
96 | }, | ||
97 | .irq = { IRQ_KMIINT1, NO_IRQ }, | ||
98 | }; | ||
99 | 55 | ||
100 | static struct amba_device *amba_devs[] __initdata = { | 56 | static struct amba_device *amba_devs[] __initdata = { |
101 | &rtc_device, | 57 | &rtc_device, |
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index 8cbb75a96bd4..3e538da6cb1f 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c | |||
@@ -401,24 +401,21 @@ static int impd1_probe(struct lm_device *dev) | |||
401 | 401 | ||
402 | pc_base = dev->resource.start + idev->offset; | 402 | pc_base = dev->resource.start + idev->offset; |
403 | 403 | ||
404 | d = kzalloc(sizeof(struct amba_device), GFP_KERNEL); | 404 | d = amba_device_alloc(NULL, pc_base, SZ_4K); |
405 | if (!d) | 405 | if (!d) |
406 | continue; | 406 | continue; |
407 | 407 | ||
408 | dev_set_name(&d->dev, "lm%x:%5.5lx", dev->id, idev->offset >> 12); | 408 | dev_set_name(&d->dev, "lm%x:%5.5lx", dev->id, idev->offset >> 12); |
409 | d->dev.parent = &dev->dev; | 409 | d->dev.parent = &dev->dev; |
410 | d->res.start = dev->resource.start + idev->offset; | ||
411 | d->res.end = d->res.start + SZ_4K - 1; | ||
412 | d->res.flags = IORESOURCE_MEM; | ||
413 | d->irq[0] = dev->irq; | 410 | d->irq[0] = dev->irq; |
414 | d->irq[1] = dev->irq; | 411 | d->irq[1] = dev->irq; |
415 | d->periphid = idev->id; | 412 | d->periphid = idev->id; |
416 | d->dev.platform_data = idev->platform_data; | 413 | d->dev.platform_data = idev->platform_data; |
417 | 414 | ||
418 | ret = amba_device_register(d, &dev->resource); | 415 | ret = amba_device_add(d, &dev->resource); |
419 | if (ret) { | 416 | if (ret) { |
420 | dev_err(&d->dev, "unable to register device: %d\n", ret); | 417 | dev_err(&d->dev, "unable to register device: %d\n", ret); |
421 | kfree(d); | 418 | amba_device_put(d); |
422 | } | 419 | } |
423 | } | 420 | } |
424 | 421 | ||
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index a8b6aa6003f3..be9ead4a3bcc 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c | |||
@@ -347,32 +347,14 @@ static struct mmci_platform_data mmc_data = { | |||
347 | .gpio_cd = -1, | 347 | .gpio_cd = -1, |
348 | }; | 348 | }; |
349 | 349 | ||
350 | static struct amba_device mmc_device = { | 350 | #define INTEGRATOR_CP_MMC_IRQS { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 } |
351 | .dev = { | 351 | #define INTEGRATOR_CP_AACI_IRQS { IRQ_CP_AACIINT } |
352 | .init_name = "mb:1c", | ||
353 | .platform_data = &mmc_data, | ||
354 | }, | ||
355 | .res = { | ||
356 | .start = INTEGRATOR_CP_MMC_BASE, | ||
357 | .end = INTEGRATOR_CP_MMC_BASE + SZ_4K - 1, | ||
358 | .flags = IORESOURCE_MEM, | ||
359 | }, | ||
360 | .irq = { IRQ_CP_MMCIINT0, IRQ_CP_MMCIINT1 }, | ||
361 | .periphid = 0, | ||
362 | }; | ||
363 | 352 | ||
364 | static struct amba_device aaci_device = { | 353 | static AMBA_APB_DEVICE(mmc, "mb:1c", 0, INTEGRATOR_CP_MMC_BASE, |
365 | .dev = { | 354 | INTEGRATOR_CP_MMC_IRQS, &mmc_data); |
366 | .init_name = "mb:1d", | 355 | |
367 | }, | 356 | static AMBA_APB_DEVICE(aaci, "mb:1d", 0, INTEGRATOR_CP_AACI_BASE, |
368 | .res = { | 357 | INTEGRATOR_CP_AACI_IRQS, NULL); |
369 | .start = INTEGRATOR_CP_AACI_BASE, | ||
370 | .end = INTEGRATOR_CP_AACI_BASE + SZ_4K - 1, | ||
371 | .flags = IORESOURCE_MEM, | ||
372 | }, | ||
373 | .irq = { IRQ_CP_AACIINT, NO_IRQ }, | ||
374 | .periphid = 0, | ||
375 | }; | ||
376 | 358 | ||
377 | 359 | ||
378 | /* | 360 | /* |
@@ -425,21 +407,8 @@ static struct clcd_board clcd_data = { | |||
425 | .remove = versatile_clcd_remove_dma, | 407 | .remove = versatile_clcd_remove_dma, |
426 | }; | 408 | }; |
427 | 409 | ||
428 | static struct amba_device clcd_device = { | 410 | static AMBA_AHB_DEVICE(clcd, "mb:c0", 0, INTCP_PA_CLCD_BASE, |
429 | .dev = { | 411 | { IRQ_CP_CLCDCINT }, &clcd_data); |
430 | .init_name = "mb:c0", | ||
431 | .coherent_dma_mask = ~0, | ||
432 | .platform_data = &clcd_data, | ||
433 | }, | ||
434 | .res = { | ||
435 | .start = INTCP_PA_CLCD_BASE, | ||
436 | .end = INTCP_PA_CLCD_BASE + SZ_4K - 1, | ||
437 | .flags = IORESOURCE_MEM, | ||
438 | }, | ||
439 | .dma_mask = ~0, | ||
440 | .irq = { IRQ_CP_CLCDCINT, NO_IRQ }, | ||
441 | .periphid = 0, | ||
442 | }; | ||
443 | 412 | ||
444 | static struct amba_device *amba_devs[] __initdata = { | 413 | static struct amba_device *amba_devs[] __initdata = { |
445 | &mmc_device, | 414 | &mmc_device, |