Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
44bdef5e
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
44bdef5e
编写于
6月 22, 2006
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[SPARC64]: Convert Cheetah memory controller driver to in-kernel PROM tree.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
cecc4e92
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
44 deletion
+25
-44
arch/sparc64/kernel/chmc.c
arch/sparc64/kernel/chmc.c
+25
-44
未找到文件。
arch/sparc64/kernel/chmc.c
浏览文件 @
44bdef5e
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include <asm/spitfire.h>
#include <asm/spitfire.h>
#include <asm/chmctrl.h>
#include <asm/chmctrl.h>
#include <asm/oplib.h>
#include <asm/oplib.h>
#include <asm/prom.h>
#include <asm/io.h>
#include <asm/io.h>
#define CHMCTRL_NDGRPS 2
#define CHMCTRL_NDGRPS 2
...
@@ -67,7 +68,6 @@ struct bank_info {
...
@@ -67,7 +68,6 @@ struct bank_info {
struct
mctrl_info
{
struct
mctrl_info
{
struct
list_head
list
;
struct
list_head
list
;
int
portid
;
int
portid
;
int
index
;
struct
obp_mem_layout
layout_prop
;
struct
obp_mem_layout
layout_prop
;
int
layout_size
;
int
layout_size
;
...
@@ -339,12 +339,13 @@ static void fetch_decode_regs(struct mctrl_info *mp)
...
@@ -339,12 +339,13 @@ static void fetch_decode_regs(struct mctrl_info *mp)
read_mcreg
(
mp
,
CHMCTRL_DECODE4
));
read_mcreg
(
mp
,
CHMCTRL_DECODE4
));
}
}
static
int
init_one_mctrl
(
int
node
,
int
index
)
static
int
init_one_mctrl
(
struct
device_node
*
dp
)
{
{
struct
mctrl_info
*
mp
=
kmalloc
(
sizeof
(
*
mp
),
GFP_KERNEL
);
struct
mctrl_info
*
mp
=
kmalloc
(
sizeof
(
*
mp
),
GFP_KERNEL
);
int
portid
=
prom_getintdefault
(
node
,
"portid"
,
-
1
);
int
portid
=
of_getintprop_default
(
dp
,
"portid"
,
-
1
);
struct
linux_prom64_registers
p_reg_prop
;
struct
linux_prom64_registers
*
regs
;
int
t
;
void
*
pval
;
int
len
;
if
(
!
mp
)
if
(
!
mp
)
return
-
1
;
return
-
1
;
...
@@ -353,24 +354,21 @@ static int init_one_mctrl(int node, int index)
...
@@ -353,24 +354,21 @@ static int init_one_mctrl(int node, int index)
goto
fail
;
goto
fail
;
mp
->
portid
=
portid
;
mp
->
portid
=
portid
;
mp
->
layout_size
=
prom_getproplen
(
node
,
"memory-layout"
);
pval
=
of_get_property
(
dp
,
"memory-layout"
,
&
len
);
if
(
mp
->
layout_size
<
0
)
mp
->
layout_size
=
len
;
if
(
!
pval
)
mp
->
layout_size
=
0
;
mp
->
layout_size
=
0
;
if
(
mp
->
layout_size
>
sizeof
(
mp
->
layout_prop
))
else
{
goto
fail
;
if
(
mp
->
layout_size
>
sizeof
(
mp
->
layout_prop
))
goto
fail
;
if
(
mp
->
layout_size
>
0
)
memcpy
(
&
mp
->
layout_prop
,
pval
,
len
);
prom_getproperty
(
node
,
"memory-layout"
,
}
(
char
*
)
&
mp
->
layout_prop
,
mp
->
layout_size
);
t
=
prom_getproperty
(
node
,
"reg"
,
regs
=
of_get_property
(
dp
,
"reg"
,
NULL
);
(
char
*
)
&
p_reg_prop
,
if
(
!
regs
||
regs
->
reg_size
!=
0x48
)
sizeof
(
p_reg_prop
));
if
(
t
<
0
||
p_reg_prop
.
reg_size
!=
0x48
)
goto
fail
;
goto
fail
;
mp
->
regs
=
ioremap
(
p_reg_prop
.
phys_addr
,
p_reg_prop
.
reg_size
);
mp
->
regs
=
ioremap
(
regs
->
phys_addr
,
regs
->
reg_size
);
if
(
mp
->
regs
==
NULL
)
if
(
mp
->
regs
==
NULL
)
goto
fail
;
goto
fail
;
...
@@ -384,13 +382,11 @@ static int init_one_mctrl(int node, int index)
...
@@ -384,13 +382,11 @@ static int init_one_mctrl(int node, int index)
fetch_decode_regs
(
mp
);
fetch_decode_regs
(
mp
);
mp
->
index
=
index
;
list_add
(
&
mp
->
list
,
&
mctrl_list
);
list_add
(
&
mp
->
list
,
&
mctrl_list
);
/* Report the device. */
/* Report the device. */
printk
(
KERN_INFO
"
chmc%d
: US3 memory controller at %p [%s]
\n
"
,
printk
(
KERN_INFO
"
%s
: US3 memory controller at %p [%s]
\n
"
,
mp
->
index
,
dp
->
full_name
,
mp
->
regs
,
(
mp
->
layout_size
?
"ACTIVE"
:
"INACTIVE"
));
mp
->
regs
,
(
mp
->
layout_size
?
"ACTIVE"
:
"INACTIVE"
));
return
0
;
return
0
;
...
@@ -404,34 +400,19 @@ static int init_one_mctrl(int node, int index)
...
@@ -404,34 +400,19 @@ static int init_one_mctrl(int node, int index)
return
-
1
;
return
-
1
;
}
}
static
int
__init
probe_for_string
(
char
*
name
,
int
index
)
{
int
node
=
prom_getchild
(
prom_root_node
);
while
((
node
=
prom_searchsiblings
(
node
,
name
))
!=
0
)
{
int
ret
=
init_one_mctrl
(
node
,
index
);
if
(
!
ret
)
index
++
;
node
=
prom_getsibling
(
node
);
if
(
!
node
)
break
;
}
return
index
;
}
static
int
__init
chmc_init
(
void
)
static
int
__init
chmc_init
(
void
)
{
{
int
index
;
struct
device_node
*
dp
;
/* This driver is only for cheetah platforms. */
/* This driver is only for cheetah platforms. */
if
(
tlb_type
!=
cheetah
&&
tlb_type
!=
cheetah_plus
)
if
(
tlb_type
!=
cheetah
&&
tlb_type
!=
cheetah_plus
)
return
-
ENODEV
;
return
-
ENODEV
;
index
=
probe_for_string
(
"memory-controller"
,
0
);
for_each_node_by_name
(
dp
,
"memory-controller"
)
index
=
probe_for_string
(
"mc-us3"
,
index
);
init_one_mctrl
(
dp
);
for_each_node_by_name
(
dp
,
"mc-us3"
)
init_one_mctrl
(
dp
);
return
0
;
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录