Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
0f13804a
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看板
提交
0f13804a
编写于
10月 06, 2006
作者:
P
Paul Mundt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sh: Convert IPR-IRQ to IRQ chip.
One more initial conversion.. Signed-off-by:
N
Paul Mundt
<
lethal@linux-sh.org
>
上级
525ccc45
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
75 deletion
+27
-75
arch/sh/kernel/cpu/irq/ipr.c
arch/sh/kernel/cpu/irq/ipr.c
+27
-75
未找到文件。
arch/sh/kernel/cpu/irq/ipr.c
浏览文件 @
0f13804a
/*
*
arch/sh/kernel/cpu/irq/ipr.c
*
Interrupt handling for IPR-based IRQ.
*
* Copyright (C) 1999 Niibe Yutaka & Takeshi Yaegashi
* Copyright (C) 2000 Kazumoto Kojima
* Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp>
*
* Interrupt handling for IPR-based IRQ.
* Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp>
* Copyright (C) 2006 Paul Mundt
*
* Supported system:
* On-chip supporting modules (TMU, RTC, etc.).
...
...
@@ -13,12 +12,13 @@
* Hitachi SolutionEngine external I/O:
* MS7709SE01, MS7709ASE01, and MS7750SE01
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/machvec.h>
...
...
@@ -28,93 +28,45 @@ struct ipr_data {
int
shift
;
/* Shifts of the 16-bit data */
int
priority
;
/* The priority */
};
static
struct
ipr_data
ipr_data
[
NR_IRQS
];
static
void
enable_ipr_irq
(
unsigned
int
irq
);
static
void
disable_ipr_irq
(
unsigned
int
irq
);
/* shutdown is same as "disable" */
#define shutdown_ipr_irq disable_ipr_irq
static
void
mask_and_ack_ipr
(
unsigned
int
);
static
void
end_ipr_irq
(
unsigned
int
irq
);
static
unsigned
int
startup_ipr_irq
(
unsigned
int
irq
)
{
enable_ipr_irq
(
irq
);
return
0
;
/* never anything pending */
}
static
struct
hw_interrupt_type
ipr_irq_type
=
{
.
typename
=
"IPR-IRQ"
,
.
startup
=
startup_ipr_irq
,
.
shutdown
=
shutdown_ipr_irq
,
.
enable
=
enable_ipr_irq
,
.
disable
=
disable_ipr_irq
,
.
ack
=
mask_and_ack_ipr
,
.
end
=
end_ipr_irq
};
static
void
disable_ipr_irq
(
unsigned
int
irq
)
{
unsigned
long
val
;
unsigned
int
addr
=
ipr_data
[
irq
].
addr
;
unsigned
short
mask
=
0xffff
^
(
0x0f
<<
ipr_data
[
irq
].
shift
);
struct
ipr_data
*
p
=
get_irq_chip_data
(
irq
);
/* Set the priority in IPR to 0 */
val
=
ctrl_inw
(
addr
);
val
&=
mask
;
ctrl_outw
(
val
,
addr
);
ctrl_outw
(
ctrl_inw
(
p
->
addr
)
&
(
0xffff
^
(
0xf
<<
p
->
shift
)),
p
->
addr
);
}
static
void
enable_ipr_irq
(
unsigned
int
irq
)
{
unsigned
long
val
;
unsigned
int
addr
=
ipr_data
[
irq
].
addr
;
int
priority
=
ipr_data
[
irq
].
priority
;
unsigned
short
value
=
(
priority
<<
ipr_data
[
irq
].
shift
);
struct
ipr_data
*
p
=
get_irq_chip_data
(
irq
);
/* Set priority in IPR back to original value */
val
=
ctrl_inw
(
addr
);
val
|=
value
;
ctrl_outw
(
val
,
addr
);
ctrl_outw
(
ctrl_inw
(
p
->
addr
)
|
(
p
->
priority
<<
p
->
shift
),
p
->
addr
);
}
static
void
mask_and_ack_ipr
(
unsigned
int
irq
)
{
disable_ipr_irq
(
irq
);
#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \
defined(CONFIG_CPU_SUBTYPE_SH7706) || \
defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705)
/* This is needed when we use edge triggered setting */
/* XXX: Is it really needed? */
if
(
IRQ0_IRQ
<=
irq
&&
irq
<=
IRQ5_IRQ
)
{
/* Clear external interrupt request */
int
a
=
ctrl_inb
(
INTC_IRR0
);
a
&=
~
(
1
<<
(
irq
-
IRQ0_IRQ
));
ctrl_outb
(
a
,
INTC_IRR0
);
}
#endif
}
static
void
end_ipr_irq
(
unsigned
int
irq
)
{
if
(
!
(
irq_desc
[
irq
].
status
&
(
IRQ_DISABLED
|
IRQ_INPROGRESS
)))
enable_ipr_irq
(
irq
);
}
static
struct
irq_chip
ipr_irq_chip
=
{
.
name
=
"ipr"
,
.
mask
=
disable_ipr_irq
,
.
unmask
=
enable_ipr_irq
,
.
mask_ack
=
disable_ipr_irq
,
};
void
make_ipr_irq
(
unsigned
int
irq
,
unsigned
int
addr
,
int
pos
,
int
priority
)
{
struct
ipr_data
ipr_data
;
disable_irq_nosync
(
irq
);
ipr_data
[
irq
].
addr
=
addr
;
ipr_data
[
irq
].
shift
=
pos
*
4
;
/* POSition (0-3) x 4 means shift */
ipr_data
[
irq
].
priority
=
priority
;
irq_desc
[
irq
].
chip
=
&
ipr_irq_type
;
disable_ipr_irq
(
irq
);
ipr_data
.
addr
=
addr
;
ipr_data
.
shift
=
pos
*
4
;
/* POSition (0-3) x 4 means shift */
ipr_data
.
priority
=
priority
;
set_irq_chip_and_handler
(
irq
,
&
ipr_irq_chip
,
handle_level_irq
);
set_irq_chip_data
(
irq
,
&
ipr_data
);
enable_ipr_irq
(
irq
);
}
/* XXX: This needs to die a horrible death.. */
void
__init
init_IRQ
(
void
)
{
#ifndef CONFIG_CPU_SUBTYPE_SH7780
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录