aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/devices.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/devices.c')
-rw-r--r--arch/arm/mach-omap2/devices.c59
1 files changed, 25 insertions, 34 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index c00c68961bb8..1b7e1c6e5359 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -17,21 +17,21 @@
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/slab.h> 18#include <linux/slab.h>
19#include <linux/of.h> 19#include <linux/of.h>
20#include <linux/pinctrl/machine.h>
20#include <linux/platform_data/omap4-keypad.h> 21#include <linux/platform_data/omap4-keypad.h>
21 22
22#include <mach/hardware.h>
23#include <mach/irqs.h>
24#include <asm/mach-types.h> 23#include <asm/mach-types.h>
25#include <asm/mach/map.h> 24#include <asm/mach/map.h>
26#include <asm/pmu.h> 25#include <asm/pmu.h>
27 26
28#include "iomap.h" 27#include "iomap.h"
29#include <plat/board.h>
30#include <plat/dma.h> 28#include <plat/dma.h>
31#include <plat/omap_hwmod.h> 29#include <plat/omap_hwmod.h>
32#include <plat/omap_device.h> 30#include <plat/omap_device.h>
33#include <plat/omap4-keypad.h> 31#include <plat/omap4-keypad.h>
34 32
33#include "soc.h"
34#include "common.h"
35#include "mux.h" 35#include "mux.h"
36#include "control.h" 36#include "control.h"
37#include "devices.h" 37#include "devices.h"
@@ -112,7 +112,7 @@ static struct resource omap2cam_resources[] = {
112 .flags = IORESOURCE_MEM, 112 .flags = IORESOURCE_MEM,
113 }, 113 },
114 { 114 {
115 .start = INT_24XX_CAM_IRQ, 115 .start = 24 + OMAP_INTC_START,
116 .flags = IORESOURCE_IRQ, 116 .flags = IORESOURCE_IRQ,
117 } 117 }
118}; 118};
@@ -201,7 +201,7 @@ static struct resource omap3isp_resources[] = {
201 .flags = IORESOURCE_MEM, 201 .flags = IORESOURCE_MEM,
202 }, 202 },
203 { 203 {
204 .start = INT_34XX_CAM_IRQ, 204 .start = 24 + OMAP_INTC_START,
205 .flags = IORESOURCE_IRQ, 205 .flags = IORESOURCE_IRQ,
206 } 206 }
207}; 207};
@@ -434,37 +434,24 @@ static void omap_init_mcspi(void)
434static inline void omap_init_mcspi(void) {} 434static inline void omap_init_mcspi(void) {}
435#endif 435#endif
436 436
437static struct resource omap2_pmu_resource = { 437/**
438 .start = 3, 438 * omap_init_rng - bind the RNG hwmod to the RNG omap_device
439 .end = 3, 439 *
440 .flags = IORESOURCE_IRQ, 440 * Bind the RNG hwmod to the RNG omap_device. No return value.
441}; 441 */
442 442static void omap_init_rng(void)
443static struct resource omap3_pmu_resource = {
444 .start = INT_34XX_BENCH_MPU_EMUL,
445 .end = INT_34XX_BENCH_MPU_EMUL,
446 .flags = IORESOURCE_IRQ,
447};
448
449static struct platform_device omap_pmu_device = {
450 .name = "arm-pmu",
451 .id = ARM_PMU_DEVICE_CPU,
452 .num_resources = 1,
453};
454
455static void omap_init_pmu(void)
456{ 443{
457 if (cpu_is_omap24xx()) 444 struct omap_hwmod *oh;
458 omap_pmu_device.resource = &omap2_pmu_resource; 445 struct platform_device *pdev;
459 else if (cpu_is_omap34xx()) 446
460 omap_pmu_device.resource = &omap3_pmu_resource; 447 oh = omap_hwmod_lookup("rng");
461 else 448 if (!oh)
462 return; 449 return;
463 450
464 platform_device_register(&omap_pmu_device); 451 pdev = omap_device_build("omap_rng", -1, oh, NULL, 0, NULL, 0, 0);
452 WARN(IS_ERR(pdev), "Can't build omap_device for omap_rng\n");
465} 453}
466 454
467
468#if defined(CONFIG_CRYPTO_DEV_OMAP_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP_SHAM_MODULE) 455#if defined(CONFIG_CRYPTO_DEV_OMAP_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP_SHAM_MODULE)
469 456
470#ifdef CONFIG_ARCH_OMAP2 457#ifdef CONFIG_ARCH_OMAP2
@@ -475,7 +462,7 @@ static struct resource omap2_sham_resources[] = {
475 .flags = IORESOURCE_MEM, 462 .flags = IORESOURCE_MEM,
476 }, 463 },
477 { 464 {
478 .start = INT_24XX_SHA1MD5, 465 .start = 51 + OMAP_INTC_START,
479 .flags = IORESOURCE_IRQ, 466 .flags = IORESOURCE_IRQ,
480 } 467 }
481}; 468};
@@ -493,7 +480,7 @@ static struct resource omap3_sham_resources[] = {
493 .flags = IORESOURCE_MEM, 480 .flags = IORESOURCE_MEM,
494 }, 481 },
495 { 482 {
496 .start = INT_34XX_SHA1MD52_IRQ, 483 .start = 49 + OMAP_INTC_START,
497 .flags = IORESOURCE_IRQ, 484 .flags = IORESOURCE_IRQ,
498 }, 485 },
499 { 486 {
@@ -631,6 +618,10 @@ static inline void omap_init_vout(void) {}
631 618
632static int __init omap2_init_devices(void) 619static int __init omap2_init_devices(void)
633{ 620{
621 /* Enable dummy states for those platforms without pinctrl support */
622 if (!of_have_populated_dt())
623 pinctrl_provide_dummies();
624
634 /* 625 /*
635 * please keep these calls, and their implementations above, 626 * please keep these calls, and their implementations above,
636 * in alphabetical order so they're easier to sort through. 627 * in alphabetical order so they're easier to sort through.
@@ -645,8 +636,8 @@ static int __init omap2_init_devices(void)
645 omap_init_mcpdm(); 636 omap_init_mcpdm();
646 omap_init_mcspi(); 637 omap_init_mcspi();
647 } 638 }
648 omap_init_pmu();
649 omap_init_sti(); 639 omap_init_sti();
640 omap_init_rng();
650 omap_init_sham(); 641 omap_init_sham();
651 omap_init_aes(); 642 omap_init_aes();
652 omap_init_vout(); 643 omap_init_vout();