Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gsplhtlxg
clone-Linux
提交
e9870c4c
C
clone-Linux
项目概览
gsplhtlxg
/
clone-Linux
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
clone-Linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e9870c4c
编写于
5月 07, 2007
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[SPARC64]: Move {setup,teardown}_msi_irq into pci_pbm_info.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
f1cd8de2
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
119 addition
and
131 deletion
+119
-131
arch/sparc64/kernel/pci.c
arch/sparc64/kernel/pci.c
+5
-11
arch/sparc64/kernel/pci_sun4v.c
arch/sparc64/kernel/pci_sun4v.c
+111
-113
include/asm-sparc64/pbm.h
include/asm-sparc64/pbm.h
+3
-7
未找到文件。
arch/sparc64/kernel/pci.c
浏览文件 @
e9870c4c
...
@@ -1092,17 +1092,12 @@ EXPORT_SYMBOL(pci_domain_nr);
...
@@ -1092,17 +1092,12 @@ EXPORT_SYMBOL(pci_domain_nr);
int
arch_setup_msi_irq
(
struct
pci_dev
*
pdev
,
struct
msi_desc
*
desc
)
int
arch_setup_msi_irq
(
struct
pci_dev
*
pdev
,
struct
msi_desc
*
desc
)
{
{
struct
pci_pbm_info
*
pbm
=
pdev
->
dev
.
archdata
.
host_controller
;
struct
pci_pbm_info
*
pbm
=
pdev
->
dev
.
archdata
.
host_controller
;
struct
pci_controller_info
*
p
=
pbm
->
parent
;
int
virt_irq
;
int
virt_irq
,
err
;
if
(
!
pbm
->
msi_num
||
!
p
->
setup_msi_irq
)
if
(
!
pbm
->
setup_msi_irq
)
return
-
EINVAL
;
return
-
EINVAL
;
err
=
p
->
setup_msi_irq
(
&
virt_irq
,
pdev
,
desc
);
return
pbm
->
setup_msi_irq
(
&
virt_irq
,
pdev
,
desc
);
if
(
err
)
return
err
;
return
0
;
}
}
void
arch_teardown_msi_irq
(
unsigned
int
virt_irq
)
void
arch_teardown_msi_irq
(
unsigned
int
virt_irq
)
...
@@ -1110,12 +1105,11 @@ void arch_teardown_msi_irq(unsigned int virt_irq)
...
@@ -1110,12 +1105,11 @@ void arch_teardown_msi_irq(unsigned int virt_irq)
struct
msi_desc
*
entry
=
get_irq_msi
(
virt_irq
);
struct
msi_desc
*
entry
=
get_irq_msi
(
virt_irq
);
struct
pci_dev
*
pdev
=
entry
->
dev
;
struct
pci_dev
*
pdev
=
entry
->
dev
;
struct
pci_pbm_info
*
pbm
=
pdev
->
dev
.
archdata
.
host_controller
;
struct
pci_pbm_info
*
pbm
=
pdev
->
dev
.
archdata
.
host_controller
;
struct
pci_controller_info
*
p
=
pbm
->
parent
;
if
(
!
pbm
->
msi_num
||
!
p
->
setup
_msi_irq
)
if
(
!
pbm
->
teardown
_msi_irq
)
return
;
return
;
return
p
->
teardown_msi_irq
(
virt_irq
,
pdev
);
return
p
bm
->
teardown_msi_irq
(
virt_irq
,
pdev
);
}
}
#endif
/* !(CONFIG_PCI_MSI) */
#endif
/* !(CONFIG_PCI_MSI) */
...
...
arch/sparc64/kernel/pci_sun4v.c
浏览文件 @
e9870c4c
...
@@ -991,114 +991,6 @@ static int msi_queue_alloc(struct pci_pbm_info *pbm)
...
@@ -991,114 +991,6 @@ static int msi_queue_alloc(struct pci_pbm_info *pbm)
return
-
EINVAL
;
return
-
EINVAL
;
}
}
static
void
pci_sun4v_msi_init
(
struct
pci_pbm_info
*
pbm
)
{
const
u32
*
val
;
int
len
;
val
=
of_get_property
(
pbm
->
prom_node
,
"#msi-eqs"
,
&
len
);
if
(
!
val
||
len
!=
4
)
goto
no_msi
;
pbm
->
msiq_num
=
*
val
;
if
(
pbm
->
msiq_num
)
{
const
struct
msiq_prop
{
u32
first_msiq
;
u32
num_msiq
;
u32
first_devino
;
}
*
mqp
;
const
struct
msi_range_prop
{
u32
first_msi
;
u32
num_msi
;
}
*
mrng
;
const
struct
addr_range_prop
{
u32
msi32_high
;
u32
msi32_low
;
u32
msi32_len
;
u32
msi64_high
;
u32
msi64_low
;
u32
msi64_len
;
}
*
arng
;
val
=
of_get_property
(
pbm
->
prom_node
,
"msi-eq-size"
,
&
len
);
if
(
!
val
||
len
!=
4
)
goto
no_msi
;
pbm
->
msiq_ent_count
=
*
val
;
mqp
=
of_get_property
(
pbm
->
prom_node
,
"msi-eq-to-devino"
,
&
len
);
if
(
!
mqp
||
len
!=
sizeof
(
struct
msiq_prop
))
goto
no_msi
;
pbm
->
msiq_first
=
mqp
->
first_msiq
;
pbm
->
msiq_first_devino
=
mqp
->
first_devino
;
val
=
of_get_property
(
pbm
->
prom_node
,
"#msi"
,
&
len
);
if
(
!
val
||
len
!=
4
)
goto
no_msi
;
pbm
->
msi_num
=
*
val
;
mrng
=
of_get_property
(
pbm
->
prom_node
,
"msi-ranges"
,
&
len
);
if
(
!
mrng
||
len
!=
sizeof
(
struct
msi_range_prop
))
goto
no_msi
;
pbm
->
msi_first
=
mrng
->
first_msi
;
val
=
of_get_property
(
pbm
->
prom_node
,
"msi-data-mask"
,
&
len
);
if
(
!
val
||
len
!=
4
)
goto
no_msi
;
pbm
->
msi_data_mask
=
*
val
;
val
=
of_get_property
(
pbm
->
prom_node
,
"msix-data-width"
,
&
len
);
if
(
!
val
||
len
!=
4
)
goto
no_msi
;
pbm
->
msix_data_width
=
*
val
;
arng
=
of_get_property
(
pbm
->
prom_node
,
"msi-address-ranges"
,
&
len
);
if
(
!
arng
||
len
!=
sizeof
(
struct
addr_range_prop
))
goto
no_msi
;
pbm
->
msi32_start
=
((
u64
)
arng
->
msi32_high
<<
32
)
|
(
u64
)
arng
->
msi32_low
;
pbm
->
msi64_start
=
((
u64
)
arng
->
msi64_high
<<
32
)
|
(
u64
)
arng
->
msi64_low
;
pbm
->
msi32_len
=
arng
->
msi32_len
;
pbm
->
msi64_len
=
arng
->
msi64_len
;
if
(
msi_bitmap_alloc
(
pbm
))
goto
no_msi
;
if
(
msi_queue_alloc
(
pbm
))
{
msi_bitmap_free
(
pbm
);
goto
no_msi
;
}
printk
(
KERN_INFO
"%s: MSI Queue first[%u] num[%u] count[%u] "
"devino[0x%x]
\n
"
,
pbm
->
name
,
pbm
->
msiq_first
,
pbm
->
msiq_num
,
pbm
->
msiq_ent_count
,
pbm
->
msiq_first_devino
);
printk
(
KERN_INFO
"%s: MSI first[%u] num[%u] mask[0x%x] "
"width[%u]
\n
"
,
pbm
->
name
,
pbm
->
msi_first
,
pbm
->
msi_num
,
pbm
->
msi_data_mask
,
pbm
->
msix_data_width
);
printk
(
KERN_INFO
"%s: MSI addr32[0x%lx:0x%x] "
"addr64[0x%lx:0x%x]
\n
"
,
pbm
->
name
,
pbm
->
msi32_start
,
pbm
->
msi32_len
,
pbm
->
msi64_start
,
pbm
->
msi64_len
);
printk
(
KERN_INFO
"%s: MSI queues at RA [%p]
\n
"
,
pbm
->
name
,
pbm
->
msi_queues
);
}
return
;
no_msi:
pbm
->
msiq_num
=
0
;
printk
(
KERN_INFO
"%s: No MSI support.
\n
"
,
pbm
->
name
);
}
static
int
alloc_msi
(
struct
pci_pbm_info
*
pbm
)
static
int
alloc_msi
(
struct
pci_pbm_info
*
pbm
)
{
{
...
@@ -1217,6 +1109,117 @@ static void pci_sun4v_teardown_msi_irq(unsigned int virt_irq,
...
@@ -1217,6 +1109,117 @@ static void pci_sun4v_teardown_msi_irq(unsigned int virt_irq,
*/
*/
sun4v_destroy_msi
(
virt_irq
);
sun4v_destroy_msi
(
virt_irq
);
}
}
static
void
pci_sun4v_msi_init
(
struct
pci_pbm_info
*
pbm
)
{
const
u32
*
val
;
int
len
;
val
=
of_get_property
(
pbm
->
prom_node
,
"#msi-eqs"
,
&
len
);
if
(
!
val
||
len
!=
4
)
goto
no_msi
;
pbm
->
msiq_num
=
*
val
;
if
(
pbm
->
msiq_num
)
{
const
struct
msiq_prop
{
u32
first_msiq
;
u32
num_msiq
;
u32
first_devino
;
}
*
mqp
;
const
struct
msi_range_prop
{
u32
first_msi
;
u32
num_msi
;
}
*
mrng
;
const
struct
addr_range_prop
{
u32
msi32_high
;
u32
msi32_low
;
u32
msi32_len
;
u32
msi64_high
;
u32
msi64_low
;
u32
msi64_len
;
}
*
arng
;
val
=
of_get_property
(
pbm
->
prom_node
,
"msi-eq-size"
,
&
len
);
if
(
!
val
||
len
!=
4
)
goto
no_msi
;
pbm
->
msiq_ent_count
=
*
val
;
mqp
=
of_get_property
(
pbm
->
prom_node
,
"msi-eq-to-devino"
,
&
len
);
if
(
!
mqp
||
len
!=
sizeof
(
struct
msiq_prop
))
goto
no_msi
;
pbm
->
msiq_first
=
mqp
->
first_msiq
;
pbm
->
msiq_first_devino
=
mqp
->
first_devino
;
val
=
of_get_property
(
pbm
->
prom_node
,
"#msi"
,
&
len
);
if
(
!
val
||
len
!=
4
)
goto
no_msi
;
pbm
->
msi_num
=
*
val
;
mrng
=
of_get_property
(
pbm
->
prom_node
,
"msi-ranges"
,
&
len
);
if
(
!
mrng
||
len
!=
sizeof
(
struct
msi_range_prop
))
goto
no_msi
;
pbm
->
msi_first
=
mrng
->
first_msi
;
val
=
of_get_property
(
pbm
->
prom_node
,
"msi-data-mask"
,
&
len
);
if
(
!
val
||
len
!=
4
)
goto
no_msi
;
pbm
->
msi_data_mask
=
*
val
;
val
=
of_get_property
(
pbm
->
prom_node
,
"msix-data-width"
,
&
len
);
if
(
!
val
||
len
!=
4
)
goto
no_msi
;
pbm
->
msix_data_width
=
*
val
;
arng
=
of_get_property
(
pbm
->
prom_node
,
"msi-address-ranges"
,
&
len
);
if
(
!
arng
||
len
!=
sizeof
(
struct
addr_range_prop
))
goto
no_msi
;
pbm
->
msi32_start
=
((
u64
)
arng
->
msi32_high
<<
32
)
|
(
u64
)
arng
->
msi32_low
;
pbm
->
msi64_start
=
((
u64
)
arng
->
msi64_high
<<
32
)
|
(
u64
)
arng
->
msi64_low
;
pbm
->
msi32_len
=
arng
->
msi32_len
;
pbm
->
msi64_len
=
arng
->
msi64_len
;
if
(
msi_bitmap_alloc
(
pbm
))
goto
no_msi
;
if
(
msi_queue_alloc
(
pbm
))
{
msi_bitmap_free
(
pbm
);
goto
no_msi
;
}
printk
(
KERN_INFO
"%s: MSI Queue first[%u] num[%u] count[%u] "
"devino[0x%x]
\n
"
,
pbm
->
name
,
pbm
->
msiq_first
,
pbm
->
msiq_num
,
pbm
->
msiq_ent_count
,
pbm
->
msiq_first_devino
);
printk
(
KERN_INFO
"%s: MSI first[%u] num[%u] mask[0x%x] "
"width[%u]
\n
"
,
pbm
->
name
,
pbm
->
msi_first
,
pbm
->
msi_num
,
pbm
->
msi_data_mask
,
pbm
->
msix_data_width
);
printk
(
KERN_INFO
"%s: MSI addr32[0x%lx:0x%x] "
"addr64[0x%lx:0x%x]
\n
"
,
pbm
->
name
,
pbm
->
msi32_start
,
pbm
->
msi32_len
,
pbm
->
msi64_start
,
pbm
->
msi64_len
);
printk
(
KERN_INFO
"%s: MSI queues at RA [%p]
\n
"
,
pbm
->
name
,
pbm
->
msi_queues
);
}
pbm
->
setup_msi_irq
=
pci_sun4v_setup_msi_irq
;
pbm
->
teardown_msi_irq
=
pci_sun4v_teardown_msi_irq
;
return
;
no_msi:
pbm
->
msiq_num
=
0
;
printk
(
KERN_INFO
"%s: No MSI support.
\n
"
,
pbm
->
name
);
}
#else
/* CONFIG_PCI_MSI */
#else
/* CONFIG_PCI_MSI */
static
void
pci_sun4v_msi_init
(
struct
pci_pbm_info
*
pbm
)
static
void
pci_sun4v_msi_init
(
struct
pci_pbm_info
*
pbm
)
{
{
...
@@ -1303,11 +1306,6 @@ void sun4v_pci_init(struct device_node *dp, char *model_name)
...
@@ -1303,11 +1306,6 @@ void sun4v_pci_init(struct device_node *dp, char *model_name)
p
->
index
=
pci_num_controllers
++
;
p
->
index
=
pci_num_controllers
++
;
#ifdef CONFIG_PCI_MSI
p
->
setup_msi_irq
=
pci_sun4v_setup_msi_irq
;
p
->
teardown_msi_irq
=
pci_sun4v_teardown_msi_irq
;
#endif
/* Like PSYCHO and SCHIZO we have a 2GB aligned area
/* Like PSYCHO and SCHIZO we have a 2GB aligned area
* for memory space.
* for memory space.
*/
*/
...
...
include/asm-sparc64/pbm.h
浏览文件 @
e9870c4c
...
@@ -103,6 +103,9 @@ struct pci_pbm_info {
...
@@ -103,6 +103,9 @@ struct pci_pbm_info {
u32
msi64_len
;
u32
msi64_len
;
void
*
msi_queues
;
void
*
msi_queues
;
unsigned
long
*
msi_bitmap
;
unsigned
long
*
msi_bitmap
;
int
(
*
setup_msi_irq
)(
unsigned
int
*
virt_irq_p
,
struct
pci_dev
*
pdev
,
struct
msi_desc
*
entry
);
void
(
*
teardown_msi_irq
)(
unsigned
int
virt_irq
,
struct
pci_dev
*
pdev
);
#endif
/* !(CONFIG_PCI_MSI) */
#endif
/* !(CONFIG_PCI_MSI) */
/* This PBM's streaming buffer. */
/* This PBM's streaming buffer. */
...
@@ -128,13 +131,6 @@ struct pci_controller_info {
...
@@ -128,13 +131,6 @@ struct pci_controller_info {
/* The PCI bus modules controlled by us. */
/* The PCI bus modules controlled by us. */
struct
pci_pbm_info
pbm_A
;
struct
pci_pbm_info
pbm_A
;
struct
pci_pbm_info
pbm_B
;
struct
pci_pbm_info
pbm_B
;
/* Operations which are controller specific. */
#ifdef CONFIG_PCI_MSI
int
(
*
setup_msi_irq
)(
unsigned
int
*
virt_irq_p
,
struct
pci_dev
*
pdev
,
struct
msi_desc
*
entry
);
void
(
*
teardown_msi_irq
)(
unsigned
int
virt_irq
,
struct
pci_dev
*
pdev
);
#endif
};
};
#endif
/* !(__SPARC64_PBM_H) */
#endif
/* !(__SPARC64_PBM_H) */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录