1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
From 6f66d2245dc6359f7de98796f5d999a308f74179 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Thu, 2 Jul 2009 11:49:07 +0300
Subject: [PATCH 141/146] DSS2: VRAM: add CONFIG_OMAP2_VRAM flag
CONFIG_OMAP2_VRAM controls wheter VRAM manager is compiled in or not.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
---
arch/arm/plat-omap/Kconfig | 3 +++
arch/arm/plat-omap/Makefile | 3 ++-
arch/arm/plat-omap/include/mach/vram.h | 22 ++++++++++++++++++++--
arch/arm/plat-omap/vram.c | 9 ++-------
drivers/video/omap2/omapfb/Kconfig | 1 +
5 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index efe85d0..ca06037 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -183,6 +183,9 @@ config OMAP_SERIAL_WAKE
to data on the serial RX line. This allows you to wake the
system from serial console.
+config OMAP2_VRAM
+ bool
+
endmenu
endif
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
index cfc0967..3232edc 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -4,7 +4,7 @@
# Common support
obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \
- usb.o fb.o vram.o vrfb.o io.o
+ usb.o fb.o vrfb.o io.o
obj-m :=
obj-n :=
obj- :=
@@ -25,3 +25,4 @@ obj-y += $(i2c-omap-m) $(i2c-omap-y)
# OMAP mailbox framework
obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o
+obj-$(CONFIG_OMAP2_VRAM) += vram.o
diff --git a/arch/arm/plat-omap/include/mach/vram.h b/arch/arm/plat-omap/include/mach/vram.h
index f6bb9fb..4f2c2e6 100644
--- a/arch/arm/plat-omap/include/mach/vram.h
+++ b/arch/arm/plat-omap/include/mach/vram.h
@@ -21,6 +21,7 @@
#ifndef __OMAP_VRAM_H__
#define __OMAP_VRAM_H__
+#include <linux/autoconf.h>
#include <asm/types.h>
#define OMAP_VRAM_MEMTYPE_SDRAM 0
@@ -33,8 +34,10 @@ extern int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr);
extern int omap_vram_reserve(unsigned long paddr, size_t size);
extern void omap_vram_get_info(unsigned long *vram, unsigned long *free_vram,
unsigned long *largest_free_block);
-extern void omap2_set_sdram_vram(u32 size, u32 start);
-extern void omap2_set_sram_vram(u32 size, u32 start);
+
+#ifdef CONFIG_OMAP2_VRAM
+extern void omap_vram_set_sdram_vram(u32 size, u32 start);
+extern void omap_vram_set_sram_vram(u32 size, u32 start);
extern void omap_vram_reserve_sdram(void);
extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
@@ -42,4 +45,19 @@ extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
unsigned long sram_size,
unsigned long pstart_avail,
unsigned long size_avail);
+#else
+static inline void omap_vram_set_sdram_vram(u32 size, u32 start) { }
+static inline void omap_vram_set_sram_vram(u32 size, u32 start) { }
+
+static inline void omap_vram_reserve_sdram(void) { }
+static inline unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
+ unsigned long sram_vstart,
+ unsigned long sram_size,
+ unsigned long pstart_avail,
+ unsigned long size_avail)
+{
+ return 0;
+}
+#endif
+
#endif
diff --git a/arch/arm/plat-omap/vram.c b/arch/arm/plat-omap/vram.c
index 89ae1cf..634ce23 100644
--- a/arch/arm/plat-omap/vram.c
+++ b/arch/arm/plat-omap/vram.c
@@ -46,8 +46,6 @@
/* Maximum size, in reality this is smaller if SRAM is partially locked. */
#define OMAP2_SRAM_SIZE 0xa0000 /* 640k */
-#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
-
/* postponed regions are used to temporarily store region information at boot
* time when we cannot yet allocate the region list */
#define MAX_POSTPONED_REGIONS 10
@@ -644,17 +642,14 @@ unsigned long __init omap_vram_reserve_sram(unsigned long sram_pstart,
return reserved;
}
-void __init omap2_set_sdram_vram(u32 size, u32 start)
+void __init omap_vram_set_sdram_vram(u32 size, u32 start)
{
omap_vram_sdram_start = start;
omap_vram_sdram_size = size;
}
-void __init omap2_set_sram_vram(u32 size, u32 start)
+void __init omap_vram_set_sram_vram(u32 size, u32 start)
{
omap_vram_sram_start = start;
omap_vram_sram_size = size;
}
-
-#endif
-
diff --git a/drivers/video/omap2/omapfb/Kconfig b/drivers/video/omap2/omapfb/Kconfig
index 4f66033..220c58b 100644
--- a/drivers/video/omap2/omapfb/Kconfig
+++ b/drivers/video/omap2/omapfb/Kconfig
@@ -2,6 +2,7 @@ menuconfig FB_OMAP2
tristate "OMAP2/3 frame buffer support (EXPERIMENTAL)"
depends on FB && OMAP2_DSS
+ select OMAP2_VRAM
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
--
1.6.2.4
|