Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
f8d1a939
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
f8d1a939
编写于
5月 13, 2016
作者:
T
Tejun Heo
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-4.6-fixes' into for-4.7
上级
26f58830
535dac4a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
229 addition
and
1 deletion
+229
-1
Documentation/devicetree/bindings/ata/ahci-platform.txt
Documentation/devicetree/bindings/ata/ahci-platform.txt
+4
-0
arch/arm/boot/dts/qcom-apq8064.dtsi
arch/arm/boot/dts/qcom-apq8064.dtsi
+2
-1
drivers/ata/Kconfig
drivers/ata/Kconfig
+8
-0
drivers/ata/Makefile
drivers/ata/Makefile
+1
-0
drivers/ata/ahci_platform.c
drivers/ata/ahci_platform.c
+3
-0
drivers/ata/ahci_seattle.c
drivers/ata/ahci_seattle.c
+210
-0
drivers/ata/libahci.c
drivers/ata/libahci.c
+1
-0
未找到文件。
Documentation/devicetree/bindings/ata/ahci-platform.txt
浏览文件 @
f8d1a939
...
...
@@ -32,6 +32,10 @@ Optional properties:
- target-supply : regulator for SATA target power
- phys : reference to the SATA PHY node
- phy-names : must be "sata-phy"
- ports-implemented : Mask that indicates which ports that the HBA supports
are available for software to use. Useful if PORTS_IMPL
is not programmed by the BIOS, which is true with
some embedded SOC's.
Required properties when using sub-nodes:
- #address-cells : number of cells to encode an address
...
...
arch/arm/boot/dts/qcom-apq8064.dtsi
浏览文件 @
f8d1a939
...
...
@@ -666,7 +666,7 @@
};
sata0
:
sata
@
29000000
{
compatible
=
"generic-ahci"
;
compatible
=
"
qcom,apq8064-ahci"
,
"
generic-ahci"
;
status
=
"disabled"
;
reg
=
<
0x29000000
0x180
>;
interrupts
=
<
GIC_SPI
209
IRQ_TYPE_NONE
>;
...
...
@@ -688,6 +688,7 @@
phys
=
<&
sata_phy0
>;
phy
-
names
=
"sata-phy"
;
ports
-
implemented
=
<
0x1
>;
};
/*
Temporary
fixed
regulator
*/
...
...
drivers/ata/Kconfig
浏览文件 @
f8d1a939
...
...
@@ -202,6 +202,14 @@ config SATA_FSL
If unsure, say N.
config SATA_AHCI_SEATTLE
tristate "AMD Seattle 6.0Gbps AHCI SATA host controller support"
depends on ARCH_SEATTLE
help
This option enables support for AMD Seattle SATA host controller.
If unsure, say N
config SATA_INIC162X
tristate "Initio 162x SATA support (Very Experimental)"
depends on PCI
...
...
drivers/ata/Makefile
浏览文件 @
f8d1a939
...
...
@@ -4,6 +4,7 @@ obj-$(CONFIG_ATA) += libata.o
# non-SFF interface
obj-$(CONFIG_SATA_AHCI)
+=
ahci.o libahci.o
obj-$(CONFIG_SATA_ACARD_AHCI)
+=
acard-ahci.o libahci.o
obj-$(CONFIG_SATA_AHCI_SEATTLE)
+=
ahci_seattle.o libahci.o libahci_platform.o
obj-$(CONFIG_SATA_AHCI_PLATFORM)
+=
ahci_platform.o libahci.o libahci_platform.o
obj-$(CONFIG_SATA_FSL)
+=
sata_fsl.o
obj-$(CONFIG_SATA_INIC162X)
+=
sata_inic162x.o
...
...
drivers/ata/ahci_platform.c
浏览文件 @
f8d1a939
...
...
@@ -51,6 +51,9 @@ static int ahci_probe(struct platform_device *pdev)
if
(
rc
)
return
rc
;
of_property_read_u32
(
dev
->
of_node
,
"ports-implemented"
,
&
hpriv
->
force_port_map
);
if
(
of_device_is_compatible
(
dev
->
of_node
,
"hisilicon,hisi-ahci"
))
hpriv
->
flags
|=
AHCI_HFLAG_NO_FBS
|
AHCI_HFLAG_NO_NCQ
;
...
...
drivers/ata/ahci_seattle.c
0 → 100644
浏览文件 @
f8d1a939
/*
* AMD Seattle AHCI SATA driver
*
* Copyright (c) 2015, Advanced Micro Devices
* Author: Brijesh Singh <brijesh.singh@amd.com>
*
* based on the AHCI SATA platform driver by Jeff Garzik and Anton Vorontsov
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pm.h>
#include <linux/device.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/libata.h>
#include <linux/ahci_platform.h>
#include <linux/acpi.h>
#include <linux/pci_ids.h>
#include "ahci.h"
/* SGPIO Control Register definition
*
* Bit Type Description
* 31 RW OD7.2 (activity)
* 30 RW OD7.1 (locate)
* 29 RW OD7.0 (fault)
* 28...8 RW OD6.2...OD0.0 (3bits per port, 1 bit per LED)
* 7 RO SGPIO feature flag
* 6:4 RO Reserved
* 3:0 RO Number of ports (0 means no port supported)
*/
#define ACTIVITY_BIT_POS(x) (8 + (3 * x))
#define LOCATE_BIT_POS(x) (ACTIVITY_BIT_POS(x) + 1)
#define FAULT_BIT_POS(x) (LOCATE_BIT_POS(x) + 1)
#define ACTIVITY_MASK 0x00010000
#define LOCATE_MASK 0x00080000
#define FAULT_MASK 0x00400000
#define DRV_NAME "ahci-seattle"
static
ssize_t
seattle_transmit_led_message
(
struct
ata_port
*
ap
,
u32
state
,
ssize_t
size
);
struct
seattle_plat_data
{
void
__iomem
*
sgpio_ctrl
;
};
static
struct
ata_port_operations
ahci_port_ops
=
{
.
inherits
=
&
ahci_ops
,
};
static
const
struct
ata_port_info
ahci_port_info
=
{
.
flags
=
AHCI_FLAG_COMMON
,
.
pio_mask
=
ATA_PIO4
,
.
udma_mask
=
ATA_UDMA6
,
.
port_ops
=
&
ahci_port_ops
,
};
static
struct
ata_port_operations
ahci_seattle_ops
=
{
.
inherits
=
&
ahci_ops
,
.
transmit_led_message
=
seattle_transmit_led_message
,
};
static
const
struct
ata_port_info
ahci_port_seattle_info
=
{
.
flags
=
AHCI_FLAG_COMMON
|
ATA_FLAG_EM
|
ATA_FLAG_SW_ACTIVITY
,
.
link_flags
=
ATA_LFLAG_SW_ACTIVITY
,
.
pio_mask
=
ATA_PIO4
,
.
udma_mask
=
ATA_UDMA6
,
.
port_ops
=
&
ahci_seattle_ops
,
};
static
struct
scsi_host_template
ahci_platform_sht
=
{
AHCI_SHT
(
DRV_NAME
),
};
static
ssize_t
seattle_transmit_led_message
(
struct
ata_port
*
ap
,
u32
state
,
ssize_t
size
)
{
struct
ahci_host_priv
*
hpriv
=
ap
->
host
->
private_data
;
struct
ahci_port_priv
*
pp
=
ap
->
private_data
;
struct
seattle_plat_data
*
plat_data
=
hpriv
->
plat_data
;
unsigned
long
flags
;
int
pmp
;
struct
ahci_em_priv
*
emp
;
u32
val
;
/* get the slot number from the message */
pmp
=
(
state
&
EM_MSG_LED_PMP_SLOT
)
>>
8
;
if
(
pmp
>=
EM_MAX_SLOTS
)
return
-
EINVAL
;
emp
=
&
pp
->
em_priv
[
pmp
];
val
=
ioread32
(
plat_data
->
sgpio_ctrl
);
if
(
state
&
ACTIVITY_MASK
)
val
|=
1
<<
ACTIVITY_BIT_POS
((
ap
->
port_no
));
else
val
&=
~
(
1
<<
ACTIVITY_BIT_POS
((
ap
->
port_no
)));
if
(
state
&
LOCATE_MASK
)
val
|=
1
<<
LOCATE_BIT_POS
((
ap
->
port_no
));
else
val
&=
~
(
1
<<
LOCATE_BIT_POS
((
ap
->
port_no
)));
if
(
state
&
FAULT_MASK
)
val
|=
1
<<
FAULT_BIT_POS
((
ap
->
port_no
));
else
val
&=
~
(
1
<<
FAULT_BIT_POS
((
ap
->
port_no
)));
iowrite32
(
val
,
plat_data
->
sgpio_ctrl
);
spin_lock_irqsave
(
ap
->
lock
,
flags
);
/* save off new led state for port/slot */
emp
->
led_state
=
state
;
spin_unlock_irqrestore
(
ap
->
lock
,
flags
);
return
size
;
}
static
const
struct
ata_port_info
*
ahci_seattle_get_port_info
(
struct
platform_device
*
pdev
,
struct
ahci_host_priv
*
hpriv
)
{
struct
device
*
dev
=
&
pdev
->
dev
;
struct
seattle_plat_data
*
plat_data
;
u32
val
;
plat_data
=
devm_kzalloc
(
dev
,
sizeof
(
*
plat_data
),
GFP_KERNEL
);
if
(
IS_ERR
(
plat_data
))
return
&
ahci_port_info
;
plat_data
->
sgpio_ctrl
=
devm_ioremap_resource
(
dev
,
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
1
));
if
(
IS_ERR
(
plat_data
->
sgpio_ctrl
))
return
&
ahci_port_info
;
val
=
ioread32
(
plat_data
->
sgpio_ctrl
);
if
(
!
(
val
&
0xf
))
return
&
ahci_port_info
;
hpriv
->
em_loc
=
0
;
hpriv
->
em_buf_sz
=
4
;
hpriv
->
em_msg_type
=
EM_MSG_TYPE_LED
;
hpriv
->
plat_data
=
plat_data
;
dev_info
(
dev
,
"SGPIO LED control is enabled.
\n
"
);
return
&
ahci_port_seattle_info
;
}
static
int
ahci_seattle_probe
(
struct
platform_device
*
pdev
)
{
int
rc
;
struct
ahci_host_priv
*
hpriv
;
hpriv
=
ahci_platform_get_resources
(
pdev
);
if
(
IS_ERR
(
hpriv
))
return
PTR_ERR
(
hpriv
);
rc
=
ahci_platform_enable_resources
(
hpriv
);
if
(
rc
)
return
rc
;
rc
=
ahci_platform_init_host
(
pdev
,
hpriv
,
ahci_seattle_get_port_info
(
pdev
,
hpriv
),
&
ahci_platform_sht
);
if
(
rc
)
goto
disable_resources
;
return
0
;
disable_resources:
ahci_platform_disable_resources
(
hpriv
);
return
rc
;
}
static
SIMPLE_DEV_PM_OPS
(
ahci_pm_ops
,
ahci_platform_suspend
,
ahci_platform_resume
);
static
const
struct
acpi_device_id
ahci_acpi_match
[]
=
{
{
"AMDI0600"
,
0
},
{}
};
MODULE_DEVICE_TABLE
(
acpi
,
ahci_acpi_match
);
static
struct
platform_driver
ahci_seattle_driver
=
{
.
probe
=
ahci_seattle_probe
,
.
remove
=
ata_platform_remove_one
,
.
driver
=
{
.
name
=
DRV_NAME
,
.
acpi_match_table
=
ahci_acpi_match
,
.
pm
=
&
ahci_pm_ops
,
},
};
module_platform_driver
(
ahci_seattle_driver
);
MODULE_DESCRIPTION
(
"Seattle AHCI SATA platform driver"
);
MODULE_AUTHOR
(
"Brijesh Singh <brijesh.singh@amd.com>"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_ALIAS
(
"platform:"
DRV_NAME
);
drivers/ata/libahci.c
浏览文件 @
f8d1a939
...
...
@@ -507,6 +507,7 @@ void ahci_save_initial_config(struct device *dev, struct ahci_host_priv *hpriv)
dev_info
(
dev
,
"forcing port_map 0x%x -> 0x%x
\n
"
,
port_map
,
hpriv
->
force_port_map
);
port_map
=
hpriv
->
force_port_map
;
hpriv
->
saved_port_map
=
port_map
;
}
if
(
hpriv
->
mask_port_map
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录