Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
d73f30e1
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看板
提交
d73f30e1
编写于
1月 08, 2007
作者:
A
Alan
提交者:
Jeff Garzik
2月 09, 2007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sata_via: PATA support
Signed-off-by:
N
Alan Cox
<
alan@redhat.com
>
Signed-off-by:
N
Jeff Garzik
<
jeff@garzik.org
>
上级
7dcbc1f2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
102 addition
and
6 deletion
+102
-6
drivers/ata/sata_via.c
drivers/ata/sata_via.c
+102
-6
未找到文件。
drivers/ata/sata_via.c
浏览文件 @
d73f30e1
...
...
@@ -59,11 +59,14 @@ enum {
SATA_INT_GATE
=
0x41
,
/* SATA interrupt gating */
SATA_NATIVE_MODE
=
0x42
,
/* Native mode enable */
SATA_PATA_SHARING
=
0x49
,
/* PATA/SATA sharing func ctrl */
PATA_UDMA_TIMING
=
0xB3
,
/* PATA timing for DMA/ cable detect */
PATA_PIO_TIMING
=
0xAB
,
/* PATA timing register */
PORT0
=
(
1
<<
1
),
PORT1
=
(
1
<<
0
),
ALL_PORTS
=
PORT0
|
PORT1
,
N_PORTS
=
2
,
PATA_PORT
=
2
,
/* PATA is port 2 */
N_PORTS
=
3
,
NATIVE_MODE_ALL
=
(
1
<<
7
)
|
(
1
<<
6
)
|
(
1
<<
5
)
|
(
1
<<
4
),
...
...
@@ -76,6 +79,11 @@ static u32 svia_scr_read (struct ata_port *ap, unsigned int sc_reg);
static
void
svia_scr_write
(
struct
ata_port
*
ap
,
unsigned
int
sc_reg
,
u32
val
);
static
void
svia_noop_freeze
(
struct
ata_port
*
ap
);
static
void
vt6420_error_handler
(
struct
ata_port
*
ap
);
static
void
vt6421_sata_error_handler
(
struct
ata_port
*
ap
);
static
void
vt6421_pata_error_handler
(
struct
ata_port
*
ap
);
static
void
vt6421_set_pio_mode
(
struct
ata_port
*
ap
,
struct
ata_device
*
adev
);
static
void
vt6421_set_dma_mode
(
struct
ata_port
*
ap
,
struct
ata_device
*
adev
);
static
int
vt6421_port_start
(
struct
ata_port
*
ap
);
static
const
struct
pci_device_id
svia_pci_tbl
[]
=
{
{
PCI_VDEVICE
(
VIA
,
0x5337
),
vt6420
},
...
...
@@ -142,9 +150,43 @@ static const struct ata_port_operations vt6420_sata_ops = {
.
host_stop
=
ata_host_stop
,
};
static
const
struct
ata_port_operations
vt6421_
s
ata_ops
=
{
static
const
struct
ata_port_operations
vt6421_
p
ata_ops
=
{
.
port_disable
=
ata_port_disable
,
.
set_piomode
=
vt6421_set_pio_mode
,
.
set_dmamode
=
vt6421_set_dma_mode
,
.
tf_load
=
ata_tf_load
,
.
tf_read
=
ata_tf_read
,
.
check_status
=
ata_check_status
,
.
exec_command
=
ata_exec_command
,
.
dev_select
=
ata_std_dev_select
,
.
bmdma_setup
=
ata_bmdma_setup
,
.
bmdma_start
=
ata_bmdma_start
,
.
bmdma_stop
=
ata_bmdma_stop
,
.
bmdma_status
=
ata_bmdma_status
,
.
qc_prep
=
ata_qc_prep
,
.
qc_issue
=
ata_qc_issue_prot
,
.
data_xfer
=
ata_pio_data_xfer
,
.
freeze
=
ata_bmdma_freeze
,
.
thaw
=
ata_bmdma_thaw
,
.
error_handler
=
vt6421_pata_error_handler
,
.
post_internal_cmd
=
ata_bmdma_post_internal_cmd
,
.
irq_handler
=
ata_interrupt
,
.
irq_clear
=
ata_bmdma_irq_clear
,
.
port_start
=
vt6421_port_start
,
.
port_stop
=
ata_port_stop
,
.
host_stop
=
ata_host_stop
,
};
static
const
struct
ata_port_operations
vt6421_sata_ops
=
{
.
port_disable
=
ata_port_disable
,
.
tf_load
=
ata_tf_load
,
.
tf_read
=
ata_tf_read
,
.
check_status
=
ata_check_status
,
...
...
@@ -162,7 +204,7 @@ static const struct ata_port_operations vt6421_sata_ops = {
.
freeze
=
ata_bmdma_freeze
,
.
thaw
=
ata_bmdma_thaw
,
.
error_handler
=
ata_bmdm
a_error_handler
,
.
error_handler
=
vt6421_sat
a_error_handler
,
.
post_internal_cmd
=
ata_bmdma_post_internal_cmd
,
.
irq_handler
=
ata_interrupt
,
...
...
@@ -171,7 +213,7 @@ static const struct ata_port_operations vt6421_sata_ops = {
.
scr_read
=
svia_scr_read
,
.
scr_write
=
svia_scr_write
,
.
port_start
=
ata
_port_start
,
.
port_start
=
vt6421
_port_start
,
.
port_stop
=
ata_port_stop
,
.
host_stop
=
ata_host_stop
,
};
...
...
@@ -289,6 +331,61 @@ static void vt6420_error_handler(struct ata_port *ap)
NULL
,
ata_std_postreset
);
}
static
int
vt6421_pata_prereset
(
struct
ata_port
*
ap
)
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host
->
dev
);
u8
tmp
;
pci_read_config_byte
(
pdev
,
PATA_UDMA_TIMING
,
&
tmp
);
if
(
tmp
&
0x10
)
ap
->
cbl
=
ATA_CBL_PATA40
;
else
ap
->
cbl
=
ATA_CBL_PATA80
;
return
0
;
}
static
void
vt6421_pata_error_handler
(
struct
ata_port
*
ap
)
{
return
ata_bmdma_drive_eh
(
ap
,
vt6421_pata_prereset
,
ata_std_softreset
,
NULL
,
ata_std_postreset
);
}
static
int
vt6421_sata_prereset
(
struct
ata_port
*
ap
)
{
ap
->
cbl
=
ATA_CBL_SATA
;
return
0
;
}
static
void
vt6421_sata_error_handler
(
struct
ata_port
*
ap
)
{
return
ata_bmdma_drive_eh
(
ap
,
vt6421_sata_prereset
,
ata_std_softreset
,
NULL
,
ata_std_postreset
);
}
static
void
vt6421_set_pio_mode
(
struct
ata_port
*
ap
,
struct
ata_device
*
adev
)
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host
->
dev
);
static
const
u8
pio_bits
[]
=
{
0xA8
,
0x65
,
0x65
,
0x31
,
0x20
};
pci_write_config_byte
(
pdev
,
PATA_PIO_TIMING
,
pio_bits
[
adev
->
pio_mode
-
XFER_PIO_0
]);
}
static
void
vt6421_set_dma_mode
(
struct
ata_port
*
ap
,
struct
ata_device
*
adev
)
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host
->
dev
);
static
const
u8
udma_bits
[]
=
{
0xEE
,
0xE8
,
0xE6
,
0xE4
,
0xE2
,
0xE1
,
0xE0
,
0xE0
};
pci_write_config_byte
(
pdev
,
PATA_UDMA_TIMING
,
udma_bits
[
adev
->
pio_mode
-
XFER_UDMA_0
]);
}
static
int
vt6421_port_start
(
struct
ata_port
*
ap
)
{
if
(
ap
->
port_no
==
PATA_PORT
)
{
ap
->
ops
=
&
vt6421_pata_ops
;
ap
->
mwdma_mask
=
0
;
ap
->
flags
=
ATA_FLAG_SLAVE_POSS
|
ATA_FLAG_NO_LEGACY
|
ATA_FLAG_SRST
;
}
return
ata_port_start
(
ap
);
}
static
const
unsigned
int
svia_bar_sizes
[]
=
{
8
,
4
,
8
,
4
,
16
,
256
};
...
...
@@ -511,4 +608,3 @@ static void __exit svia_exit(void)
module_init
(
svia_init
);
module_exit
(
svia_exit
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录