Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
98864ff5
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
98864ff5
编写于
5月 22, 2010
作者:
R
Russell King
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ARM: OMAP: Convert OMAPFB and VRAM SDRAM reservation to LMB
Signed-off-by:
N
Russell King
<
rmk+kernel@arm.linux.org.uk
>
上级
8d717a52
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
39 addition
and
34 deletion
+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
未找到文件。
arch/arm/plat-omap/common.c
浏览文件 @
98864ff5
...
@@ -85,8 +85,8 @@ EXPORT_SYMBOL(omap_get_var_config);
...
@@ -85,8 +85,8 @@ EXPORT_SYMBOL(omap_get_var_config);
void
__init
omap_reserve
(
void
)
void
__init
omap_reserve
(
void
)
{
{
omapfb_reserve_sdram
();
omapfb_reserve_sdram
_memblock
();
omap_vram_reserve_sdram
();
omap_vram_reserve_sdram
_memblock
();
}
}
/*
/*
...
...
arch/arm/plat-omap/fb.c
浏览文件 @
98864ff5
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#include <linux/mm.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/
bootmem
.h>
#include <linux/
memblock
.h>
#include <linux/io.h>
#include <linux/io.h>
#include <linux/omapfb.h>
#include <linux/omapfb.h>
...
@@ -173,25 +173,27 @@ static int check_fbmem_region(int region_idx, struct omapfb_mem_region *rg,
...
@@ -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
)
static
int
valid_sdram
(
unsigned
long
addr
,
unsigned
long
size
)
{
{
struct
bootmem_data
*
bdata
=
NODE_DATA
(
0
)
->
bdata
;
struct
memblock_property
res
;
unsigned
long
sdram_start
,
sdram_end
;
sdram_start
=
bdata
->
node_min_pfn
<<
PAGE_SHIFT
;
res
.
base
=
addr
;
sdram_end
=
bdata
->
node_low_pfn
<<
PAGE_SHIFT
;
res
.
size
=
size
;
return
!
memblock_find
(
&
res
)
&&
res
.
base
==
addr
&&
res
.
size
==
size
;
return
addr
>=
sdram_start
&&
sdram_end
-
addr
>=
size
;
}
}
static
int
reserve_sdram
(
unsigned
long
addr
,
unsigned
long
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
* 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.
* 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
;
unsigned
long
reserved
=
0
;
int
i
;
int
i
;
...
@@ -386,7 +388,10 @@ static inline int omap_init_fb(void)
...
@@ -386,7 +388,10 @@ static inline int omap_init_fb(void)
arch_initcall
(
omap_init_fb
);
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
omapfb_reserve_sram
(
unsigned
long
sram_pstart
,
unsigned
long
sram_vstart
,
unsigned
long
sram_vstart
,
unsigned
long
sram_size
,
unsigned
long
sram_size
,
...
@@ -402,7 +407,10 @@ void omapfb_set_platform_data(struct omapfb_platform_data *data)
...
@@ -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
omapfb_reserve_sram
(
unsigned
long
sram_pstart
,
unsigned
long
sram_vstart
,
unsigned
long
sram_vstart
,
unsigned
long
sram_size
,
unsigned
long
sram_size
,
...
...
arch/arm/plat-omap/include/plat/vram.h
浏览文件 @
98864ff5
...
@@ -38,7 +38,7 @@ extern void omap_vram_get_info(unsigned long *vram, unsigned long *free_vram,
...
@@ -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_sdram_vram
(
u32
size
,
u32
start
);
extern
void
omap_vram_set_sram_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
,
extern
unsigned
long
omap_vram_reserve_sram
(
unsigned
long
sram_pstart
,
unsigned
long
sram_vstart
,
unsigned
long
sram_vstart
,
unsigned
long
sram_size
,
unsigned
long
sram_size
,
...
@@ -48,7 +48,7 @@ extern unsigned long omap_vram_reserve_sram(unsigned long sram_pstart,
...
@@ -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_sdram_vram
(
u32
size
,
u32
start
)
{
}
static
inline
void
omap_vram_set_sram_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
,
static
inline
unsigned
long
omap_vram_reserve_sram
(
unsigned
long
sram_pstart
,
unsigned
long
sram_vstart
,
unsigned
long
sram_vstart
,
unsigned
long
sram_size
,
unsigned
long
sram_size
,
...
...
drivers/video/omap2/vram.c
浏览文件 @
98864ff5
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#include <linux/list.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/seq_file.h>
#include <linux/seq_file.h>
#include <linux/
bootmem
.h>
#include <linux/
memblock
.h>
#include <linux/completion.h>
#include <linux/completion.h>
#include <linux/debugfs.h>
#include <linux/debugfs.h>
#include <linux/jiffies.h>
#include <linux/jiffies.h>
...
@@ -525,10 +525,8 @@ early_param("vram", omap_vram_early_vram);
...
@@ -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
* 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.
* 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
paddr
;
u32
size
=
0
;
u32
size
=
0
;
...
@@ -555,29 +553,28 @@ void __init omap_vram_reserve_sdram(void)
...
@@ -555,29 +553,28 @@ void __init omap_vram_reserve_sdram(void)
size
=
PAGE_ALIGN
(
size
);
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
)
{
if
((
paddr
&
~
PAGE_MASK
)
||
paddr
<
sdram_start
||
struct
memblock_property
res
;
paddr
+
size
>
sdram_start
+
sdram_size
)
{
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
"
);
pr_err
(
"Illegal SDRAM region for VRAM
\n
"
);
return
;
return
;
}
}
if
(
reserve_bootmem
(
paddr
,
size
,
BOOTMEM_EXCLUSIVE
)
<
0
)
{
if
(
memblock_is_region_reserved
(
paddr
,
size
)
)
{
pr_err
(
"FB: failed to reserve VRAM
\n
"
);
pr_err
(
"FB: failed to reserve VRAM
- busy
\n
"
);
return
;
return
;
}
}
}
else
{
if
(
size
>
sdram_size
)
{
if
(
memblock_reserve
(
paddr
,
size
)
<
0
)
{
pr_err
(
"
Illegal SDRAM size for VRAM
\n
"
);
pr_err
(
"
FB: failed to reserve VRAM - no memory
\n
"
);
return
;
return
;
}
}
}
else
{
paddr
=
virt_to_phys
(
alloc_bootmem_pages
(
size
));
paddr
=
memblock_alloc_base
(
size
,
PAGE_SIZE
,
MEMBLOCK_REAL_LIMIT
);
BUG_ON
(
paddr
&
~
PAGE_MASK
);
}
}
omap_vram_add_region
(
paddr
,
size
);
omap_vram_add_region
(
paddr
,
size
);
...
...
include/linux/omapfb.h
浏览文件 @
98864ff5
...
@@ -253,7 +253,7 @@ struct omapfb_platform_data {
...
@@ -253,7 +253,7 @@ struct omapfb_platform_data {
/* in arch/arm/plat-omap/fb.c */
/* in arch/arm/plat-omap/fb.c */
extern
void
omapfb_set_platform_data
(
struct
omapfb_platform_data
*
data
);
extern
void
omapfb_set_platform_data
(
struct
omapfb_platform_data
*
data
);
extern
void
omapfb_set_ctrl_platform_data
(
void
*
pdata
);
extern
void
omapfb_set_ctrl_platform_data
(
void
*
pdata
);
extern
void
omapfb_reserve_sdram
(
void
);
extern
void
omapfb_reserve_sdram
_memblock
(
void
);
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录