driver_chipcommon.c (d8a382d2662822248a97ce9d670b90e68aefbd3a) | driver_chipcommon.c (9d1ac34ec3a67713308ae0883c3359c557f14d17) |
---|---|
1/* 2 * Sonics Silicon Backplane 3 * Broadcom ChipCommon core driver 4 * 5 * Copyright 2005, Broadcom Corporation 6 * Copyright 2006, 2007, Michael Buesch <mb@bu3sch.de> 7 * 8 * Licensed under the GNU/GPL. See COPYING for details. --- 195 unchanged lines hidden (view full) --- 204 maxfreq = chipco_pctl_clockfreqlimit(cc, 1); 205 chipco_write32(cc, SSB_CHIPCO_PLLONDELAY, 206 (maxfreq * 150 + 999999) / 1000000); 207 chipco_write32(cc, SSB_CHIPCO_FREFSELDELAY, 208 (maxfreq * 15 + 999999) / 1000000); 209 } 210} 211 | 1/* 2 * Sonics Silicon Backplane 3 * Broadcom ChipCommon core driver 4 * 5 * Copyright 2005, Broadcom Corporation 6 * Copyright 2006, 2007, Michael Buesch <mb@bu3sch.de> 7 * 8 * Licensed under the GNU/GPL. See COPYING for details. --- 195 unchanged lines hidden (view full) --- 204 maxfreq = chipco_pctl_clockfreqlimit(cc, 1); 205 chipco_write32(cc, SSB_CHIPCO_PLLONDELAY, 206 (maxfreq * 150 + 999999) / 1000000); 207 chipco_write32(cc, SSB_CHIPCO_FREFSELDELAY, 208 (maxfreq * 15 + 999999) / 1000000); 209 } 210} 211 |
212/* http://bcm-v4.sipsolutions.net/802.11/PmuFastPwrupDelay */ 213static u16 pmu_fast_powerup_delay(struct ssb_chipcommon *cc) 214{ 215 struct ssb_bus *bus = cc->dev->bus; 216 217 switch (bus->chip_id) { 218 case 0x4312: 219 case 0x4322: 220 case 0x4328: 221 return 7000; 222 case 0x4325: 223 /* TODO: */ 224 default: 225 return 15000; 226 } 227} 228 229/* http://bcm-v4.sipsolutions.net/802.11/ClkctlFastPwrupDelay */ |
|
212static void calc_fast_powerup_delay(struct ssb_chipcommon *cc) 213{ 214 struct ssb_bus *bus = cc->dev->bus; 215 int minfreq; 216 unsigned int tmp; 217 u32 pll_on_delay; 218 219 if (bus->bustype != SSB_BUSTYPE_PCI) 220 return; | 230static void calc_fast_powerup_delay(struct ssb_chipcommon *cc) 231{ 232 struct ssb_bus *bus = cc->dev->bus; 233 int minfreq; 234 unsigned int tmp; 235 u32 pll_on_delay; 236 237 if (bus->bustype != SSB_BUSTYPE_PCI) 238 return; |
239 240 if (cc->capabilities & SSB_CHIPCO_CAP_PMU) { 241 cc->fast_pwrup_delay = pmu_fast_powerup_delay(cc); 242 return; 243 } 244 |
|
221 if (!(cc->capabilities & SSB_CHIPCO_CAP_PCTL)) 222 return; 223 224 minfreq = chipco_pctl_clockfreqlimit(cc, 0); 225 pll_on_delay = chipco_read32(cc, SSB_CHIPCO_PLLONDELAY); 226 tmp = (((pll_on_delay + 2) * 1000000) + (minfreq - 1)) / minfreq; 227 SSB_WARN_ON(tmp & ~0xFFFF); 228 229 cc->fast_pwrup_delay = tmp; 230} 231 232void ssb_chipcommon_init(struct ssb_chipcommon *cc) 233{ 234 if (!cc->dev) 235 return; /* We don't have a ChipCommon */ 236 if (cc->dev->id.revision >= 11) 237 cc->status = chipco_read32(cc, SSB_CHIPCO_CHIPSTAT); | 245 if (!(cc->capabilities & SSB_CHIPCO_CAP_PCTL)) 246 return; 247 248 minfreq = chipco_pctl_clockfreqlimit(cc, 0); 249 pll_on_delay = chipco_read32(cc, SSB_CHIPCO_PLLONDELAY); 250 tmp = (((pll_on_delay + 2) * 1000000) + (minfreq - 1)) / minfreq; 251 SSB_WARN_ON(tmp & ~0xFFFF); 252 253 cc->fast_pwrup_delay = tmp; 254} 255 256void ssb_chipcommon_init(struct ssb_chipcommon *cc) 257{ 258 if (!cc->dev) 259 return; /* We don't have a ChipCommon */ 260 if (cc->dev->id.revision >= 11) 261 cc->status = chipco_read32(cc, SSB_CHIPCO_CHIPSTAT); |
262 ssb_dprintk(KERN_INFO PFX "chipcommon status is 0x%x\n", cc->status); |
|
238 ssb_pmu_init(cc); 239 chipco_powercontrol_init(cc); 240 ssb_chipco_set_clockmode(cc, SSB_CLKMODE_FAST); 241 calc_fast_powerup_delay(cc); 242} 243 244void ssb_chipco_suspend(struct ssb_chipcommon *cc) 245{ --- 244 unchanged lines hidden --- | 263 ssb_pmu_init(cc); 264 chipco_powercontrol_init(cc); 265 ssb_chipco_set_clockmode(cc, SSB_CLKMODE_FAST); 266 calc_fast_powerup_delay(cc); 267} 268 269void ssb_chipco_suspend(struct ssb_chipcommon *cc) 270{ --- 244 unchanged lines hidden --- |