Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
c416daa9
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看板
提交
c416daa9
编写于
5月 10, 2009
作者:
D
David Woodhouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
intel-iommu: Tidy up iommu->gcmd handling
Signed-off-by:
N
David Woodhouse
<
David.Woodhouse@intel.com
>
上级
462b60f6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
20 deletion
+15
-20
drivers/pci/dmar.c
drivers/pci/dmar.c
+2
-4
drivers/pci/intel-iommu.c
drivers/pci/intel-iommu.c
+9
-9
drivers/pci/intr_remapping.c
drivers/pci/intr_remapping.c
+4
-7
未找到文件。
drivers/pci/dmar.c
浏览文件 @
c416daa9
...
@@ -784,7 +784,6 @@ void dmar_disable_qi(struct intel_iommu *iommu)
...
@@ -784,7 +784,6 @@ void dmar_disable_qi(struct intel_iommu *iommu)
cpu_relax
();
cpu_relax
();
iommu
->
gcmd
&=
~
DMA_GCMD_QIE
;
iommu
->
gcmd
&=
~
DMA_GCMD_QIE
;
writel
(
iommu
->
gcmd
,
iommu
->
reg
+
DMAR_GCMD_REG
);
writel
(
iommu
->
gcmd
,
iommu
->
reg
+
DMAR_GCMD_REG
);
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
readl
,
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
readl
,
...
@@ -798,7 +797,7 @@ void dmar_disable_qi(struct intel_iommu *iommu)
...
@@ -798,7 +797,7 @@ void dmar_disable_qi(struct intel_iommu *iommu)
*/
*/
static
void
__dmar_enable_qi
(
struct
intel_iommu
*
iommu
)
static
void
__dmar_enable_qi
(
struct
intel_iommu
*
iommu
)
{
{
u32
cmd
,
sts
;
u32
sts
;
unsigned
long
flags
;
unsigned
long
flags
;
struct
q_inval
*
qi
=
iommu
->
qi
;
struct
q_inval
*
qi
=
iommu
->
qi
;
...
@@ -812,9 +811,8 @@ static void __dmar_enable_qi(struct intel_iommu *iommu)
...
@@ -812,9 +811,8 @@ static void __dmar_enable_qi(struct intel_iommu *iommu)
dmar_writeq
(
iommu
->
reg
+
DMAR_IQA_REG
,
virt_to_phys
(
qi
->
desc
));
dmar_writeq
(
iommu
->
reg
+
DMAR_IQA_REG
,
virt_to_phys
(
qi
->
desc
));
cmd
=
iommu
->
gcmd
|
DMA_GCMD_QIE
;
iommu
->
gcmd
|=
DMA_GCMD_QIE
;
iommu
->
gcmd
|=
DMA_GCMD_QIE
;
writel
(
cmd
,
iommu
->
reg
+
DMAR_GCMD_REG
);
writel
(
iommu
->
g
cmd
,
iommu
->
reg
+
DMAR_GCMD_REG
);
/* Make sure hardware complete it */
/* Make sure hardware complete it */
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
readl
,
(
sts
&
DMA_GSTS_QIES
),
sts
);
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
readl
,
(
sts
&
DMA_GSTS_QIES
),
sts
);
...
...
drivers/pci/intel-iommu.c
浏览文件 @
c416daa9
...
@@ -819,7 +819,7 @@ static int iommu_alloc_root_entry(struct intel_iommu *iommu)
...
@@ -819,7 +819,7 @@ static int iommu_alloc_root_entry(struct intel_iommu *iommu)
static
void
iommu_set_root_entry
(
struct
intel_iommu
*
iommu
)
static
void
iommu_set_root_entry
(
struct
intel_iommu
*
iommu
)
{
{
void
*
addr
;
void
*
addr
;
u32
cmd
,
sts
;
u32
sts
;
unsigned
long
flag
;
unsigned
long
flag
;
addr
=
iommu
->
root_entry
;
addr
=
iommu
->
root_entry
;
...
@@ -827,12 +827,11 @@ static void iommu_set_root_entry(struct intel_iommu *iommu)
...
@@ -827,12 +827,11 @@ static void iommu_set_root_entry(struct intel_iommu *iommu)
spin_lock_irqsave
(
&
iommu
->
register_lock
,
flag
);
spin_lock_irqsave
(
&
iommu
->
register_lock
,
flag
);
dmar_writeq
(
iommu
->
reg
+
DMAR_RTADDR_REG
,
virt_to_phys
(
addr
));
dmar_writeq
(
iommu
->
reg
+
DMAR_RTADDR_REG
,
virt_to_phys
(
addr
));
cmd
=
iommu
->
gcmd
|
DMA_GCMD_SRTP
;
writel
(
iommu
->
gcmd
|
DMA_GCMD_SRTP
,
iommu
->
reg
+
DMAR_GCMD_REG
);
writel
(
cmd
,
iommu
->
reg
+
DMAR_GCMD_REG
);
/* Make sure hardware complete it */
/* Make sure hardware complete it */
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
readl
,
(
sts
&
DMA_GSTS_RTPS
),
sts
);
readl
,
(
sts
&
DMA_GSTS_RTPS
),
sts
);
spin_unlock_irqrestore
(
&
iommu
->
register_lock
,
flag
);
spin_unlock_irqrestore
(
&
iommu
->
register_lock
,
flag
);
}
}
...
@@ -844,12 +843,13 @@ static void iommu_flush_write_buffer(struct intel_iommu *iommu)
...
@@ -844,12 +843,13 @@ static void iommu_flush_write_buffer(struct intel_iommu *iommu)
if
(
!
rwbf_quirk
&&
!
cap_rwbf
(
iommu
->
cap
))
if
(
!
rwbf_quirk
&&
!
cap_rwbf
(
iommu
->
cap
))
return
;
return
;
spin_lock_irqsave
(
&
iommu
->
register_lock
,
flag
);
spin_lock_irqsave
(
&
iommu
->
register_lock
,
flag
);
writel
(
iommu
->
gcmd
|
DMA_GCMD_WBF
,
iommu
->
reg
+
DMAR_GCMD_REG
);
writel
(
iommu
->
gcmd
|
DMA_GCMD_WBF
,
iommu
->
reg
+
DMAR_GCMD_REG
);
/* Make sure hardware complete it */
/* Make sure hardware complete it */
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
readl
,
(
!
(
val
&
DMA_GSTS_WBFS
)),
val
);
readl
,
(
!
(
val
&
DMA_GSTS_WBFS
)),
val
);
spin_unlock_irqrestore
(
&
iommu
->
register_lock
,
flag
);
spin_unlock_irqrestore
(
&
iommu
->
register_lock
,
flag
);
}
}
...
@@ -995,13 +995,13 @@ static int iommu_enable_translation(struct intel_iommu *iommu)
...
@@ -995,13 +995,13 @@ static int iommu_enable_translation(struct intel_iommu *iommu)
unsigned
long
flags
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
iommu
->
register_lock
,
flags
);
spin_lock_irqsave
(
&
iommu
->
register_lock
,
flags
);
writel
(
iommu
->
gcmd
|
DMA_GCMD_TE
,
iommu
->
reg
+
DMAR_GCMD_REG
);
iommu
->
gcmd
|=
DMA_GCMD_TE
;
writel
(
iommu
->
gcmd
,
iommu
->
reg
+
DMAR_GCMD_REG
);
/* Make sure hardware complete it */
/* Make sure hardware complete it */
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
readl
,
(
sts
&
DMA_GSTS_TES
),
sts
);
readl
,
(
sts
&
DMA_GSTS_TES
),
sts
);
iommu
->
gcmd
|=
DMA_GCMD_TE
;
spin_unlock_irqrestore
(
&
iommu
->
register_lock
,
flags
);
spin_unlock_irqrestore
(
&
iommu
->
register_lock
,
flags
);
return
0
;
return
0
;
}
}
...
@@ -1017,7 +1017,7 @@ static int iommu_disable_translation(struct intel_iommu *iommu)
...
@@ -1017,7 +1017,7 @@ static int iommu_disable_translation(struct intel_iommu *iommu)
/* Make sure hardware complete it */
/* Make sure hardware complete it */
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
readl
,
(
!
(
sts
&
DMA_GSTS_TES
)),
sts
);
readl
,
(
!
(
sts
&
DMA_GSTS_TES
)),
sts
);
spin_unlock_irqrestore
(
&
iommu
->
register_lock
,
flag
);
spin_unlock_irqrestore
(
&
iommu
->
register_lock
,
flag
);
return
0
;
return
0
;
...
...
drivers/pci/intr_remapping.c
浏览文件 @
c416daa9
...
@@ -404,7 +404,7 @@ int free_irte(int irq)
...
@@ -404,7 +404,7 @@ int free_irte(int irq)
static
void
iommu_set_intr_remapping
(
struct
intel_iommu
*
iommu
,
int
mode
)
static
void
iommu_set_intr_remapping
(
struct
intel_iommu
*
iommu
,
int
mode
)
{
{
u64
addr
;
u64
addr
;
u32
cmd
,
sts
;
u32
sts
;
unsigned
long
flags
;
unsigned
long
flags
;
addr
=
virt_to_phys
((
void
*
)
iommu
->
ir_table
->
base
);
addr
=
virt_to_phys
((
void
*
)
iommu
->
ir_table
->
base
);
...
@@ -415,9 +415,8 @@ static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode)
...
@@ -415,9 +415,8 @@ static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode)
(
addr
)
|
IR_X2APIC_MODE
(
mode
)
|
INTR_REMAP_TABLE_REG_SIZE
);
(
addr
)
|
IR_X2APIC_MODE
(
mode
)
|
INTR_REMAP_TABLE_REG_SIZE
);
/* Set interrupt-remapping table pointer */
/* Set interrupt-remapping table pointer */
cmd
=
iommu
->
gcmd
|
DMA_GCMD_SIRTP
;
iommu
->
gcmd
|=
DMA_GCMD_SIRTP
;
iommu
->
gcmd
|=
DMA_GCMD_SIRTP
;
writel
(
cmd
,
iommu
->
reg
+
DMAR_GCMD_REG
);
writel
(
iommu
->
g
cmd
,
iommu
->
reg
+
DMAR_GCMD_REG
);
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
readl
,
(
sts
&
DMA_GSTS_IRTPS
),
sts
);
readl
,
(
sts
&
DMA_GSTS_IRTPS
),
sts
);
...
@@ -427,9 +426,8 @@ static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode)
...
@@ -427,9 +426,8 @@ static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode)
spin_lock_irqsave
(
&
iommu
->
register_lock
,
flags
);
spin_lock_irqsave
(
&
iommu
->
register_lock
,
flags
);
/* enable comaptiblity format interrupt pass through */
/* enable comaptiblity format interrupt pass through */
cmd
=
iommu
->
gcmd
|
DMA_GCMD_CFI
;
iommu
->
gcmd
|=
DMA_GCMD_CFI
;
iommu
->
gcmd
|=
DMA_GCMD_CFI
;
writel
(
cmd
,
iommu
->
reg
+
DMAR_GCMD_REG
);
writel
(
iommu
->
g
cmd
,
iommu
->
reg
+
DMAR_GCMD_REG
);
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
readl
,
(
sts
&
DMA_GSTS_CFIS
),
sts
);
readl
,
(
sts
&
DMA_GSTS_CFIS
),
sts
);
...
@@ -446,9 +444,8 @@ static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode)
...
@@ -446,9 +444,8 @@ static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode)
spin_lock_irqsave
(
&
iommu
->
register_lock
,
flags
);
spin_lock_irqsave
(
&
iommu
->
register_lock
,
flags
);
/* Enable interrupt-remapping */
/* Enable interrupt-remapping */
cmd
=
iommu
->
gcmd
|
DMA_GCMD_IRE
;
iommu
->
gcmd
|=
DMA_GCMD_IRE
;
iommu
->
gcmd
|=
DMA_GCMD_IRE
;
writel
(
cmd
,
iommu
->
reg
+
DMAR_GCMD_REG
);
writel
(
iommu
->
g
cmd
,
iommu
->
reg
+
DMAR_GCMD_REG
);
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
IOMMU_WAIT_OP
(
iommu
,
DMAR_GSTS_REG
,
readl
,
(
sts
&
DMA_GSTS_IRES
),
sts
);
readl
,
(
sts
&
DMA_GSTS_IRES
),
sts
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录