Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
98864ff5
Commit
98864ff5
authored
May 22, 2010
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ARM: OMAP: Convert OMAPFB and VRAM SDRAM reservation to LMB
Signed-off-by:
Russell King
<
rmk+kernel@arm.linux.org.uk
>
parent
8d717a52
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
34 deletions
+39
-34
arch/arm/plat-omap/common.c
arch/arm/plat-omap/common.c
+2
-2
arch/arm/plat-omap/fb.c
arch/arm/plat-omap/fb.c
+19
-11
arch/arm/plat-omap/include/plat/vram.h
arch/arm/plat-omap/include/plat/vram.h
+2
-2
drivers/video/omap2/vram.c
drivers/video/omap2/vram.c
+15
-18
include/linux/omapfb.h
include/linux/omapfb.h
+1
-1
No files found.
arch/arm/plat-omap/common.c
View file @
98864ff5
...
...
@@ -85,8 +85,8 @@ EXPORT_SYMBOL(omap_get_var_config);
void
__init
omap_reserve
(
void
)
{
omapfb_reserve_sdram
();
omap_vram_reserve_sdram
();
omapfb_reserve_sdram
_memblock
();
omap_vram_reserve_sdram
_memblock
();
}
/*
...
...
arch/arm/plat-omap/fb.c
View file @
98864ff5
...
...
@@ -26,7 +26,7 @@
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/
bootmem
.h>
#include <linux/
memblock
.h>
#include <linux/io.h>
#include <linux/omapfb.h>
...
...
@@ -173,25 +173,27 @@ static int check_fbmem_region(int region_idx, struct omapfb_mem_region *rg,
static
int
valid_sdram
(
unsigned
long
addr
,
unsigned
long
size
)
{
struct
bootmem_data
*
bdata
=
NODE_DATA
(
0
)
->
bdata
;
unsigned
long
sdram_start
,
sdram_end
;
struct
memblock_property
res
;
sdram_start
=
bdata
->
node_min_pfn
<<
PAGE_SHIFT
;
sdram_end
=
bdata
->
node_low_pfn
<<
PAGE_SHIFT
;
return
addr
>=
sdram_start
&&
sdram_end
-
addr
>=
size
;
res
.
base
=
addr
;
res
.
size
=
size
;
return
!
memblock_find
(
&
res
)
&&
res
.
base
==
addr
&&
res
.
size
==
size
;
}
static
int
reserve_sdram
(
unsigned
long
addr
,
unsigned
long
size
)
{
return
reserve_bootmem
(
addr
,
size
,
BOOTMEM_EXCLUSIVE
);
if
(
memblock_is_region_reserved
(
addr
,
size
))
return
-
EBUSY
;
if
(
memblock_reserve
(
addr
,
size
))
return
-
ENOMEM
;
return
0
;
}
/*
* Called from map_io. We need to call to this early enough so that we
* can reserve the fixed SDRAM regions before VM could get hold of them.
*/
void
__init
omapfb_reserve_sdram
(
void
)
void
__init
omapfb_reserve_sdram
_memblock
(
void
)
{
unsigned
long
reserved
=
0
;
int
i
;
...
...
@@ -386,7 +388,10 @@ static inline int omap_init_fb(void)
arch_initcall
(
omap_init_fb
);
void
omapfb_reserve_sdram
(
void
)
{}
void
omapfb_reserve_sdram_memblock
(
void
)
{
}
unsigned
long
omapfb_reserve_sram
(
unsigned
long
sram_pstart
,
unsigned
long
sram_vstart
,
unsigned
long
sram_size
,
...
...
@@ -402,7 +407,10 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data)
{
}
void
omapfb_reserve_sdram
(
void
)
{}
void
omapfb_reserve_sdram_memblock
(
void
)
{
}
unsigned
long
omapfb_reserve_sram
(
unsigned
long
sram_pstart
,
unsigned
long
sram_vstart
,
unsigned
long
sram_size
,
...
...
arch/arm/plat-omap/include/plat/vram.h
View file @
98864ff5
...
...
@@ -38,7 +38,7 @@ extern void omap_vram_get_info(unsigned long *vram, unsigned long *free_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
void
omap_vram_reserve_sdram
_memblock
(
void
);
extern
unsigned
long
omap_vram_reserve_sram
(
unsigned
long
sram_pstart
,
unsigned
long
sram_vstart
,
unsigned
long
sram_size
,
...
...
@@ -48,7 +48,7 @@ extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
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
void
omap_vram_reserve_sdram
_memblock
(
void
)
{
}
static
inline
unsigned
long
omap_vram_reserve_sram
(
unsigned
long
sram_pstart
,
unsigned
long
sram_vstart
,
unsigned
long
sram_size
,
...
...
drivers/video/omap2/vram.c
View file @
98864ff5
...
...
@@ -25,7 +25,7 @@
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/seq_file.h>
#include <linux/
bootmem
.h>
#include <linux/
memblock
.h>
#include <linux/completion.h>
#include <linux/debugfs.h>
#include <linux/jiffies.h>
...
...
@@ -525,10 +525,8 @@ early_param("vram", omap_vram_early_vram);
* Called from map_io. We need to call to this early enough so that we
* can reserve the fixed SDRAM regions before VM could get hold of them.
*/
void
__init
omap_vram_reserve_sdram
(
void
)
void
__init
omap_vram_reserve_sdram
_memblock
(
void
)
{
struct
bootmem_data
*
bdata
;
unsigned
long
sdram_start
,
sdram_size
;
u32
paddr
;
u32
size
=
0
;
...
...
@@ -555,29 +553,28 @@ void __init omap_vram_reserve_sdram(void)
size
=
PAGE_ALIGN
(
size
);
bdata
=
NODE_DATA
(
0
)
->
bdata
;
sdram_start
=
bdata
->
node_min_pfn
<<
PAGE_SHIFT
;
sdram_size
=
(
bdata
->
node_low_pfn
<<
PAGE_SHIFT
)
-
sdram_start
;
if
(
paddr
)
{
if
((
paddr
&
~
PAGE_MASK
)
||
paddr
<
sdram_start
||
paddr
+
size
>
sdram_start
+
sdram_size
)
{
struct
memblock_property
res
;
res
.
base
=
paddr
;
res
.
size
=
size
;
if
((
paddr
&
~
PAGE_MASK
)
||
memblock_find
(
&
res
)
||
res
.
base
!=
paddr
||
res
.
size
!=
size
)
{
pr_err
(
"Illegal SDRAM region for VRAM
\n
"
);
return
;
}
if
(
reserve_bootmem
(
paddr
,
size
,
BOOTMEM_EXCLUSIVE
)
<
0
)
{
pr_err
(
"FB: failed to reserve VRAM
\n
"
);
if
(
memblock_is_region_reserved
(
paddr
,
size
)
)
{
pr_err
(
"FB: failed to reserve VRAM
- busy
\n
"
);
return
;
}
}
else
{
if
(
size
>
sdram_size
)
{
pr_err
(
"
Illegal SDRAM size for VRAM
\n
"
);
if
(
memblock_reserve
(
paddr
,
size
)
<
0
)
{
pr_err
(
"
FB: failed to reserve VRAM - no memory
\n
"
);
return
;
}
paddr
=
virt_to_phys
(
alloc_bootmem_pages
(
size
));
BUG_ON
(
paddr
&
~
PAGE_MASK
);
}
else
{
paddr
=
memblock_alloc_base
(
size
,
PAGE_SIZE
,
MEMBLOCK_REAL_LIMIT
);
}
omap_vram_add_region
(
paddr
,
size
);
...
...
include/linux/omapfb.h
View file @
98864ff5
...
...
@@ -253,7 +253,7 @@ struct omapfb_platform_data {
/* in arch/arm/plat-omap/fb.c */
extern
void
omapfb_set_platform_data
(
struct
omapfb_platform_data
*
data
);
extern
void
omapfb_set_ctrl_platform_data
(
void
*
pdata
);
extern
void
omapfb_reserve_sdram
(
void
);
extern
void
omapfb_reserve_sdram
_memblock
(
void
);
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment