Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
beaba77c
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
beaba77c
编写于
7月 03, 2017
作者:
B
Bjorn Helgaas
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'pci/host-imx6' into next
* pci/host-imx6: PCI: imx6: Add regulator support
上级
85e4b30a
c26ebe98
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
40 addition
and
1 deletion
+40
-1
Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
+4
-0
drivers/pci/dwc/pci-imx6.c
drivers/pci/dwc/pci-imx6.c
+36
-1
未找到文件。
Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
浏览文件 @
beaba77c
...
...
@@ -33,6 +33,10 @@ Optional properties:
- reset-gpio-active-high: If present then the reset sequence using the GPIO
specified in the "reset-gpio" property is reversed (H=reset state,
L=operation state).
- vpcie-supply: Should specify the regulator in charge of PCIe port power.
The regulator will be enabled when initializing the PCIe host and
disabled either as part of the init process or when shutting down the
host.
Additional required properties for imx6sx-pcie:
- clock names: Must include the following additional entries:
...
...
drivers/pci/dwc/pci-imx6.c
浏览文件 @
beaba77c
...
...
@@ -24,6 +24,7 @@
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/resource.h>
#include <linux/signal.h>
#include <linux/types.h>
...
...
@@ -59,6 +60,7 @@ struct imx6_pcie {
u32
tx_swing_full
;
u32
tx_swing_low
;
int
link_gen
;
struct
regulator
*
vpcie
;
};
/* Parameters for the waiting for PCIe PHY PLL to lock on i.MX7 */
...
...
@@ -284,6 +286,8 @@ static int imx6q_pcie_abort_handler(unsigned long addr,
static
void
imx6_pcie_assert_core_reset
(
struct
imx6_pcie
*
imx6_pcie
)
{
struct
device
*
dev
=
imx6_pcie
->
pci
->
dev
;
switch
(
imx6_pcie
->
variant
)
{
case
IMX7D
:
reset_control_assert
(
imx6_pcie
->
pciephy_reset
);
...
...
@@ -310,6 +314,14 @@ static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie)
IMX6Q_GPR1_PCIE_REF_CLK_EN
,
0
<<
16
);
break
;
}
if
(
imx6_pcie
->
vpcie
&&
regulator_is_enabled
(
imx6_pcie
->
vpcie
)
>
0
)
{
int
ret
=
regulator_disable
(
imx6_pcie
->
vpcie
);
if
(
ret
)
dev_err
(
dev
,
"failed to disable vpcie regulator: %d
\n
"
,
ret
);
}
}
static
int
imx6_pcie_enable_ref_clk
(
struct
imx6_pcie
*
imx6_pcie
)
...
...
@@ -376,10 +388,19 @@ static void imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie)
struct
device
*
dev
=
pci
->
dev
;
int
ret
;
if
(
imx6_pcie
->
vpcie
&&
!
regulator_is_enabled
(
imx6_pcie
->
vpcie
))
{
ret
=
regulator_enable
(
imx6_pcie
->
vpcie
);
if
(
ret
)
{
dev_err
(
dev
,
"failed to enable vpcie regulator: %d
\n
"
,
ret
);
return
;
}
}
ret
=
clk_prepare_enable
(
imx6_pcie
->
pcie_phy
);
if
(
ret
)
{
dev_err
(
dev
,
"unable to enable pcie_phy clock
\n
"
);
return
;
goto
err_pcie_phy
;
}
ret
=
clk_prepare_enable
(
imx6_pcie
->
pcie_bus
);
...
...
@@ -439,6 +460,13 @@ static void imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie)
clk_disable_unprepare
(
imx6_pcie
->
pcie_bus
);
err_pcie_bus:
clk_disable_unprepare
(
imx6_pcie
->
pcie_phy
);
err_pcie_phy:
if
(
imx6_pcie
->
vpcie
&&
regulator_is_enabled
(
imx6_pcie
->
vpcie
)
>
0
)
{
ret
=
regulator_disable
(
imx6_pcie
->
vpcie
);
if
(
ret
)
dev_err
(
dev
,
"failed to disable vpcie regulator: %d
\n
"
,
ret
);
}
}
static
void
imx6_pcie_init_phy
(
struct
imx6_pcie
*
imx6_pcie
)
...
...
@@ -802,6 +830,13 @@ static int imx6_pcie_probe(struct platform_device *pdev)
if
(
ret
)
imx6_pcie
->
link_gen
=
1
;
imx6_pcie
->
vpcie
=
devm_regulator_get_optional
(
&
pdev
->
dev
,
"vpcie"
);
if
(
IS_ERR
(
imx6_pcie
->
vpcie
))
{
if
(
PTR_ERR
(
imx6_pcie
->
vpcie
)
==
-
EPROBE_DEFER
)
return
-
EPROBE_DEFER
;
imx6_pcie
->
vpcie
=
NULL
;
}
platform_set_drvdata
(
pdev
,
imx6_pcie
);
ret
=
imx6_add_pcie_port
(
imx6_pcie
,
pdev
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录