aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm63xx/clk.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/bcm63xx/clk.c')
-rw-r--r--arch/mips/bcm63xx/clk.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c
index 660121434d7f..c726a97fc798 100644
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
@@ -125,11 +125,18 @@ static struct clk clk_ephy = {
125 */ 125 */
126static void enetsw_set(struct clk *clk, int enable) 126static void enetsw_set(struct clk *clk, int enable)
127{ 127{
128 if (!BCMCPU_IS_6368()) 128 if (BCMCPU_IS_6328())
129 bcm_hwclock_set(CKCTL_6328_ROBOSW_EN, enable);
130 else if (BCMCPU_IS_6362())
131 bcm_hwclock_set(CKCTL_6362_ROBOSW_EN, enable);
132 else if (BCMCPU_IS_6368())
133 bcm_hwclock_set(CKCTL_6368_ROBOSW_EN |
134 CKCTL_6368_SWPKT_USB_EN |
135 CKCTL_6368_SWPKT_SAR_EN,
136 enable);
137 else
129 return; 138 return;
130 bcm_hwclock_set(CKCTL_6368_ROBOSW_EN | 139
131 CKCTL_6368_SWPKT_USB_EN |
132 CKCTL_6368_SWPKT_SAR_EN, enable);
133 if (enable) { 140 if (enable) {
134 /* reset switch core afer clock change */ 141 /* reset switch core afer clock change */
135 bcm63xx_core_set_reset(BCM63XX_RESET_ENETSW, 1); 142 bcm63xx_core_set_reset(BCM63XX_RESET_ENETSW, 1);
@@ -166,6 +173,8 @@ static void usbh_set(struct clk *clk, int enable)
166 bcm_hwclock_set(CKCTL_6328_USBH_EN, enable); 173 bcm_hwclock_set(CKCTL_6328_USBH_EN, enable);
167 else if (BCMCPU_IS_6348()) 174 else if (BCMCPU_IS_6348())
168 bcm_hwclock_set(CKCTL_6348_USBH_EN, enable); 175 bcm_hwclock_set(CKCTL_6348_USBH_EN, enable);
176 else if (BCMCPU_IS_6362())
177 bcm_hwclock_set(CKCTL_6362_USBH_EN, enable);
169 else if (BCMCPU_IS_6368()) 178 else if (BCMCPU_IS_6368())
170 bcm_hwclock_set(CKCTL_6368_USBH_EN, enable); 179 bcm_hwclock_set(CKCTL_6368_USBH_EN, enable);
171} 180}
@@ -181,6 +190,8 @@ static void usbd_set(struct clk *clk, int enable)
181{ 190{
182 if (BCMCPU_IS_6328()) 191 if (BCMCPU_IS_6328())
183 bcm_hwclock_set(CKCTL_6328_USBD_EN, enable); 192 bcm_hwclock_set(CKCTL_6328_USBD_EN, enable);
193 else if (BCMCPU_IS_6362())
194 bcm_hwclock_set(CKCTL_6362_USBD_EN, enable);
184 else if (BCMCPU_IS_6368()) 195 else if (BCMCPU_IS_6368())
185 bcm_hwclock_set(CKCTL_6368_USBD_EN, enable); 196 bcm_hwclock_set(CKCTL_6368_USBD_EN, enable);
186} 197}
@@ -244,7 +255,10 @@ static struct clk clk_xtm = {
244 */ 255 */
245static void ipsec_set(struct clk *clk, int enable) 256static void ipsec_set(struct clk *clk, int enable)
246{ 257{
247 bcm_hwclock_set(CKCTL_6368_IPSEC_EN, enable); 258 if (BCMCPU_IS_6362())
259 bcm_hwclock_set(CKCTL_6362_IPSEC_EN, enable);
260 else if (BCMCPU_IS_6368())
261 bcm_hwclock_set(CKCTL_6368_IPSEC_EN, enable);
248} 262}
249 263
250static struct clk clk_ipsec = { 264static struct clk clk_ipsec = {
@@ -257,7 +271,10 @@ static struct clk clk_ipsec = {
257 271
258static void pcie_set(struct clk *clk, int enable) 272static void pcie_set(struct clk *clk, int enable)
259{ 273{
260 bcm_hwclock_set(CKCTL_6328_PCIE_EN, enable); 274 if (BCMCPU_IS_6328())
275 bcm_hwclock_set(CKCTL_6328_PCIE_EN, enable);
276 else if (BCMCPU_IS_6362())
277 bcm_hwclock_set(CKCTL_6362_PCIE_EN, enable);
261} 278}
262 279
263static struct clk clk_pcie = { 280static struct clk clk_pcie = {
@@ -323,9 +340,9 @@ struct clk *clk_get(struct device *dev, const char *id)
323 return &clk_periph; 340 return &clk_periph;
324 if (BCMCPU_IS_6358() && !strcmp(id, "pcm")) 341 if (BCMCPU_IS_6358() && !strcmp(id, "pcm"))
325 return &clk_pcm; 342 return &clk_pcm;
326 if (BCMCPU_IS_6368() && !strcmp(id, "ipsec")) 343 if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec"))
327 return &clk_ipsec; 344 return &clk_ipsec;
328 if (BCMCPU_IS_6328() && !strcmp(id, "pcie")) 345 if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie"))
329 return &clk_pcie; 346 return &clk_pcie;
330 return ERR_PTR(-ENOENT); 347 return ERR_PTR(-ENOENT);
331} 348}