diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2012-12-13 13:40:13 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2012-12-13 13:40:13 -0500 |
commit | 241738bd51cb0efe58e6c570223153e970afe3ae (patch) | |
tree | 05263e1ec3fbd58cc4ba5ee69163612fbb769a4a /arch/mips/pci/pci-bcm63xx.c | |
parent | bdf20507da11a9a5b32ef04fa09f352828189aef (diff) | |
parent | ce8f0d0607bcad3ec0e8599be80353204427093e (diff) |
Merge branch 'mips-next' of http://dev.phrozen.org/githttp/mips-next into mips-for-linux-next
Diffstat (limited to 'arch/mips/pci/pci-bcm63xx.c')
-rw-r--r-- | arch/mips/pci/pci-bcm63xx.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/arch/mips/pci/pci-bcm63xx.c b/arch/mips/pci/pci-bcm63xx.c index 8a48139d219c..ca179b6ff39b 100644 --- a/arch/mips/pci/pci-bcm63xx.c +++ b/arch/mips/pci/pci-bcm63xx.c | |||
@@ -11,8 +11,11 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
14 | #include <linux/clk.h> | ||
14 | #include <asm/bootinfo.h> | 15 | #include <asm/bootinfo.h> |
15 | 16 | ||
17 | #include <bcm63xx_reset.h> | ||
18 | |||
16 | #include "pci-bcm63xx.h" | 19 | #include "pci-bcm63xx.h" |
17 | 20 | ||
18 | /* | 21 | /* |
@@ -119,41 +122,36 @@ static void __init bcm63xx_reset_pcie(void) | |||
119 | { | 122 | { |
120 | u32 val; | 123 | u32 val; |
121 | 124 | ||
122 | /* enable clock */ | ||
123 | val = bcm_perf_readl(PERF_CKCTL_REG); | ||
124 | val |= CKCTL_6328_PCIE_EN; | ||
125 | bcm_perf_writel(val, PERF_CKCTL_REG); | ||
126 | |||
127 | /* enable SERDES */ | 125 | /* enable SERDES */ |
128 | val = bcm_misc_readl(MISC_SERDES_CTRL_REG); | 126 | val = bcm_misc_readl(MISC_SERDES_CTRL_REG); |
129 | val |= SERDES_PCIE_EN | SERDES_PCIE_EXD_EN; | 127 | val |= SERDES_PCIE_EN | SERDES_PCIE_EXD_EN; |
130 | bcm_misc_writel(val, MISC_SERDES_CTRL_REG); | 128 | bcm_misc_writel(val, MISC_SERDES_CTRL_REG); |
131 | 129 | ||
132 | /* reset the PCIe core */ | 130 | /* reset the PCIe core */ |
133 | val = bcm_perf_readl(PERF_SOFTRESET_6328_REG); | 131 | bcm63xx_core_set_reset(BCM63XX_RESET_PCIE, 1); |
134 | 132 | bcm63xx_core_set_reset(BCM63XX_RESET_PCIE_EXT, 1); | |
135 | val &= ~SOFTRESET_6328_PCIE_MASK; | ||
136 | val &= ~SOFTRESET_6328_PCIE_CORE_MASK; | ||
137 | val &= ~SOFTRESET_6328_PCIE_HARD_MASK; | ||
138 | val &= ~SOFTRESET_6328_PCIE_EXT_MASK; | ||
139 | bcm_perf_writel(val, PERF_SOFTRESET_6328_REG); | ||
140 | mdelay(10); | 133 | mdelay(10); |
141 | 134 | ||
142 | val |= SOFTRESET_6328_PCIE_MASK; | 135 | bcm63xx_core_set_reset(BCM63XX_RESET_PCIE, 0); |
143 | val |= SOFTRESET_6328_PCIE_CORE_MASK; | ||
144 | val |= SOFTRESET_6328_PCIE_HARD_MASK; | ||
145 | bcm_perf_writel(val, PERF_SOFTRESET_6328_REG); | ||
146 | mdelay(10); | 136 | mdelay(10); |
147 | 137 | ||
148 | val |= SOFTRESET_6328_PCIE_EXT_MASK; | 138 | bcm63xx_core_set_reset(BCM63XX_RESET_PCIE_EXT, 0); |
149 | bcm_perf_writel(val, PERF_SOFTRESET_6328_REG); | ||
150 | mdelay(200); | 139 | mdelay(200); |
151 | } | 140 | } |
152 | 141 | ||
142 | static struct clk *pcie_clk; | ||
143 | |||
153 | static int __init bcm63xx_register_pcie(void) | 144 | static int __init bcm63xx_register_pcie(void) |
154 | { | 145 | { |
155 | u32 val; | 146 | u32 val; |
156 | 147 | ||
148 | /* enable clock */ | ||
149 | pcie_clk = clk_get(NULL, "pcie"); | ||
150 | if (IS_ERR_OR_NULL(pcie_clk)) | ||
151 | return -ENODEV; | ||
152 | |||
153 | clk_prepare_enable(pcie_clk); | ||
154 | |||
157 | bcm63xx_reset_pcie(); | 155 | bcm63xx_reset_pcie(); |
158 | 156 | ||
159 | /* configure the PCIe bridge */ | 157 | /* configure the PCIe bridge */ |