diff options
author | Richard Zhu <r65037@freescale.com> | 2014-05-21 02:11:47 -0400 |
---|---|---|
committer | Richard Zhu <r65037@freescale.com> | 2014-05-26 01:18:35 -0400 |
commit | f64f01111d4fa3ec0a5fe6477be3a79ac1efef26 (patch) | |
tree | e2e40db329e771ca4537e81cfee51c13494f8395 | |
parent | c8b5258bf7cead5aa054bc87e5847bea8b136087 (diff) |
ENGR00314570-1 arm: add pcie power control on imx6sx
imx6sx pcie has standalone ldo domain, add the power
control routines on the ldo regulator call back.
Signed-off-by: Richard Zhu <r65037@freescale.com>
-rw-r--r-- | arch/arm/mach-imx/gpc.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c index add59a7ad3ab..da6409285c64 100644 --- a/arch/arm/mach-imx/gpc.c +++ b/arch/arm/mach-imx/gpc.c | |||
@@ -46,7 +46,10 @@ | |||
46 | #define GPC_PGC_CPU_SW2ISO_SHIFT 8 | 46 | #define GPC_PGC_CPU_SW2ISO_SHIFT 8 |
47 | #define GPC_PGC_CPU_SW2ISO_MASK 0x3f | 47 | #define GPC_PGC_CPU_SW2ISO_MASK 0x3f |
48 | #define GPC_CNTR 0x0 | 48 | #define GPC_CNTR 0x0 |
49 | #define GPC_CNTR_IPS_SHIFT 0x7 | 49 | #define GPC_CNTR_PCIE_PHY_PDU_SHIFT 0x7 |
50 | #define GPC_CNTR_PCIE_PHY_PDN_SHIFT 0x6 | ||
51 | #define PGC_PCIE_PHY_CTRL 0x200 | ||
52 | #define PGC_PCIE_PHY_PDN_EN 0x1 | ||
50 | #define GPC_CNTR_PU_UP_REQ_SHIFT 0x1 | 53 | #define GPC_CNTR_PU_UP_REQ_SHIFT 0x1 |
51 | #define GPC_CNTR_PU_DOWN_REQ_SHIFT 0x0 | 54 | #define GPC_CNTR_PU_DOWN_REQ_SHIFT 0x0 |
52 | 55 | ||
@@ -340,9 +343,15 @@ static int imx_pcie_regulator_notify(struct notifier_block *nb, | |||
340 | switch (event) { | 343 | switch (event) { |
341 | case REGULATOR_EVENT_VOLTAGE_CHANGE: | 344 | case REGULATOR_EVENT_VOLTAGE_CHANGE: |
342 | case REGULATOR_EVENT_ENABLE: | 345 | case REGULATOR_EVENT_ENABLE: |
343 | writel_relaxed(1 << GPC_CNTR_IPS_SHIFT, | 346 | writel_relaxed(1 << GPC_CNTR_PCIE_PHY_PDU_SHIFT, |
344 | gpc_base + GPC_CNTR); | 347 | gpc_base + GPC_CNTR); |
345 | break; | 348 | break; |
349 | case REGULATOR_EVENT_PRE_DISABLE: | ||
350 | writel_relaxed(1 << GPC_CNTR_PCIE_PHY_PDN_SHIFT, | ||
351 | gpc_base + GPC_CNTR); | ||
352 | writel_relaxed(PGC_PCIE_PHY_PDN_EN, | ||
353 | gpc_base + PGC_PCIE_PHY_CTRL); | ||
354 | break; | ||
346 | default: | 355 | default: |
347 | break; | 356 | break; |
348 | } | 357 | } |