Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
b20bfe41
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b20bfe41
编写于
8月 30, 2008
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sparc64: Convert PSYCHO PCI controller driver into a real driver.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
3822b509
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
70 addition
and
28 deletion
+70
-28
arch/sparc64/kernel/pci.c
arch/sparc64/kernel/pci.c
+0
-3
arch/sparc64/kernel/pci_psycho.c
arch/sparc64/kernel/pci_psycho.c
+70
-25
未找到文件。
arch/sparc64/kernel/pci.c
浏览文件 @
b20bfe41
...
...
@@ -166,7 +166,6 @@ void pci_config_write32(u32 *addr, u32 val)
/* Probe for all PCI controllers in the system. */
extern
void
sabre_init
(
struct
device_node
*
,
const
char
*
);
extern
void
psycho_init
(
struct
device_node
*
,
const
char
*
);
extern
void
fire_pci_init
(
struct
device_node
*
,
const
char
*
);
static
struct
{
...
...
@@ -176,8 +175,6 @@ static struct {
{
"SUNW,sabre"
,
sabre_init
},
{
"pci108e,a000"
,
sabre_init
},
{
"pci108e,a001"
,
sabre_init
},
{
"SUNW,psycho"
,
psycho_init
},
{
"pci108e,8000"
,
psycho_init
},
{
"pciex108e,80f0"
,
fire_pci_init
},
};
#define PCI_NUM_CONTROLLER_TYPES ARRAY_SIZE(pci_controller_table)
...
...
arch/sparc64/kernel/pci_psycho.c
浏览文件 @
b20bfe41
...
...
@@ -17,11 +17,13 @@
#include <asm/irq.h>
#include <asm/starfire.h>
#include <asm/prom.h>
#include <asm/oplib.h>
#include "pci_impl.h"
#include "iommu_common.h"
#define DRIVER_NAME "psycho"
#define PFX DRIVER_NAME ": "
/* All PSYCHO registers are 64-bits. The following accessor
* routines are how they are accessed. The REG parameter
* is a physical address.
...
...
@@ -840,7 +842,7 @@ static int psycho_iommu_init(struct pci_pbm_info *pbm)
control
=
psycho_read
(
pbm
->
controller_regs
+
PSYCHO_IOMMU_CONTROL
);
control
|=
PSYCHO_IOMMU_CTRL_DENAB
;
psycho_write
(
pbm
->
controller_regs
+
PSYCHO_IOMMU_CONTROL
,
control
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
for
(
i
=
0
;
i
<
16
;
i
++
)
{
psycho_write
(
pbm
->
controller_regs
+
PSYCHO_IOMMU_TAG
+
(
i
*
8UL
),
0
);
psycho_write
(
pbm
->
controller_regs
+
PSYCHO_IOMMU_DATA
+
(
i
*
8UL
),
0
);
}
...
...
@@ -850,8 +852,10 @@ static int psycho_iommu_init(struct pci_pbm_info *pbm)
*/
err
=
iommu_table_init
(
iommu
,
IO_TSB_SIZE
,
0xc0000000
,
0xffffffff
,
pbm
->
numa_node
);
if
(
err
)
if
(
err
)
{
printk
(
KERN_ERR
PFX
"iommu_table_init() fails
\n
"
);
return
err
;
}
psycho_write
(
pbm
->
controller_regs
+
PSYCHO_IOMMU_TSBBASE
,
__pa
(
iommu
->
page_table
));
...
...
@@ -982,7 +986,6 @@ static void __init psycho_pbm_init(struct pci_controller_info *p,
pbm
->
numa_node
=
-
1
;
pbm
->
scan_bus
=
psycho_scan_bus
;
pbm
->
pci_ops
=
&
sun4u_pci_ops
;
pbm
->
config_space_reg_bits
=
8
;
...
...
@@ -1002,7 +1005,7 @@ static void __init psycho_pbm_init(struct pci_controller_info *p,
pbm
->
prom_node
=
dp
;
pbm
->
name
=
dp
->
full_name
;
printk
(
"%s: PSYCHO PCI Bus Module ver[%x:%x]
\n
"
,
printk
(
KERN_INFO
"%s: PSYCHO PCI Bus Module ver[%x:%x]
\n
"
,
pbm
->
name
,
pbm
->
chip_version
,
pbm
->
chip_revision
);
...
...
@@ -1011,24 +1014,28 @@ static void __init psycho_pbm_init(struct pci_controller_info *p,
pci_get_pbm_props
(
pbm
);
psycho_pbm_strbuf_init
(
pbm
,
is_pbm_a
);
psycho_scan_bus
(
pbm
);
}
#define PSYCHO_CONFIGSPACE 0x001000000UL
void
__init
psycho_init
(
struct
device_node
*
dp
,
char
*
model_name
)
static
int
__devinit
psycho_probe
(
struct
of_device
*
op
,
const
struct
of_device_id
*
match
)
{
struct
linux_prom64_registers
*
pr_regs
;
const
struct
linux_prom64_registers
*
pr_regs
;
struct
device_node
*
dp
=
op
->
node
;
struct
pci_controller_info
*
p
;
struct
pci_pbm_info
*
pbm
;
struct
iommu
*
iommu
;
struct
property
*
prop
;
int
is_pbm_a
,
err
;
const
u32
*
p32
;
u32
upa_portid
;
int
is_pbm_a
;
upa_portid
=
0xff
;
p
rop
=
of_find
_property
(
dp
,
"upa-portid"
,
NULL
);
if
(
p
rop
)
upa_portid
=
*
(
u32
*
)
prop
->
value
;
p
32
=
of_get
_property
(
dp
,
"upa-portid"
,
NULL
);
if
(
p
32
)
upa_portid
=
*
p32
;
for
(
pbm
=
pci_pbm_root
;
pbm
;
pbm
=
pbm
->
next
)
{
struct
pci_controller_info
*
p
=
pbm
->
parent
;
...
...
@@ -1036,24 +1043,34 @@ void __init psycho_init(struct device_node *dp, char *model_name)
if
(
p
->
pbm_A
.
portid
==
upa_portid
)
{
is_pbm_a
=
(
p
->
pbm_A
.
prom_node
==
NULL
);
psycho_pbm_init
(
p
,
dp
,
is_pbm_a
);
return
;
return
0
;
}
}
err
=
-
ENOMEM
;
p
=
kzalloc
(
sizeof
(
struct
pci_controller_info
),
GFP_ATOMIC
);
if
(
!
p
)
goto
fatal_memory_error
;
if
(
!
p
)
{
printk
(
KERN_ERR
PFX
"Cannot allocate controller info.
\n
"
);
goto
out_free
;
}
iommu
=
kzalloc
(
sizeof
(
struct
iommu
),
GFP_ATOMIC
);
if
(
!
iommu
)
goto
fatal_memory_error
;
if
(
!
iommu
)
{
printk
(
KERN_ERR
PFX
"Cannot allocate PBM iommu.
\n
"
);
goto
out_free
;
}
p
->
pbm_A
.
iommu
=
p
->
pbm_B
.
iommu
=
iommu
;
p
->
pbm_A
.
portid
=
upa_portid
;
p
->
pbm_B
.
portid
=
upa_portid
;
prop
=
of_find_property
(
dp
,
"reg"
,
NULL
);
pr_regs
=
prop
->
value
;
pr_regs
=
of_get_property
(
dp
,
"reg"
,
NULL
);
err
=
-
ENODEV
;
if
(
!
pr_regs
)
{
printk
(
KERN_ERR
PFX
"No reg property.
\n
"
);
goto
out_free
;
}
p
->
pbm_A
.
controller_regs
=
pr_regs
[
2
].
phys_addr
;
p
->
pbm_B
.
controller_regs
=
pr_regs
[
2
].
phys_addr
;
...
...
@@ -1063,14 +1080,42 @@ void __init psycho_init(struct device_node *dp, char *model_name)
psycho_controller_hwinit
(
&
p
->
pbm_A
);
if
(
psycho_iommu_init
(
&
p
->
pbm_A
))
goto
fatal_memory_error
;
err
=
psycho_iommu_init
(
&
p
->
pbm_A
);
if
(
err
)
goto
out_free
;
is_pbm_a
=
((
pr_regs
[
0
].
phys_addr
&
0x6000
)
==
0x2000
);
psycho_pbm_init
(
p
,
dp
,
is_pbm_a
);
return
;
fatal_memory_error:
prom_printf
(
"PSYCHO: Fatal memory allocation error.
\n
"
);
prom_halt
();
return
0
;
out_free:
if
(
p
)
{
if
(
p
->
pbm_A
.
iommu
)
kfree
(
p
->
pbm_A
.
iommu
);
kfree
(
p
);
}
return
err
;
}
static
struct
of_device_id
psycho_match
[]
=
{
{
.
name
=
"pci"
,
.
compatible
=
"pci108e,8000"
,
},
{},
};
static
struct
of_platform_driver
psycho_driver
=
{
.
name
=
DRIVER_NAME
,
.
match_table
=
psycho_match
,
.
probe
=
psycho_probe
,
};
static
int
__init
psycho_init
(
void
)
{
return
of_register_driver
(
&
psycho_driver
,
&
of_bus_type
);
}
subsys_initcall
(
psycho_init
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录