diff options
Diffstat (limited to 'arch/arm/plat-omap/fb.c')
-rw-r--r-- | arch/arm/plat-omap/fb.c | 66 |
1 files changed, 64 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c index bcbb9d5dc293..6df0c215fdb4 100644 --- a/arch/arm/plat-omap/fb.c +++ b/arch/arm/plat-omap/fb.c | |||
@@ -29,10 +29,72 @@ | |||
29 | #include <linux/memblock.h> | 29 | #include <linux/memblock.h> |
30 | #include <linux/io.h> | 30 | #include <linux/io.h> |
31 | #include <linux/omapfb.h> | 31 | #include <linux/omapfb.h> |
32 | #include <linux/dma-mapping.h> | ||
32 | 33 | ||
33 | #include <mach/hardware.h> | 34 | #include <mach/hardware.h> |
34 | #include <asm/mach/map.h> | 35 | #include <asm/mach/map.h> |
35 | 36 | ||
37 | #include <plat/cpu.h> | ||
38 | |||
39 | #ifdef CONFIG_OMAP2_VRFB | ||
40 | |||
41 | /* | ||
42 | * The first memory resource is the register region for VRFB, | ||
43 | * the rest are VRFB virtual memory areas for each VRFB context. | ||
44 | */ | ||
45 | |||
46 | static const struct resource omap2_vrfb_resources[] = { | ||
47 | DEFINE_RES_MEM_NAMED(0x68008000u, 0x40, "vrfb-regs"), | ||
48 | DEFINE_RES_MEM_NAMED(0x70000000u, 0x4000000, "vrfb-area-0"), | ||
49 | DEFINE_RES_MEM_NAMED(0x74000000u, 0x4000000, "vrfb-area-1"), | ||
50 | DEFINE_RES_MEM_NAMED(0x78000000u, 0x4000000, "vrfb-area-2"), | ||
51 | DEFINE_RES_MEM_NAMED(0x7c000000u, 0x4000000, "vrfb-area-3"), | ||
52 | }; | ||
53 | |||
54 | static const struct resource omap3_vrfb_resources[] = { | ||
55 | DEFINE_RES_MEM_NAMED(0x6C000180u, 0xc0, "vrfb-regs"), | ||
56 | DEFINE_RES_MEM_NAMED(0x70000000u, 0x4000000, "vrfb-area-0"), | ||
57 | DEFINE_RES_MEM_NAMED(0x74000000u, 0x4000000, "vrfb-area-1"), | ||
58 | DEFINE_RES_MEM_NAMED(0x78000000u, 0x4000000, "vrfb-area-2"), | ||
59 | DEFINE_RES_MEM_NAMED(0x7c000000u, 0x4000000, "vrfb-area-3"), | ||
60 | DEFINE_RES_MEM_NAMED(0xe0000000u, 0x4000000, "vrfb-area-4"), | ||
61 | DEFINE_RES_MEM_NAMED(0xe4000000u, 0x4000000, "vrfb-area-5"), | ||
62 | DEFINE_RES_MEM_NAMED(0xe8000000u, 0x4000000, "vrfb-area-6"), | ||
63 | DEFINE_RES_MEM_NAMED(0xec000000u, 0x4000000, "vrfb-area-7"), | ||
64 | DEFINE_RES_MEM_NAMED(0xf0000000u, 0x4000000, "vrfb-area-8"), | ||
65 | DEFINE_RES_MEM_NAMED(0xf4000000u, 0x4000000, "vrfb-area-9"), | ||
66 | DEFINE_RES_MEM_NAMED(0xf8000000u, 0x4000000, "vrfb-area-10"), | ||
67 | DEFINE_RES_MEM_NAMED(0xfc000000u, 0x4000000, "vrfb-area-11"), | ||
68 | }; | ||
69 | |||
70 | static int __init omap_init_vrfb(void) | ||
71 | { | ||
72 | struct platform_device *pdev; | ||
73 | const struct resource *res; | ||
74 | unsigned int num_res; | ||
75 | |||
76 | if (cpu_is_omap24xx()) { | ||
77 | res = omap2_vrfb_resources; | ||
78 | num_res = ARRAY_SIZE(omap2_vrfb_resources); | ||
79 | } else if (cpu_is_omap34xx()) { | ||
80 | res = omap3_vrfb_resources; | ||
81 | num_res = ARRAY_SIZE(omap3_vrfb_resources); | ||
82 | } else { | ||
83 | return 0; | ||
84 | } | ||
85 | |||
86 | pdev = platform_device_register_resndata(NULL, "omapvrfb", -1, | ||
87 | res, num_res, NULL, 0); | ||
88 | |||
89 | if (IS_ERR(pdev)) | ||
90 | return PTR_ERR(pdev); | ||
91 | else | ||
92 | return 0; | ||
93 | } | ||
94 | |||
95 | arch_initcall(omap_init_vrfb); | ||
96 | #endif | ||
97 | |||
36 | #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) | 98 | #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE) |
37 | 99 | ||
38 | static bool omapfb_lcd_configured; | 100 | static bool omapfb_lcd_configured; |
@@ -45,7 +107,7 @@ static struct platform_device omap_fb_device = { | |||
45 | .id = -1, | 107 | .id = -1, |
46 | .dev = { | 108 | .dev = { |
47 | .dma_mask = &omap_fb_dma_mask, | 109 | .dma_mask = &omap_fb_dma_mask, |
48 | .coherent_dma_mask = ~(u32)0, | 110 | .coherent_dma_mask = DMA_BIT_MASK(32), |
49 | .platform_data = &omapfb_config, | 111 | .platform_data = &omapfb_config, |
50 | }, | 112 | }, |
51 | .num_resources = 0, | 113 | .num_resources = 0, |
@@ -81,7 +143,7 @@ static struct platform_device omap_fb_device = { | |||
81 | .id = -1, | 143 | .id = -1, |
82 | .dev = { | 144 | .dev = { |
83 | .dma_mask = &omap_fb_dma_mask, | 145 | .dma_mask = &omap_fb_dma_mask, |
84 | .coherent_dma_mask = ~(u32)0, | 146 | .coherent_dma_mask = DMA_BIT_MASK(32), |
85 | .platform_data = &omapfb_config, | 147 | .platform_data = &omapfb_config, |
86 | }, | 148 | }, |
87 | .num_resources = 0, | 149 | .num_resources = 0, |