/linux-4.4.14/drivers/net/wireless/ath/wil6210/ |
H A D | pmc.c | 23 #include "pmc.h" 30 static int wil_is_pmc_allocated(struct pmc_ctx *pmc) wil_is_pmc_allocated() argument 32 return !!pmc->pring_va; wil_is_pmc_allocated() 37 memset(&wil->pmc, 0, sizeof(struct pmc_ctx)); wil_pmc_init() 38 mutex_init(&wil->pmc.lock); wil_pmc_init() 44 * Initialize the descriptors as required by pmc dma. 54 struct pmc_ctx *pmc = &wil->pmc; wil_pmc_alloc() local 58 mutex_lock(&pmc->lock); wil_pmc_alloc() 60 if (wil_is_pmc_allocated(pmc)) { wil_pmc_alloc() 62 wil_err(wil, "%s: ERROR pmc is already allocated\n", __func__); wil_pmc_alloc() 66 pmc->num_descriptors = num_descriptors; wil_pmc_alloc() 67 pmc->descriptor_size = descriptor_size; wil_pmc_alloc() 72 /* allocate descriptors info list in pmc context*/ wil_pmc_alloc() 73 pmc->descriptors = kcalloc(num_descriptors, wil_pmc_alloc() 76 if (!pmc->descriptors) { wil_pmc_alloc() 77 wil_err(wil, "%s: ERROR allocating pmc skb list\n", __func__); wil_pmc_alloc() 83 __func__, pmc->descriptors); wil_pmc_alloc() 89 pmc->pring_va = dma_alloc_coherent(dev, wil_pmc_alloc() 91 &pmc->pring_pa, wil_pmc_alloc() 97 pmc->pring_va, &pmc->pring_pa, wil_pmc_alloc() 102 if (!pmc->pring_va) { wil_pmc_alloc() 103 wil_err(wil, "%s: ERROR allocating pmc pring\n", __func__); wil_pmc_alloc() 112 struct vring_tx_desc *_d = &pmc->pring_va[i]; wil_pmc_alloc() 116 pmc->descriptors[i].va = dma_alloc_coherent(dev, wil_pmc_alloc() 118 &pmc->descriptors[i].pa, wil_pmc_alloc() 121 if (unlikely(!pmc->descriptors[i].va)) { wil_pmc_alloc() 123 "%s: ERROR allocating pmc descriptor %d", wil_pmc_alloc() 129 u32 *p = (u32 *)pmc->descriptors[i].va + j; wil_pmc_alloc() 135 cpu_to_le32(lower_32_bits(pmc->descriptors[i].pa)); wil_pmc_alloc() 137 cpu_to_le16((u16)upper_32_bits(pmc->descriptors[i].pa)); wil_pmc_alloc() 147 pmc_cmd.ring_size = cpu_to_le16(pmc->num_descriptors); wil_pmc_alloc() 148 pmc_cmd.mem_base = cpu_to_le64(pmc->pring_pa); wil_pmc_alloc() 151 pmc->last_cmd_status = wmi_send(wil, wil_pmc_alloc() 155 if (pmc->last_cmd_status) { wil_pmc_alloc() 158 __func__, pmc->last_cmd_status); wil_pmc_alloc() 162 mutex_unlock(&pmc->lock); wil_pmc_alloc() 168 for (i = 0; pmc->descriptors[i].va && i < num_descriptors; i++) { wil_pmc_alloc() 171 pmc->descriptors[i].va, wil_pmc_alloc() 172 pmc->descriptors[i].pa); wil_pmc_alloc() 174 pmc->descriptors[i].va = NULL; wil_pmc_alloc() 180 pmc->pring_va, wil_pmc_alloc() 181 pmc->pring_pa); wil_pmc_alloc() 183 pmc->pring_va = NULL; wil_pmc_alloc() 188 kfree(pmc->descriptors); wil_pmc_alloc() 189 pmc->descriptors = NULL; wil_pmc_alloc() 192 pmc->last_cmd_status = -ENOMEM; wil_pmc_alloc() 193 mutex_unlock(&pmc->lock); wil_pmc_alloc() 202 struct pmc_ctx *pmc = &wil->pmc; wil_pmc_free() local 206 mutex_lock(&pmc->lock); wil_pmc_free() 208 pmc->last_cmd_status = 0; wil_pmc_free() 210 if (!wil_is_pmc_allocated(pmc)) { wil_pmc_free() 213 pmc->last_cmd_status = -EPERM; wil_pmc_free() 214 mutex_unlock(&pmc->lock); wil_pmc_free() 222 pmc->last_cmd_status = wil_pmc_free() 225 if (pmc->last_cmd_status) { wil_pmc_free() 228 __func__, pmc->last_cmd_status); wil_pmc_free() 231 * Continue to freeing all memory allocated for pmc. wil_pmc_free() 236 if (pmc->pring_va) { wil_pmc_free() 238 pmc->num_descriptors; wil_pmc_free() 241 __func__, pmc->pring_va); wil_pmc_free() 242 dma_free_coherent(dev, buf_size, pmc->pring_va, pmc->pring_pa); wil_pmc_free() 244 pmc->pring_va = NULL; wil_pmc_free() 246 pmc->last_cmd_status = -ENOENT; wil_pmc_free() 249 if (pmc->descriptors) { wil_pmc_free() 253 pmc->descriptors[i].va && i < pmc->num_descriptors; i++) { wil_pmc_free() 255 pmc->descriptor_size, wil_pmc_free() 256 pmc->descriptors[i].va, wil_pmc_free() 257 pmc->descriptors[i].pa); wil_pmc_free() 258 pmc->descriptors[i].va = NULL; wil_pmc_free() 261 __func__, i, pmc->num_descriptors); wil_pmc_free() 263 "%s: free pmc descriptors info list %p\n", wil_pmc_free() 264 __func__, pmc->descriptors); wil_pmc_free() 265 kfree(pmc->descriptors); wil_pmc_free() 266 pmc->descriptors = NULL; wil_pmc_free() 268 pmc->last_cmd_status = -ENOENT; wil_pmc_free() 271 mutex_unlock(&pmc->lock); wil_pmc_free() 281 wil->pmc.last_cmd_status); wil_pmc_last_cmd_status() 283 return wil->pmc.last_cmd_status; wil_pmc_last_cmd_status() 294 struct pmc_ctx *pmc = &wil->pmc; wil_pmc_read() local 298 size_t pmc_size = pmc->descriptor_size * pmc->num_descriptors; wil_pmc_read() 300 mutex_lock(&pmc->lock); wil_pmc_read() 302 if (!wil_is_pmc_allocated(pmc)) { wil_pmc_read() 303 wil_err(wil, "%s: error, pmc is not allocated!\n", __func__); wil_pmc_read() 304 pmc->last_cmd_status = -EPERM; wil_pmc_read() 305 mutex_unlock(&pmc->lock); wil_pmc_read() 313 pmc->last_cmd_status = 0; wil_pmc_read() 316 do_div(idx, pmc->descriptor_size); wil_pmc_read() 317 offset = *f_pos - (idx * pmc->descriptor_size); wil_pmc_read() 320 wil_dbg_misc(wil, "%s: reached end of pmc buf: %lld >= %u\n", wil_pmc_read() 322 pmc->last_cmd_status = -ERANGE; wil_pmc_read() 334 pmc->descriptors[idx].va, wil_pmc_read() 335 pmc->descriptor_size); wil_pmc_read() 338 mutex_unlock(&pmc->lock); wil_pmc_read() 347 struct pmc_ctx *pmc = &wil->pmc; wil_pmc_llseek() local 348 size_t pmc_size = pmc->descriptor_size * pmc->num_descriptors; wil_pmc_llseek()
|
H A D | Makefile | 16 wil6210-y += pmc.o
|
H A D | debugfs.c | 27 #include "pmc.h" 703 /* pmc control, write: 762 char help[] = "pmc control, write:\n" wil_read_pmccfg() 763 " - \"alloc <num descriptors> <descriptor_size>\" to allocate pmc\n" wil_read_pmccfg() 764 " - \"free\" to free memory allocated for pmc\n"; wil_read_pmccfg() 1546 /* free pmc memory without sending command to fw, as it will wil6210_debugfs_remove()
|
H A D | wil6210.h | 630 struct pmc_ctx pmc; member in struct:wil6210_priv
|
/linux-4.4.14/drivers/clk/at91/ |
H A D | pmc.h | 2 * drivers/clk/at91/pmc.h 39 static inline void pmc_lock(struct at91_pmc *pmc) pmc_lock() argument 41 spin_lock(&pmc->lock); pmc_lock() 44 static inline void pmc_unlock(struct at91_pmc *pmc) pmc_unlock() argument 46 spin_unlock(&pmc->lock); pmc_unlock() 49 static inline u32 pmc_read(struct at91_pmc *pmc, int offset) pmc_read() argument 51 return readl(pmc->regbase + offset); pmc_read() 54 static inline void pmc_write(struct at91_pmc *pmc, int offset, u32 value) pmc_write() argument 56 writel(value, pmc->regbase + offset); pmc_write() 63 struct at91_pmc *pmc); 66 struct at91_pmc *pmc); 68 struct at91_pmc *pmc); 70 struct at91_pmc *pmc); 72 struct at91_pmc *pmc); 75 struct at91_pmc *pmc); 77 struct at91_pmc *pmc); 79 struct at91_pmc *pmc); 81 struct at91_pmc *pmc); 83 struct at91_pmc *pmc); 86 struct at91_pmc *pmc); 88 struct at91_pmc *pmc); 91 struct at91_pmc *pmc); 94 struct at91_pmc *pmc); 96 struct at91_pmc *pmc); 99 struct at91_pmc *pmc); 101 struct at91_pmc *pmc); 103 struct at91_pmc *pmc); 106 struct at91_pmc *pmc); 109 struct at91_pmc *pmc); 111 struct at91_pmc *pmc); 113 struct at91_pmc *pmc); 116 struct at91_pmc *pmc); 119 struct at91_pmc *pmc); 122 struct at91_pmc *pmc);
|
H A D | clk-peripheral.c | 18 #include "pmc.h" 36 struct at91_pmc *pmc; member in struct:clk_peripheral 44 struct at91_pmc *pmc; member in struct:clk_sam9x5_peripheral 57 struct at91_pmc *pmc = periph->pmc; clk_peripheral_enable() local 65 pmc_write(pmc, offset, PERIPHERAL_MASK(id)); clk_peripheral_enable() 72 struct at91_pmc *pmc = periph->pmc; clk_peripheral_disable() local 80 pmc_write(pmc, offset, PERIPHERAL_MASK(id)); clk_peripheral_disable() 86 struct at91_pmc *pmc = periph->pmc; clk_peripheral_is_enabled() local 94 return !!(pmc_read(pmc, offset) & PERIPHERAL_MASK(id)); clk_peripheral_is_enabled() 104 at91_clk_register_peripheral(struct at91_pmc *pmc, const char *name, at91_clk_register_peripheral() argument 111 if (!pmc || !name || !parent_name || id > PERIPHERAL_ID_MAX) at91_clk_register_peripheral() 126 periph->pmc = pmc; at91_clk_register_peripheral() 163 struct at91_pmc *pmc = periph->pmc; clk_sam9x5_peripheral_enable() local 169 pmc_lock(pmc); clk_sam9x5_peripheral_enable() 170 pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); clk_sam9x5_peripheral_enable() 171 tmp = pmc_read(pmc, AT91_PMC_PCR) & ~AT91_PMC_PCR_DIV_MASK; clk_sam9x5_peripheral_enable() 172 pmc_write(pmc, AT91_PMC_PCR, tmp | AT91_PMC_PCR_DIV(periph->div) clk_sam9x5_peripheral_enable() 175 pmc_unlock(pmc); clk_sam9x5_peripheral_enable() 182 struct at91_pmc *pmc = periph->pmc; clk_sam9x5_peripheral_disable() local 188 pmc_lock(pmc); clk_sam9x5_peripheral_disable() 189 pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); clk_sam9x5_peripheral_disable() 190 tmp = pmc_read(pmc, AT91_PMC_PCR) & ~AT91_PMC_PCR_EN; clk_sam9x5_peripheral_disable() 191 pmc_write(pmc, AT91_PMC_PCR, tmp | AT91_PMC_PCR_CMD); clk_sam9x5_peripheral_disable() 192 pmc_unlock(pmc); clk_sam9x5_peripheral_disable() 198 struct at91_pmc *pmc = periph->pmc; clk_sam9x5_peripheral_is_enabled() local 204 pmc_lock(pmc); clk_sam9x5_peripheral_is_enabled() 205 pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); clk_sam9x5_peripheral_is_enabled() 206 ret = !!(pmc_read(pmc, AT91_PMC_PCR) & AT91_PMC_PCR_EN); clk_sam9x5_peripheral_is_enabled() 207 pmc_unlock(pmc); clk_sam9x5_peripheral_is_enabled() 217 struct at91_pmc *pmc = periph->pmc; clk_sam9x5_peripheral_recalc_rate() local 223 pmc_lock(pmc); clk_sam9x5_peripheral_recalc_rate() 224 pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); clk_sam9x5_peripheral_recalc_rate() 225 tmp = pmc_read(pmc, AT91_PMC_PCR); clk_sam9x5_peripheral_recalc_rate() 226 pmc_unlock(pmc); clk_sam9x5_peripheral_recalc_rate() 321 at91_clk_register_sam9x5_peripheral(struct at91_pmc *pmc, const char *name, at91_clk_register_sam9x5_peripheral() argument 329 if (!pmc || !name || !parent_name) at91_clk_register_sam9x5_peripheral() 345 periph->pmc = pmc; at91_clk_register_sam9x5_peripheral() 359 of_at91_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc, u8 type) of_at91_clk_periph_setup() argument 387 clk = at91_clk_register_peripheral(pmc, name, for_each_child_of_node() 396 clk = at91_clk_register_sam9x5_peripheral(pmc, name, for_each_child_of_node() 409 struct at91_pmc *pmc) of_at91rm9200_clk_periph_setup() 411 of_at91_clk_periph_setup(np, pmc, PERIPHERAL_AT91RM9200); of_at91rm9200_clk_periph_setup() 415 struct at91_pmc *pmc) of_at91sam9x5_clk_periph_setup() 417 of_at91_clk_periph_setup(np, pmc, PERIPHERAL_AT91SAM9X5); of_at91sam9x5_clk_periph_setup() 408 of_at91rm9200_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc) of_at91rm9200_clk_periph_setup() argument 414 of_at91sam9x5_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc) of_at91sam9x5_clk_periph_setup() argument
|
H A D | clk-usb.c | 18 #include "pmc.h" 30 struct at91_pmc *pmc; member in struct:at91sam9x5_clk_usb 38 struct at91_pmc *pmc; member in struct:at91rm9200_clk_usb 51 struct at91_pmc *pmc = usb->pmc; at91sam9x5_clk_usb_recalc_rate() local 53 tmp = pmc_read(pmc, AT91_PMC_USB); at91sam9x5_clk_usb_recalc_rate() 114 struct at91_pmc *pmc = usb->pmc; at91sam9x5_clk_usb_set_parent() local 118 tmp = pmc_read(pmc, AT91_PMC_USB) & ~AT91_PMC_USBS; at91sam9x5_clk_usb_set_parent() 121 pmc_write(pmc, AT91_PMC_USB, tmp); at91sam9x5_clk_usb_set_parent() 128 struct at91_pmc *pmc = usb->pmc; at91sam9x5_clk_usb_get_parent() local 130 return pmc_read(pmc, AT91_PMC_USB) & AT91_PMC_USBS; at91sam9x5_clk_usb_get_parent() 138 struct at91_pmc *pmc = usb->pmc; at91sam9x5_clk_usb_set_rate() local 148 tmp = pmc_read(pmc, AT91_PMC_USB) & ~AT91_PMC_OHCIUSBDIV; at91sam9x5_clk_usb_set_rate() 150 pmc_write(pmc, AT91_PMC_USB, tmp); at91sam9x5_clk_usb_set_rate() 166 struct at91_pmc *pmc = usb->pmc; at91sam9n12_clk_usb_enable() local 168 pmc_write(pmc, AT91_PMC_USB, at91sam9n12_clk_usb_enable() 169 pmc_read(pmc, AT91_PMC_USB) | AT91_PMC_USBS); at91sam9n12_clk_usb_enable() 176 struct at91_pmc *pmc = usb->pmc; at91sam9n12_clk_usb_disable() local 178 pmc_write(pmc, AT91_PMC_USB, at91sam9n12_clk_usb_disable() 179 pmc_read(pmc, AT91_PMC_USB) & ~AT91_PMC_USBS); at91sam9n12_clk_usb_disable() 185 struct at91_pmc *pmc = usb->pmc; at91sam9n12_clk_usb_is_enabled() local 187 return !!(pmc_read(pmc, AT91_PMC_USB) & AT91_PMC_USBS); at91sam9n12_clk_usb_is_enabled() 200 at91sam9x5_clk_register_usb(struct at91_pmc *pmc, const char *name, at91sam9x5_clk_register_usb() argument 219 usb->pmc = pmc; at91sam9x5_clk_register_usb() 229 at91sam9n12_clk_register_usb(struct at91_pmc *pmc, const char *name, at91sam9n12_clk_register_usb() argument 247 usb->pmc = pmc; at91sam9n12_clk_register_usb() 260 struct at91_pmc *pmc = usb->pmc; at91rm9200_clk_usb_recalc_rate() local 264 tmp = pmc_read(pmc, AT91_CKGR_PLLBR); at91rm9200_clk_usb_recalc_rate() 316 struct at91_pmc *pmc = usb->pmc; at91rm9200_clk_usb_set_rate() local 326 tmp = pmc_read(pmc, AT91_CKGR_PLLBR) & at91rm9200_clk_usb_set_rate() 329 pmc_write(pmc, AT91_CKGR_PLLBR, tmp); at91rm9200_clk_usb_set_rate() 344 at91rm9200_clk_register_usb(struct at91_pmc *pmc, const char *name, at91rm9200_clk_register_usb() argument 362 usb->pmc = pmc; at91rm9200_clk_register_usb() 373 struct at91_pmc *pmc) of_at91sam9x5_clk_usb_setup() 388 clk = at91sam9x5_clk_register_usb(pmc, name, parent_names, num_parents); of_at91sam9x5_clk_usb_setup() 396 struct at91_pmc *pmc) of_at91sam9n12_clk_usb_setup() 408 clk = at91sam9n12_clk_register_usb(pmc, name, parent_name); of_at91sam9n12_clk_usb_setup() 416 struct at91_pmc *pmc) of_at91rm9200_clk_usb_setup() 433 clk = at91rm9200_clk_register_usb(pmc, name, parent_name, divisors); of_at91rm9200_clk_usb_setup() 372 of_at91sam9x5_clk_usb_setup(struct device_node *np, struct at91_pmc *pmc) of_at91sam9x5_clk_usb_setup() argument 395 of_at91sam9n12_clk_usb_setup(struct device_node *np, struct at91_pmc *pmc) of_at91sam9n12_clk_usb_setup() argument 415 of_at91rm9200_clk_usb_setup(struct device_node *np, struct at91_pmc *pmc) of_at91rm9200_clk_usb_setup() argument
|
H A D | pmc.c | 25 #include "pmc.h" 70 struct at91_pmc *pmc = irq_data_get_irq_chip_data(d); pmc_irq_mask() local 72 pmc_write(pmc, AT91_PMC_IDR, 1 << d->hwirq); pmc_irq_mask() 77 struct at91_pmc *pmc = irq_data_get_irq_chip_data(d); pmc_irq_unmask() local 79 pmc_write(pmc, AT91_PMC_IER, 1 << d->hwirq); pmc_irq_unmask() 94 struct at91_pmc *pmc = irq_data_get_irq_chip_data(d); pmc_irq_suspend() local 96 pmc->imr = pmc_read(pmc, AT91_PMC_IMR); pmc_irq_suspend() 97 pmc_write(pmc, AT91_PMC_IDR, pmc->imr); pmc_irq_suspend() 102 struct at91_pmc *pmc = irq_data_get_irq_chip_data(d); pmc_irq_resume() local 104 pmc_write(pmc, AT91_PMC_IER, pmc->imr); pmc_irq_resume() 122 struct at91_pmc *pmc = h->host_data; pmc_irq_map() local 128 irq_set_chip_data(virq, pmc); pmc_irq_map() 139 struct at91_pmc *pmc = d->host_data; pmc_irq_domain_xlate() local 140 const struct at91_pmc_caps *caps = pmc->caps; pmc_irq_domain_xlate() 162 struct at91_pmc *pmc = (struct at91_pmc *)data; pmc_irq_handler() local 166 sr = pmc_read(pmc, AT91_PMC_SR) & pmc_read(pmc, AT91_PMC_IMR); pmc_irq_handler() 171 generic_handle_irq(irq_find_mapping(pmc->irqdomain, n)); pmc_irq_handler() 229 struct at91_pmc *pmc; at91_pmc_init() local 236 pmc = kzalloc(sizeof(*pmc), GFP_KERNEL); at91_pmc_init() 237 if (!pmc) at91_pmc_init() 240 spin_lock_init(&pmc->lock); at91_pmc_init() 241 pmc->regbase = regbase; at91_pmc_init() 242 pmc->virq = virq; at91_pmc_init() 243 pmc->caps = caps; at91_pmc_init() 245 pmc->irqdomain = irq_domain_add_linear(np, 32, &pmc_irq_ops, pmc); at91_pmc_init() 247 if (!pmc->irqdomain) at91_pmc_init() 250 pmc_write(pmc, AT91_PMC_IDR, 0xffffffff); at91_pmc_init() 251 if (request_irq(pmc->virq, pmc_irq_handler, at91_pmc_init() 252 IRQF_SHARED | IRQF_COND_SUSPEND, "pmc", pmc)) at91_pmc_init() 255 return pmc; at91_pmc_init() 258 irq_domain_remove(pmc->irqdomain); at91_pmc_init() 260 kfree(pmc); at91_pmc_init() 392 struct at91_pmc *pmc; of_at91_pmc_setup() local 406 pmc = at91_pmc_init(np, regbase, virq, caps); of_at91_pmc_setup() 407 if (!pmc) of_at91_pmc_setup() 414 clk_setup(childnp, pmc); for_each_child_of_node() 422 CLK_OF_DECLARE(at91rm9200_clk_pmc, "atmel,at91rm9200-pmc", 429 CLK_OF_DECLARE(at91sam9260_clk_pmc, "atmel,at91sam9260-pmc", 436 CLK_OF_DECLARE(at91sam9g45_clk_pmc, "atmel,at91sam9g45-pmc", 443 CLK_OF_DECLARE(at91sam9n12_clk_pmc, "atmel,at91sam9n12-pmc", 450 CLK_OF_DECLARE(at91sam9x5_clk_pmc, "atmel,at91sam9x5-pmc", 457 CLK_OF_DECLARE(sama5d2_clk_pmc, "atmel,sama5d2-pmc", 464 CLK_OF_DECLARE(sama5d3_clk_pmc, "atmel,sama5d3-pmc",
|
H A D | clk-utmi.c | 23 #include "pmc.h" 29 struct at91_pmc *pmc; member in struct:clk_utmi 49 struct at91_pmc *pmc = utmi->pmc; clk_utmi_prepare() local 50 u32 tmp = pmc_read(pmc, AT91_CKGR_UCKR) | AT91_PMC_UPLLEN | clk_utmi_prepare() 53 pmc_write(pmc, AT91_CKGR_UCKR, tmp); clk_utmi_prepare() 55 while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_LOCKU)) { clk_utmi_prepare() 58 pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_LOCKU); clk_utmi_prepare() 67 struct at91_pmc *pmc = utmi->pmc; clk_utmi_is_prepared() local 69 return !!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_LOCKU); clk_utmi_is_prepared() 75 struct at91_pmc *pmc = utmi->pmc; clk_utmi_unprepare() local 76 u32 tmp = pmc_read(pmc, AT91_CKGR_UCKR) & ~AT91_PMC_UPLLEN; clk_utmi_unprepare() 78 pmc_write(pmc, AT91_CKGR_UCKR, tmp); clk_utmi_unprepare() 96 at91_clk_register_utmi(struct at91_pmc *pmc, unsigned int irq, at91_clk_register_utmi() argument 115 utmi->pmc = pmc; at91_clk_register_utmi() 136 of_at91_clk_utmi_setup(struct device_node *np, struct at91_pmc *pmc) of_at91_clk_utmi_setup() argument 151 clk = at91_clk_register_utmi(pmc, irq, name, parent_name); of_at91_clk_utmi_setup() 160 struct at91_pmc *pmc) of_at91sam9x5_clk_utmi_setup() 162 of_at91_clk_utmi_setup(np, pmc); of_at91sam9x5_clk_utmi_setup() 159 of_at91sam9x5_clk_utmi_setup(struct device_node *np, struct at91_pmc *pmc) of_at91sam9x5_clk_utmi_setup() argument
|
H A D | clk-smd.c | 18 #include "pmc.h" 27 struct at91_pmc *pmc; member in struct:at91sam9x5_clk_smd 39 struct at91_pmc *pmc = smd->pmc; at91sam9x5_clk_smd_recalc_rate() local 41 tmp = pmc_read(pmc, AT91_PMC_SMD); at91sam9x5_clk_smd_recalc_rate() 72 struct at91_pmc *pmc = smd->pmc; at91sam9x5_clk_smd_set_parent() local 76 tmp = pmc_read(pmc, AT91_PMC_SMD) & ~AT91_PMC_SMDS; at91sam9x5_clk_smd_set_parent() 79 pmc_write(pmc, AT91_PMC_SMD, tmp); at91sam9x5_clk_smd_set_parent() 86 struct at91_pmc *pmc = smd->pmc; at91sam9x5_clk_smd_get_parent() local 88 return pmc_read(pmc, AT91_PMC_SMD) & AT91_PMC_SMDS; at91sam9x5_clk_smd_get_parent() 96 struct at91_pmc *pmc = smd->pmc; at91sam9x5_clk_smd_set_rate() local 101 tmp = pmc_read(pmc, AT91_PMC_SMD) & ~AT91_PMC_SMD_DIV; at91sam9x5_clk_smd_set_rate() 103 pmc_write(pmc, AT91_PMC_SMD, tmp); at91sam9x5_clk_smd_set_rate() 117 at91sam9x5_clk_register_smd(struct at91_pmc *pmc, const char *name, at91sam9x5_clk_register_smd() argument 135 smd->pmc = pmc; at91sam9x5_clk_register_smd() 145 struct at91_pmc *pmc) of_at91sam9x5_clk_smd_setup() 160 clk = at91sam9x5_clk_register_smd(pmc, name, parent_names, of_at91sam9x5_clk_smd_setup() 144 of_at91sam9x5_clk_smd_setup(struct device_node *np, struct at91_pmc *pmc) of_at91sam9x5_clk_smd_setup() argument
|
H A D | clk-main.c | 24 #include "pmc.h" 37 struct at91_pmc *pmc; member in struct:clk_main_osc 46 struct at91_pmc *pmc; member in struct:clk_main_rc_osc 57 struct at91_pmc *pmc; member in struct:clk_rm9200_main 64 struct at91_pmc *pmc; member in struct:clk_sam9x5_main 85 struct at91_pmc *pmc = osc->pmc; clk_main_osc_prepare() local 88 tmp = pmc_read(pmc, AT91_CKGR_MOR) & ~MOR_KEY_MASK; clk_main_osc_prepare() 94 pmc_write(pmc, AT91_CKGR_MOR, tmp); clk_main_osc_prepare() 97 while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCS)) { clk_main_osc_prepare() 100 pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCS); clk_main_osc_prepare() 109 struct at91_pmc *pmc = osc->pmc; clk_main_osc_unprepare() local 110 u32 tmp = pmc_read(pmc, AT91_CKGR_MOR); clk_main_osc_unprepare() 119 pmc_write(pmc, AT91_CKGR_MOR, tmp | AT91_PMC_KEY); clk_main_osc_unprepare() 125 struct at91_pmc *pmc = osc->pmc; clk_main_osc_is_prepared() local 126 u32 tmp = pmc_read(pmc, AT91_CKGR_MOR); clk_main_osc_is_prepared() 131 return !!((pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCS) && clk_main_osc_is_prepared() 132 (pmc_read(pmc, AT91_CKGR_MOR) & AT91_PMC_MOSCEN)); clk_main_osc_is_prepared() 142 at91_clk_register_main_osc(struct at91_pmc *pmc, at91_clk_register_main_osc() argument 153 if (!pmc || !irq || !name || !parent_name) at91_clk_register_main_osc() 167 osc->pmc = pmc; at91_clk_register_main_osc() 180 pmc_write(pmc, AT91_CKGR_MOR, at91_clk_register_main_osc() 181 (pmc_read(pmc, AT91_CKGR_MOR) & at91_clk_register_main_osc() 195 struct at91_pmc *pmc) of_at91rm9200_clk_main_osc_setup() 211 clk = at91_clk_register_main_osc(pmc, irq, name, parent_name, bypass); of_at91rm9200_clk_main_osc_setup() 231 struct at91_pmc *pmc = osc->pmc; clk_main_rc_osc_prepare() local 234 tmp = pmc_read(pmc, AT91_CKGR_MOR) & ~MOR_KEY_MASK; clk_main_rc_osc_prepare() 238 pmc_write(pmc, AT91_CKGR_MOR, tmp); clk_main_rc_osc_prepare() 241 while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCRCS)) { clk_main_rc_osc_prepare() 244 pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCRCS); clk_main_rc_osc_prepare() 253 struct at91_pmc *pmc = osc->pmc; clk_main_rc_osc_unprepare() local 254 u32 tmp = pmc_read(pmc, AT91_CKGR_MOR); clk_main_rc_osc_unprepare() 260 pmc_write(pmc, AT91_CKGR_MOR, tmp | AT91_PMC_KEY); clk_main_rc_osc_unprepare() 266 struct at91_pmc *pmc = osc->pmc; clk_main_rc_osc_is_prepared() local 268 return !!((pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCRCS) && clk_main_rc_osc_is_prepared() 269 (pmc_read(pmc, AT91_CKGR_MOR) & AT91_PMC_MOSCRCEN)); clk_main_rc_osc_is_prepared() 297 at91_clk_register_main_rc_osc(struct at91_pmc *pmc, at91_clk_register_main_rc_osc() argument 307 if (!pmc || !irq || !name || !frequency) at91_clk_register_main_rc_osc() 321 osc->pmc = pmc; at91_clk_register_main_rc_osc() 343 struct at91_pmc *pmc) of_at91sam9x5_clk_main_rc_osc_setup() 359 clk = at91_clk_register_main_rc_osc(pmc, irq, name, frequency, of_at91sam9x5_clk_main_rc_osc_setup() 368 static int clk_main_probe_frequency(struct at91_pmc *pmc) clk_main_probe_frequency() argument 376 tmp = pmc_read(pmc, AT91_CKGR_MCFR); clk_main_probe_frequency() 385 static unsigned long clk_main_recalc_rate(struct at91_pmc *pmc, clk_main_recalc_rate() argument 394 tmp = pmc_read(pmc, AT91_CKGR_MCFR); clk_main_recalc_rate() 405 return clk_main_probe_frequency(clkmain->pmc); clk_rm9200_main_prepare() 412 return !!(pmc_read(clkmain->pmc, AT91_CKGR_MCFR) & AT91_PMC_MAINRDY); clk_rm9200_main_is_prepared() 420 return clk_main_recalc_rate(clkmain->pmc, parent_rate); clk_rm9200_main_recalc_rate() 430 at91_clk_register_rm9200_main(struct at91_pmc *pmc, at91_clk_register_rm9200_main() argument 438 if (!pmc || !name) at91_clk_register_rm9200_main() 455 clkmain->pmc = pmc; at91_clk_register_rm9200_main() 465 struct at91_pmc *pmc) of_at91rm9200_clk_main_setup() 474 clk = at91_clk_register_rm9200_main(pmc, name, parent_name); of_at91rm9200_clk_main_setup() 494 struct at91_pmc *pmc = clkmain->pmc; clk_sam9x5_main_prepare() local 496 while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS)) { clk_sam9x5_main_prepare() 499 pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS); clk_sam9x5_main_prepare() 502 return clk_main_probe_frequency(pmc); clk_sam9x5_main_prepare() 509 return !!(pmc_read(clkmain->pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS); clk_sam9x5_main_is_prepared() 517 return clk_main_recalc_rate(clkmain->pmc, parent_rate); clk_sam9x5_main_recalc_rate() 523 struct at91_pmc *pmc = clkmain->pmc; clk_sam9x5_main_set_parent() local 529 tmp = pmc_read(pmc, AT91_CKGR_MOR) & ~MOR_KEY_MASK; clk_sam9x5_main_set_parent() 532 pmc_write(pmc, AT91_CKGR_MOR, tmp | AT91_PMC_MOSCSEL); clk_sam9x5_main_set_parent() 534 pmc_write(pmc, AT91_CKGR_MOR, tmp & ~AT91_PMC_MOSCSEL); clk_sam9x5_main_set_parent() 536 while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS)) { clk_sam9x5_main_set_parent() 539 pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MOSCSELS); clk_sam9x5_main_set_parent() 549 return !!(pmc_read(clkmain->pmc, AT91_CKGR_MOR) & AT91_PMC_MOSCEN); clk_sam9x5_main_get_parent() 561 at91_clk_register_sam9x5_main(struct at91_pmc *pmc, at91_clk_register_sam9x5_main() argument 572 if (!pmc || !irq || !name) at91_clk_register_sam9x5_main() 589 clkmain->pmc = pmc; at91_clk_register_sam9x5_main() 591 clkmain->parent = !!(pmc_read(clkmain->pmc, AT91_CKGR_MOR) & at91_clk_register_sam9x5_main() 610 struct at91_pmc *pmc) of_at91sam9x5_clk_main_setup() 630 clk = at91_clk_register_sam9x5_main(pmc, irq, name, parent_names, of_at91sam9x5_clk_main_setup() 194 of_at91rm9200_clk_main_osc_setup(struct device_node *np, struct at91_pmc *pmc) of_at91rm9200_clk_main_osc_setup() argument 342 of_at91sam9x5_clk_main_rc_osc_setup(struct device_node *np, struct at91_pmc *pmc) of_at91sam9x5_clk_main_rc_osc_setup() argument 464 of_at91rm9200_clk_main_setup(struct device_node *np, struct at91_pmc *pmc) of_at91rm9200_clk_main_setup() argument 609 of_at91sam9x5_clk_main_setup(struct device_node *np, struct at91_pmc *pmc) of_at91sam9x5_clk_main_setup() argument
|
H A D | clk-plldiv.c | 18 #include "pmc.h" 24 struct at91_pmc *pmc; member in struct:clk_plldiv 31 struct at91_pmc *pmc = plldiv->pmc; clk_plldiv_recalc_rate() local 33 if (pmc_read(pmc, AT91_PMC_MCKR) & AT91_PMC_PLLADIV2) clk_plldiv_recalc_rate() 60 struct at91_pmc *pmc = plldiv->pmc; clk_plldiv_set_rate() local 66 pmc_lock(pmc); clk_plldiv_set_rate() 67 tmp = pmc_read(pmc, AT91_PMC_MCKR) & ~AT91_PMC_PLLADIV2; clk_plldiv_set_rate() 70 pmc_write(pmc, AT91_PMC_MCKR, tmp); clk_plldiv_set_rate() 71 pmc_unlock(pmc); clk_plldiv_set_rate() 83 at91_clk_register_plldiv(struct at91_pmc *pmc, const char *name, at91_clk_register_plldiv() argument 101 plldiv->pmc = pmc; at91_clk_register_plldiv() 112 of_at91_clk_plldiv_setup(struct device_node *np, struct at91_pmc *pmc) of_at91_clk_plldiv_setup() argument 122 clk = at91_clk_register_plldiv(pmc, name, parent_name); of_at91_clk_plldiv_setup() 132 struct at91_pmc *pmc) of_at91sam9x5_clk_plldiv_setup() 134 of_at91_clk_plldiv_setup(np, pmc); of_at91sam9x5_clk_plldiv_setup() 131 of_at91sam9x5_clk_plldiv_setup(struct device_node *np, struct at91_pmc *pmc) of_at91sam9x5_clk_plldiv_setup() argument
|
H A D | clk-master.c | 23 #include "pmc.h" 47 struct at91_pmc *pmc; member in struct:clk_master 66 struct at91_pmc *pmc = master->pmc; clk_master_prepare() local 68 while (!(pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MCKRDY)) { clk_master_prepare() 71 pmc_read(pmc, AT91_PMC_SR) & AT91_PMC_MCKRDY); clk_master_prepare() 81 return !!(pmc_read(master->pmc, AT91_PMC_SR) & AT91_PMC_MCKRDY); clk_master_is_prepared() 91 struct at91_pmc *pmc = master->pmc; clk_master_recalc_rate() local 97 pmc_lock(pmc); clk_master_recalc_rate() 98 tmp = pmc_read(pmc, AT91_PMC_MCKR) & layout->mask; clk_master_recalc_rate() 99 pmc_unlock(pmc); clk_master_recalc_rate() 122 struct at91_pmc *pmc = master->pmc; clk_master_get_parent() local 124 return pmc_read(pmc, AT91_PMC_MCKR) & AT91_PMC_CSS; clk_master_get_parent() 135 at91_clk_register_master(struct at91_pmc *pmc, unsigned int irq, at91_clk_register_master() argument 146 if (!pmc || !irq || !name || !num_parents || !parent_names) at91_clk_register_master() 162 master->pmc = pmc; at91_clk_register_master() 220 of_at91_clk_master_setup(struct device_node *np, struct at91_pmc *pmc, of_at91_clk_master_setup() argument 246 clk = at91_clk_register_master(pmc, irq, name, num_parents, of_at91_clk_master_setup() 260 struct at91_pmc *pmc) of_at91rm9200_clk_master_setup() 262 of_at91_clk_master_setup(np, pmc, &at91rm9200_master_layout); of_at91rm9200_clk_master_setup() 266 struct at91_pmc *pmc) of_at91sam9x5_clk_master_setup() 268 of_at91_clk_master_setup(np, pmc, &at91sam9x5_master_layout); of_at91sam9x5_clk_master_setup() 259 of_at91rm9200_clk_master_setup(struct device_node *np, struct at91_pmc *pmc) of_at91rm9200_clk_master_setup() argument 265 of_at91sam9x5_clk_master_setup(struct device_node *np, struct at91_pmc *pmc) of_at91sam9x5_clk_master_setup() argument
|
H A D | clk-h32mx.c | 28 #include "pmc.h" 34 struct at91_pmc *pmc; member in struct:clk_sama5d4_h32mx 44 if (pmc_read(h32mxclk->pmc, AT91_PMC_MCKR) & AT91_PMC_H32MXDIV) clk_sama5d4_h32mx_recalc_rate() 73 struct at91_pmc *pmc = h32mxclk->pmc; clk_sama5d4_h32mx_set_rate() local 79 pmc_lock(pmc); clk_sama5d4_h32mx_set_rate() 80 tmp = pmc_read(pmc, AT91_PMC_MCKR) & ~AT91_PMC_H32MXDIV; clk_sama5d4_h32mx_set_rate() 83 pmc_write(pmc, AT91_PMC_MCKR, tmp); clk_sama5d4_h32mx_set_rate() 84 pmc_unlock(pmc); clk_sama5d4_h32mx_set_rate() 96 struct at91_pmc *pmc) of_sama5d4_clk_h32mx_setup() 116 h32mxclk->pmc = pmc; of_sama5d4_clk_h32mx_setup() 95 of_sama5d4_clk_h32mx_setup(struct device_node *np, struct at91_pmc *pmc) of_sama5d4_clk_h32mx_setup() argument
|
H A D | clk-generated.c | 21 #include "pmc.h" 31 struct at91_pmc *pmc; member in struct:clk_generated 44 struct at91_pmc *pmc = gck->pmc; clk_generated_enable() local 50 pmc_lock(pmc); clk_generated_enable() 51 pmc_write(pmc, AT91_PMC_PCR, (gck->id & AT91_PMC_PCR_PID_MASK)); clk_generated_enable() 52 tmp = pmc_read(pmc, AT91_PMC_PCR) & clk_generated_enable() 54 pmc_write(pmc, AT91_PMC_PCR, tmp | AT91_PMC_PCR_GCKCSS(gck->parent_id) clk_generated_enable() 58 pmc_unlock(pmc); clk_generated_enable() 65 struct at91_pmc *pmc = gck->pmc; clk_generated_disable() local 68 pmc_lock(pmc); clk_generated_disable() 69 pmc_write(pmc, AT91_PMC_PCR, (gck->id & AT91_PMC_PCR_PID_MASK)); clk_generated_disable() 70 tmp = pmc_read(pmc, AT91_PMC_PCR) & ~AT91_PMC_PCR_GCKEN; clk_generated_disable() 71 pmc_write(pmc, AT91_PMC_PCR, tmp | AT91_PMC_PCR_CMD); clk_generated_disable() 72 pmc_unlock(pmc); clk_generated_disable() 78 struct at91_pmc *pmc = gck->pmc; clk_generated_is_enabled() local 81 pmc_lock(pmc); clk_generated_is_enabled() 82 pmc_write(pmc, AT91_PMC_PCR, (gck->id & AT91_PMC_PCR_PID_MASK)); clk_generated_is_enabled() 83 ret = !!(pmc_read(pmc, AT91_PMC_PCR) & AT91_PMC_PCR_GCKEN); clk_generated_is_enabled() 84 pmc_unlock(pmc); clk_generated_is_enabled() 217 struct at91_pmc *pmc = gck->pmc; clk_generated_startup() local 220 pmc_lock(pmc); clk_generated_startup() 221 pmc_write(pmc, AT91_PMC_PCR, (gck->id & AT91_PMC_PCR_PID_MASK)); clk_generated_startup() 222 tmp = pmc_read(pmc, AT91_PMC_PCR); clk_generated_startup() 223 pmc_unlock(pmc); clk_generated_startup() 232 at91_clk_register_generated(struct at91_pmc *pmc, const char *name, at91_clk_register_generated() argument 252 gck->pmc = pmc; at91_clk_register_generated() 265 struct at91_pmc *pmc) of_sama5d2_clk_generated_setup() 299 clk = at91_clk_register_generated(pmc, name, parent_names, for_each_child_of_node() 264 of_sama5d2_clk_generated_setup(struct device_node *np, struct at91_pmc *pmc) of_sama5d2_clk_generated_setup() argument
|
H A D | clk-system.c | 23 #include "pmc.h" 32 struct at91_pmc *pmc; member in struct:clk_system 55 struct at91_pmc *pmc = sys->pmc; clk_system_prepare() local 58 pmc_write(pmc, AT91_PMC_SCER, mask); clk_system_prepare() 63 while (!(pmc_read(pmc, AT91_PMC_SR) & mask)) { clk_system_prepare() 67 pmc_read(pmc, AT91_PMC_SR) & mask); clk_system_prepare() 77 struct at91_pmc *pmc = sys->pmc; clk_system_unprepare() local 79 pmc_write(pmc, AT91_PMC_SCDR, 1 << sys->id); clk_system_unprepare() 85 struct at91_pmc *pmc = sys->pmc; clk_system_is_prepared() local 87 if (!(pmc_read(pmc, AT91_PMC_SCSR) & (1 << sys->id))) clk_system_is_prepared() 93 return !!(pmc_read(pmc, AT91_PMC_SR) & (1 << sys->id)); clk_system_is_prepared() 103 at91_clk_register_system(struct at91_pmc *pmc, const char *name, at91_clk_register_system() argument 126 sys->pmc = pmc; at91_clk_register_system() 150 of_at91_clk_sys_setup(struct device_node *np, struct at91_pmc *pmc) of_at91_clk_sys_setup() argument 176 clk = at91_clk_register_system(pmc, name, parent_name, id, irq); for_each_child_of_node() 185 struct at91_pmc *pmc) of_at91rm9200_clk_sys_setup() 187 of_at91_clk_sys_setup(np, pmc); of_at91rm9200_clk_sys_setup() 184 of_at91rm9200_clk_sys_setup(struct device_node *np, struct at91_pmc *pmc) of_at91rm9200_clk_sys_setup() argument
|
H A D | clk-programmable.c | 20 #include "pmc.h" 37 struct at91_pmc *pmc; member in struct:clk_programmable 49 struct at91_pmc *pmc = prog->pmc; clk_programmable_recalc_rate() local 52 pres = (pmc_read(pmc, AT91_PMC_PCKR(prog->id)) >> layout->pres_shift) & clk_programmable_recalc_rate() 104 struct at91_pmc *pmc = prog->pmc; clk_programmable_set_parent() local 105 u32 tmp = pmc_read(pmc, AT91_PMC_PCKR(prog->id)) & ~layout->css_mask; clk_programmable_set_parent() 119 pmc_write(pmc, AT91_PMC_PCKR(prog->id), tmp | index); clk_programmable_set_parent() 128 struct at91_pmc *pmc = prog->pmc; clk_programmable_get_parent() local 131 tmp = pmc_read(pmc, AT91_PMC_PCKR(prog->id)); clk_programmable_get_parent() 143 struct at91_pmc *pmc = prog->pmc; clk_programmable_set_rate() local 147 u32 tmp = pmc_read(pmc, AT91_PMC_PCKR(prog->id)) & clk_programmable_set_rate() 161 pmc_write(pmc, AT91_PMC_PCKR(prog->id), clk_programmable_set_rate() 176 at91_clk_register_programmable(struct at91_pmc *pmc, at91_clk_register_programmable() argument 201 prog->pmc = pmc; at91_clk_register_programmable() 229 of_at91_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc, of_at91_clk_prog_setup() argument 257 clk = at91_clk_register_programmable(pmc, name, for_each_child_of_node() 269 struct at91_pmc *pmc) of_at91rm9200_clk_prog_setup() 271 of_at91_clk_prog_setup(np, pmc, &at91rm9200_programmable_layout); of_at91rm9200_clk_prog_setup() 275 struct at91_pmc *pmc) of_at91sam9g45_clk_prog_setup() 277 of_at91_clk_prog_setup(np, pmc, &at91sam9g45_programmable_layout); of_at91sam9g45_clk_prog_setup() 281 struct at91_pmc *pmc) of_at91sam9x5_clk_prog_setup() 283 of_at91_clk_prog_setup(np, pmc, &at91sam9x5_programmable_layout); of_at91sam9x5_clk_prog_setup() 268 of_at91rm9200_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc) of_at91rm9200_clk_prog_setup() argument 274 of_at91sam9g45_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc) of_at91sam9g45_clk_prog_setup() argument 280 of_at91sam9x5_clk_prog_setup(struct device_node *np, struct at91_pmc *pmc) of_at91sam9x5_clk_prog_setup() argument
|
H A D | clk-pll.c | 24 #include "pmc.h" 61 struct at91_pmc *pmc; member in struct:clk_pll 85 struct at91_pmc *pmc = pll->pmc; clk_pll_prepare() local 97 pllr = pmc_read(pmc, offset); clk_pll_prepare() 101 if ((pmc_read(pmc, AT91_PMC_SR) & mask) && clk_pll_prepare() 108 icpr = pmc_read(pmc, AT91_PMC_PLLICPR) & ~PLL_ICPR_MASK(id); clk_pll_prepare() 111 pmc_write(pmc, AT91_PMC_PLLICPR, icpr); clk_pll_prepare() 119 pmc_write(pmc, offset, pllr); clk_pll_prepare() 121 while (!(pmc_read(pmc, AT91_PMC_SR) & mask)) { clk_pll_prepare() 124 pmc_read(pmc, AT91_PMC_SR) & mask); clk_pll_prepare() 133 struct at91_pmc *pmc = pll->pmc; clk_pll_is_prepared() local 135 return !!(pmc_read(pmc, AT91_PMC_SR) & clk_pll_is_prepared() 142 struct at91_pmc *pmc = pll->pmc; clk_pll_unprepare() local 145 u32 tmp = pmc_read(pmc, offset) & ~(layout->pllr_mask); clk_pll_unprepare() 147 pmc_write(pmc, offset, tmp); clk_pll_unprepare() 311 at91_clk_register_pll(struct at91_pmc *pmc, unsigned int irq, const char *name, at91_clk_register_pll() argument 340 pll->pmc = pmc; at91_clk_register_pll() 342 tmp = pmc_read(pmc, offset) & layout->pllr_mask; at91_clk_register_pll() 486 of_at91_clk_pll_setup(struct device_node *np, struct at91_pmc *pmc, of_at91_clk_pll_setup() argument 511 clk = at91_clk_register_pll(pmc, irq, name, parent_name, id, layout, of_at91_clk_pll_setup() 524 struct at91_pmc *pmc) of_at91rm9200_clk_pll_setup() 526 of_at91_clk_pll_setup(np, pmc, &at91rm9200_pll_layout); of_at91rm9200_clk_pll_setup() 530 struct at91_pmc *pmc) of_at91sam9g45_clk_pll_setup() 532 of_at91_clk_pll_setup(np, pmc, &at91sam9g45_pll_layout); of_at91sam9g45_clk_pll_setup() 536 struct at91_pmc *pmc) of_at91sam9g20_clk_pllb_setup() 538 of_at91_clk_pll_setup(np, pmc, &at91sam9g20_pllb_layout); of_at91sam9g20_clk_pllb_setup() 542 struct at91_pmc *pmc) of_sama5d3_clk_pll_setup() 544 of_at91_clk_pll_setup(np, pmc, &sama5d3_pll_layout); of_sama5d3_clk_pll_setup() 523 of_at91rm9200_clk_pll_setup(struct device_node *np, struct at91_pmc *pmc) of_at91rm9200_clk_pll_setup() argument 529 of_at91sam9g45_clk_pll_setup(struct device_node *np, struct at91_pmc *pmc) of_at91sam9g45_clk_pll_setup() argument 535 of_at91sam9g20_clk_pllb_setup(struct device_node *np, struct at91_pmc *pmc) of_at91sam9g20_clk_pllb_setup() argument 541 of_sama5d3_clk_pll_setup(struct device_node *np, struct at91_pmc *pmc) of_sama5d3_clk_pll_setup() argument
|
H A D | clk-slow.c | 28 #include "pmc.h" 62 struct at91_pmc *pmc; member in struct:clk_sam9260_slow 397 return !!(pmc_read(slowck->pmc, AT91_PMC_SR) & AT91_PMC_OSCSEL); clk_sam9260_slow_get_parent() 405 at91_clk_register_sam9260_slow(struct at91_pmc *pmc, at91_clk_register_sam9260_slow() argument 414 if (!pmc || !name) at91_clk_register_sam9260_slow() 431 slowck->pmc = pmc; at91_clk_register_sam9260_slow() 443 struct at91_pmc *pmc) of_at91sam9260_clk_slow_setup() 458 clk = at91_clk_register_sam9260_slow(pmc, name, parent_names, of_at91sam9260_clk_slow_setup() 442 of_at91sam9260_clk_slow_setup(struct device_node *np, struct at91_pmc *pmc) of_at91sam9260_clk_slow_setup() argument
|
/linux-4.4.14/arch/x86/kvm/ |
H A D | pmu.h | 6 #define pmc_to_pmu(pmc) (&(pmc)->vcpu->arch.pmu) 21 bool (*pmc_is_enabled)(struct kvm_pmc *pmc); 33 static inline u64 pmc_bitmask(struct kvm_pmc *pmc) pmc_bitmask() argument 35 struct kvm_pmu *pmu = pmc_to_pmu(pmc); pmc_bitmask() 37 return pmu->counter_bitmask[pmc->type]; pmc_bitmask() 40 static inline u64 pmc_read_counter(struct kvm_pmc *pmc) pmc_read_counter() argument 44 counter = pmc->counter; pmc_read_counter() 45 if (pmc->perf_event) pmc_read_counter() 46 counter += perf_event_read_value(pmc->perf_event, pmc_read_counter() 49 return counter & pmc_bitmask(pmc); pmc_read_counter() 52 static inline void pmc_stop_counter(struct kvm_pmc *pmc) pmc_stop_counter() argument 54 if (pmc->perf_event) { pmc_stop_counter() 55 pmc->counter = pmc_read_counter(pmc); pmc_stop_counter() 56 perf_event_release_kernel(pmc->perf_event); pmc_stop_counter() 57 pmc->perf_event = NULL; pmc_stop_counter() 61 static inline bool pmc_is_gp(struct kvm_pmc *pmc) pmc_is_gp() argument 63 return pmc->type == KVM_PMC_GP; pmc_is_gp() 66 static inline bool pmc_is_fixed(struct kvm_pmc *pmc) pmc_is_fixed() argument 68 return pmc->type == KVM_PMC_FIXED; pmc_is_fixed() 71 static inline bool pmc_is_enabled(struct kvm_pmc *pmc) pmc_is_enabled() argument 73 return kvm_x86_ops->pmu_ops->pmc_is_enabled(pmc); pmc_is_enabled() 100 void reprogram_gp_counter(struct kvm_pmc *pmc, u64 eventsel); 101 void reprogram_fixed_counter(struct kvm_pmc *pmc, u8 ctrl, int fixed_idx); 106 int kvm_pmu_rdpmc(struct kvm_vcpu *vcpu, unsigned pmc, u64 *data);
|
H A D | pmu.c | 41 * 3. Global PMC Index (named pmc): pmc is an index specific to PMU 42 * code. Each pmc, stored in kvm_pmc.idx field, is unique across 44 * between pmc and perf counters is as the following: 62 struct kvm_pmc *pmc = perf_event->overflow_handler_context; kvm_perf_overflow() local 63 struct kvm_pmu *pmu = pmc_to_pmu(pmc); kvm_perf_overflow() 65 if (!test_and_set_bit(pmc->idx, kvm_perf_overflow() 67 __set_bit(pmc->idx, (unsigned long *)&pmu->global_status); kvm_perf_overflow() 68 kvm_make_request(KVM_REQ_PMU, pmc->vcpu); kvm_perf_overflow() 76 struct kvm_pmc *pmc = perf_event->overflow_handler_context; kvm_perf_overflow_intr() local 77 struct kvm_pmu *pmu = pmc_to_pmu(pmc); kvm_perf_overflow_intr() 79 if (!test_and_set_bit(pmc->idx, kvm_perf_overflow_intr() 81 __set_bit(pmc->idx, (unsigned long *)&pmu->global_status); kvm_perf_overflow_intr() 82 kvm_make_request(KVM_REQ_PMU, pmc->vcpu); kvm_perf_overflow_intr() 93 irq_work_queue(&pmc_to_pmu(pmc)->irq_work); kvm_perf_overflow_intr() 95 kvm_make_request(KVM_REQ_PMI, pmc->vcpu); kvm_perf_overflow_intr() 99 static void pmc_reprogram_counter(struct kvm_pmc *pmc, u32 type, pmc_reprogram_counter() argument 121 attr.sample_period = (-pmc->counter) & pmc_bitmask(pmc); pmc_reprogram_counter() 125 kvm_perf_overflow, pmc); pmc_reprogram_counter() 132 pmc->perf_event = event; pmc_reprogram_counter() 133 clear_bit(pmc->idx, (unsigned long*)&pmc_to_pmu(pmc)->reprogram_pmi); pmc_reprogram_counter() 136 void reprogram_gp_counter(struct kvm_pmc *pmc, u64 eventsel) reprogram_gp_counter() argument 144 pmc->eventsel = eventsel; reprogram_gp_counter() 146 pmc_stop_counter(pmc); reprogram_gp_counter() 148 if (!(eventsel & ARCH_PERFMON_EVENTSEL_ENABLE) || !pmc_is_enabled(pmc)) reprogram_gp_counter() 159 config = kvm_x86_ops->pmu_ops->find_arch_event(pmc_to_pmu(pmc), reprogram_gp_counter() 169 pmc_reprogram_counter(pmc, type, config, reprogram_gp_counter() 178 void reprogram_fixed_counter(struct kvm_pmc *pmc, u8 ctrl, int idx) reprogram_fixed_counter() argument 183 pmc_stop_counter(pmc); reprogram_fixed_counter() 185 if (!en_field || !pmc_is_enabled(pmc)) reprogram_fixed_counter() 188 pmc_reprogram_counter(pmc, PERF_TYPE_HARDWARE, reprogram_fixed_counter() 198 struct kvm_pmc *pmc = kvm_x86_ops->pmu_ops->pmc_idx_to_pmc(pmu, pmc_idx); reprogram_counter() local 200 if (!pmc) reprogram_counter() 203 if (pmc_is_gp(pmc)) reprogram_counter() 204 reprogram_gp_counter(pmc, pmc->eventsel); reprogram_counter() 209 reprogram_fixed_counter(pmc, ctrl, idx); reprogram_counter() 223 struct kvm_pmc *pmc = kvm_x86_ops->pmu_ops->pmc_idx_to_pmc(pmu, bit); kvm_pmu_handle_event() local 225 if (unlikely(!pmc || !pmc->perf_event)) { kvm_pmu_handle_event() 243 struct kvm_pmc *pmc; kvm_pmu_rdpmc() local 246 pmc = kvm_x86_ops->pmu_ops->msr_idx_to_pmc(vcpu, idx); kvm_pmu_rdpmc() 247 if (!pmc) kvm_pmu_rdpmc() 250 ctr_val = pmc_read_counter(pmc); kvm_pmu_rdpmc()
|
H A D | pmu_amd.c | 60 static bool amd_pmc_is_enabled(struct kvm_pmc *pmc) amd_pmc_is_enabled() argument 108 struct kvm_pmc *pmc; amd_pmu_get_msr() local 111 pmc = get_gp_pmc(pmu, msr, MSR_K7_PERFCTR0); amd_pmu_get_msr() 112 if (pmc) { amd_pmu_get_msr() 113 *data = pmc_read_counter(pmc); amd_pmu_get_msr() 117 pmc = get_gp_pmc(pmu, msr, MSR_K7_EVNTSEL0); amd_pmu_get_msr() 118 if (pmc) { amd_pmu_get_msr() 119 *data = pmc->eventsel; amd_pmu_get_msr() 129 struct kvm_pmc *pmc; amd_pmu_set_msr() local 134 pmc = get_gp_pmc(pmu, msr, MSR_K7_PERFCTR0); amd_pmu_set_msr() 135 if (pmc) { amd_pmu_set_msr() 136 pmc->counter += data - pmc_read_counter(pmc); amd_pmu_set_msr() 140 pmc = get_gp_pmc(pmu, msr, MSR_K7_EVNTSEL0); amd_pmu_set_msr() 141 if (pmc) { amd_pmu_set_msr() 142 if (data == pmc->eventsel) amd_pmu_set_msr() 145 reprogram_gp_counter(pmc, data); amd_pmu_set_msr() 185 struct kvm_pmc *pmc = &pmu->gp_counters[i]; amd_pmu_reset() local 187 pmc_stop_counter(pmc); amd_pmu_reset() 188 pmc->counter = pmc->eventsel = 0; amd_pmu_reset()
|
H A D | pmu_intel.c | 35 /* mapping between fixed pmc index and intel_arch_events array */ 45 struct kvm_pmc *pmc; reprogram_fixed_counters() local 47 pmc = get_fixed_pmc(pmu, MSR_CORE_PERF_FIXED_CTR0 + i); reprogram_fixed_counters() 52 reprogram_fixed_counter(pmc, new_ctrl, i); reprogram_fixed_counters() 97 static bool intel_pmc_is_enabled(struct kvm_pmc *pmc) intel_pmc_is_enabled() argument 99 struct kvm_pmu *pmu = pmc_to_pmu(pmc); intel_pmc_is_enabled() 101 return test_bit(pmc->idx, (unsigned long *)&pmu->global_ctrl); intel_pmc_is_enabled() 170 struct kvm_pmc *pmc; intel_pmu_get_msr() local 186 if ((pmc = get_gp_pmc(pmu, msr, MSR_IA32_PERFCTR0)) || intel_pmu_get_msr() 187 (pmc = get_fixed_pmc(pmu, msr))) { intel_pmu_get_msr() 188 *data = pmc_read_counter(pmc); intel_pmu_get_msr() 190 } else if ((pmc = get_gp_pmc(pmu, msr, MSR_P6_EVNTSEL0))) { intel_pmu_get_msr() 191 *data = pmc->eventsel; intel_pmu_get_msr() 202 struct kvm_pmc *pmc; intel_pmu_set_msr() local 238 if ((pmc = get_gp_pmc(pmu, msr, MSR_IA32_PERFCTR0)) || intel_pmu_set_msr() 239 (pmc = get_fixed_pmc(pmu, msr))) { intel_pmu_set_msr() 242 pmc->counter += data - pmc_read_counter(pmc); intel_pmu_set_msr() 244 } else if ((pmc = get_gp_pmc(pmu, msr, MSR_P6_EVNTSEL0))) { intel_pmu_set_msr() 245 if (data == pmc->eventsel) intel_pmu_set_msr() 248 reprogram_gp_counter(pmc, data); intel_pmu_set_msr() 332 struct kvm_pmc *pmc = &pmu->gp_counters[i]; intel_pmu_reset() local 334 pmc_stop_counter(pmc); intel_pmu_reset() 335 pmc->counter = pmc->eventsel = 0; intel_pmu_reset()
|
H A D | emulate.c | 3460 u64 pmc; em_rdpmc() local 3462 if (ctxt->ops->read_pmc(ctxt, reg_read(ctxt, VCPU_REGS_RCX), &pmc)) em_rdpmc() 3464 *reg_write(ctxt, VCPU_REGS_RAX) = (u32)pmc; em_rdpmc() 3465 *reg_write(ctxt, VCPU_REGS_RDX) = pmc >> 32; em_rdpmc()
|
H A D | x86.c | 4908 u32 pmc) emulator_check_pmc() 4910 return kvm_pmu_is_valid_msr_idx(emul_to_vcpu(ctxt), pmc); emulator_check_pmc() 4914 u32 pmc, u64 *pdata) emulator_read_pmc() 4916 return kvm_pmu_rdpmc(emul_to_vcpu(ctxt), pmc, pdata); emulator_read_pmc() 4907 emulator_check_pmc(struct x86_emulate_ctxt *ctxt, u32 pmc) emulator_check_pmc() argument 4913 emulator_read_pmc(struct x86_emulate_ctxt *ctxt, u32 pmc, u64 *pdata) emulator_read_pmc() argument
|
/linux-4.4.14/arch/x86/platform/atom/ |
H A D | pmc_atom.c | 172 static inline u32 pmc_reg_read(struct pmc_dev *pmc, int reg_offset) pmc_reg_read() argument 174 return readl(pmc->regmap + reg_offset); pmc_reg_read() 177 static inline void pmc_reg_write(struct pmc_dev *pmc, int reg_offset, u32 val) pmc_reg_write() argument 179 writel(val, pmc->regmap + reg_offset); pmc_reg_write() 184 struct pmc_dev *pmc = &pmc_device; pmc_atom_read() local 186 if (!pmc->init) pmc_atom_read() 189 *value = pmc_reg_read(pmc, offset); pmc_atom_read() 196 struct pmc_dev *pmc = &pmc_device; pmc_atom_write() local 198 if (!pmc->init) pmc_atom_write() 201 pmc_reg_write(pmc, offset, value); pmc_atom_write() 223 static void pmc_hw_reg_setup(struct pmc_dev *pmc) pmc_hw_reg_setup() argument 233 pmc_reg_write(pmc, PMC_S0IX_WAKE_EN, (u32)PMC_WAKE_EN_SETTING); pmc_hw_reg_setup() 254 struct pmc_dev *pmc = s->private; pmc_dev_state_show() local 255 const struct pmc_reg_map *m = pmc->map; pmc_dev_state_show() 259 func_dis = pmc_reg_read(pmc, PMC_FUNC_DIS); pmc_dev_state_show() 260 func_dis_2 = pmc_reg_read(pmc, PMC_FUNC_DIS_2); pmc_dev_state_show() 261 d3_sts_0 = pmc_reg_read(pmc, PMC_D3_STS_0); pmc_dev_state_show() 262 d3_sts_1 = pmc_reg_read(pmc, PMC_D3_STS_1); pmc_dev_state_show() 287 struct pmc_dev *pmc = s->private; pmc_pss_state_show() local 288 const struct pmc_bit_map *map = pmc->map->pss; pmc_pss_state_show() 289 u32 pss = pmc_reg_read(pmc, PMC_PSS); pmc_pss_state_show() 314 struct pmc_dev *pmc = s->private; pmc_sleep_tmr_show() local 317 s0ir_tmr = (u64)pmc_reg_read(pmc, PMC_S0IR_TMR) << PMC_TMR_SHIFT; pmc_sleep_tmr_show() 318 s0i1_tmr = (u64)pmc_reg_read(pmc, PMC_S0I1_TMR) << PMC_TMR_SHIFT; pmc_sleep_tmr_show() 319 s0i2_tmr = (u64)pmc_reg_read(pmc, PMC_S0I2_TMR) << PMC_TMR_SHIFT; pmc_sleep_tmr_show() 320 s0i3_tmr = (u64)pmc_reg_read(pmc, PMC_S0I3_TMR) << PMC_TMR_SHIFT; pmc_sleep_tmr_show() 321 s0_tmr = (u64)pmc_reg_read(pmc, PMC_S0_TMR) << PMC_TMR_SHIFT; pmc_sleep_tmr_show() 343 static void pmc_dbgfs_unregister(struct pmc_dev *pmc) pmc_dbgfs_unregister() argument 345 debugfs_remove_recursive(pmc->dbgfs_dir); pmc_dbgfs_unregister() 348 static int pmc_dbgfs_register(struct pmc_dev *pmc) pmc_dbgfs_register() argument 356 pmc->dbgfs_dir = dir; pmc_dbgfs_register() 359 dir, pmc, &pmc_dev_state_ops); pmc_dbgfs_register() 364 dir, pmc, &pmc_pss_state_ops); pmc_dbgfs_register() 369 dir, pmc, &pmc_sleep_tmr_ops); pmc_dbgfs_register() 375 pmc_dbgfs_unregister(pmc); pmc_dbgfs_register() 379 static int pmc_dbgfs_register(struct pmc_dev *pmc) pmc_dbgfs_register() argument 387 struct pmc_dev *pmc = &pmc_device; pmc_setup_dev() local 399 pci_read_config_dword(pdev, PMC_BASE_ADDR_OFFSET, &pmc->base_addr); pmc_setup_dev() 400 pmc->base_addr &= PMC_BASE_ADDR_MASK; pmc_setup_dev() 402 pmc->regmap = ioremap_nocache(pmc->base_addr, PMC_MMIO_REG_LEN); pmc_setup_dev() 403 if (!pmc->regmap) { pmc_setup_dev() 408 pmc->map = map; pmc_setup_dev() 411 pmc_hw_reg_setup(pmc); pmc_setup_dev() 413 ret = pmc_dbgfs_register(pmc); pmc_setup_dev() 417 pmc->init = true; pmc_setup_dev()
|
/linux-4.4.14/arch/powerpc/perf/ |
H A D | ppc970-pmu.c | 149 int pmc, psel, unit, byte, bit; p970_marked_instr_event() local 152 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; p970_marked_instr_event() 154 if (pmc) { p970_marked_instr_event() 155 if (direct_marked_event[pmc - 1] & (1 << psel)) p970_marked_instr_event() 158 bit = (pmc <= 4)? pmc - 1: 8 - pmc; p970_marked_instr_event() 197 int pmc, byte, unit, sh, spcsel; p970_get_constraint() local 201 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; p970_get_constraint() 202 if (pmc) { p970_get_constraint() 203 if (pmc > 8) p970_get_constraint() 205 sh = (pmc - 1) * 2; p970_get_constraint() 208 grp = ((pmc - 1) >> 1) & 1; p970_get_constraint() 221 if (!pmc) p970_get_constraint() 263 unsigned int pmc, unit, byte, psel; p970_compute_mmcr() local 283 pmc = (event[i] >> PM_PMC_SH) & PM_PMC_MSK; p970_compute_mmcr() 284 if (pmc) { p970_compute_mmcr() 285 if (pmc_inuse & (1 << (pmc - 1))) p970_compute_mmcr() 287 pmc_inuse |= 1 << (pmc - 1); p970_compute_mmcr() 289 ++pmc_grp_use[((pmc - 1) >> 1) & 1]; p970_compute_mmcr() 296 if (!pmc) p970_compute_mmcr() 350 pmc = (event[i] >> PM_PMC_SH) & PM_PMC_MSK; p970_compute_mmcr() 354 if (!pmc) { p970_compute_mmcr() 360 for (pmc = 0; pmc < 8; ++pmc) { p970_compute_mmcr() 361 if (pmc_inuse & (1 << pmc)) p970_compute_mmcr() 363 grp = (pmc >> 1) & 1; p970_compute_mmcr() 372 pmc_inuse |= 1 << pmc; p970_compute_mmcr() 375 --pmc; p970_compute_mmcr() 378 mmcr1 |= 1ull << mmcr1_adder_bits[pmc]; p970_compute_mmcr() 380 pmcsel[pmc] = psel; p970_compute_mmcr() 381 hwc[i] = pmc; p970_compute_mmcr() 387 for (pmc = 0; pmc < 2; ++pmc) p970_compute_mmcr() 388 mmcr0 |= pmcsel[pmc] << (MMCR0_PMC1SEL_SH - 7 * pmc); p970_compute_mmcr() 389 for (; pmc < 8; ++pmc) p970_compute_mmcr() 390 mmcr1 |= (unsigned long)pmcsel[pmc] p970_compute_mmcr() 391 << (MMCR1_PMC3SEL_SH - 5 * (pmc - 2)); p970_compute_mmcr() 406 static void p970_disable_pmc(unsigned int pmc, unsigned long mmcr[]) p970_disable_pmc() argument 410 if (pmc <= 1) { p970_disable_pmc() 411 shift = MMCR0_PMC1SEL_SH - 7 * pmc; p970_disable_pmc() 414 shift = MMCR1_PMC3SEL_SH - 5 * (pmc - 2); p970_disable_pmc()
|
H A D | power7-pmu.c | 88 int pmc, sh, unit; power7_get_constraint() local 91 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; power7_get_constraint() 92 if (pmc) { power7_get_constraint() 93 if (pmc > 6) power7_get_constraint() 95 sh = (pmc - 1) * 2; power7_get_constraint() 98 if (pmc >= 5 && !(event == 0x500fa || event == 0x600f4)) power7_get_constraint() 101 if (pmc < 5) { power7_get_constraint() 148 int pmc, psel; find_alternative_decode() local 151 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; find_alternative_decode() 153 if ((pmc == 2 || pmc == 4) && (psel & ~7) == 0x40) find_alternative_decode() 155 if ((pmc == 1 || pmc == 3) && (psel & ~7) == 0x48) find_alternative_decode() 217 int pmc, psel; power7_marked_instr_event() local 220 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; power7_marked_instr_event() 223 if (pmc >= 5) power7_marked_instr_event() 228 return pmc == 2 || pmc == 4; power7_marked_instr_event() 231 return pmc == 1; power7_marked_instr_event() 233 return pmc != 2; power7_marked_instr_event() 240 return pmc >= 3; power7_marked_instr_event() 252 unsigned int pmc, unit, combine, l2sel, psel; power7_compute_mmcr() local 258 pmc = (event[i] >> PM_PMC_SH) & PM_PMC_MSK; power7_compute_mmcr() 259 if (pmc) { power7_compute_mmcr() 260 if (pmc > 6) power7_compute_mmcr() 262 if (pmc_inuse & (1 << (pmc - 1))) power7_compute_mmcr() 264 pmc_inuse |= 1 << (pmc - 1); power7_compute_mmcr() 270 pmc = (event[i] >> PM_PMC_SH) & PM_PMC_MSK; power7_compute_mmcr() 275 if (!pmc) { power7_compute_mmcr() 277 for (pmc = 0; pmc < 4; ++pmc) { power7_compute_mmcr() 278 if (!(pmc_inuse & (1 << pmc))) power7_compute_mmcr() 281 if (pmc >= 4) power7_compute_mmcr() 283 pmc_inuse |= 1 << pmc; power7_compute_mmcr() 286 --pmc; power7_compute_mmcr() 288 if (pmc <= 3) { power7_compute_mmcr() 290 << (MMCR1_TTM0SEL_SH - 4 * pmc); power7_compute_mmcr() 292 << (MMCR1_PMC1_COMBINE_SH - pmc); power7_compute_mmcr() 293 mmcr1 |= psel << MMCR1_PMCSEL_SH(pmc); power7_compute_mmcr() 300 hwc[i] = pmc; power7_compute_mmcr() 314 static void power7_disable_pmc(unsigned int pmc, unsigned long mmcr[]) power7_disable_pmc() argument 316 if (pmc <= 3) power7_disable_pmc() 317 mmcr[1] &= ~(0xffUL << MMCR1_PMCSEL_SH(pmc)); power7_disable_pmc()
|
H A D | power5+-pmu.c | 139 int pmc, byte, unit, sh; power5p_get_constraint() local 143 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; power5p_get_constraint() 144 if (pmc) { power5p_get_constraint() 145 if (pmc > 6) power5p_get_constraint() 147 sh = (pmc - 1) * 2; power5p_get_constraint() 150 if (pmc >= 5 && !(event == 0x500009 || event == 0x600005)) power5p_get_constraint() 181 if (pmc < 5) { power5p_get_constraint() 193 int pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; power5p_limited_pmc_event() local 195 return pmc == 5 || pmc == 6; power5p_limited_pmc_event() 247 int pmc, altpmc, pp, j; find_alternative_bdecode() local 249 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; find_alternative_bdecode() 250 if (pmc == 0 || pmc > 4) find_alternative_bdecode() 252 altpmc = 5 - pmc; /* 1 <-> 4, 2 <-> 3 */ find_alternative_bdecode() 255 if (bytedecode_alternatives[pmc - 1][j] == pp) { find_alternative_bdecode() 263 if (pmc == 1 && (pp == 0x0d || pp == 0x0e)) find_alternative_bdecode() 265 if (pmc == 3 && (pp == 0x2e || pp == 0x2f)) find_alternative_bdecode() 407 int pmc, psel; power5p_marked_instr_event() local 411 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; power5p_marked_instr_event() 413 if (pmc >= 5) power5p_marked_instr_event() 418 if (direct_event_is_marked[psel] & (1 << pmc)) power5p_marked_instr_event() 423 bit = pmc - 1; power5p_marked_instr_event() 425 bit = 4 - pmc; power5p_marked_instr_event() 426 else if (psel == 0x1b && (pmc == 1 || pmc == 3)) power5p_marked_instr_event() 431 bit = pmc - 1; power5p_marked_instr_event() 432 } else if (pmc == 3 && (psel == 0x2e || psel == 0x2f)) { power5p_marked_instr_event() 459 unsigned int pmc, unit, byte, psel; power5p_compute_mmcr() local 474 pmc = (event[i] >> PM_PMC_SH) & PM_PMC_MSK; power5p_compute_mmcr() 475 if (pmc) { power5p_compute_mmcr() 476 if (pmc > 6) power5p_compute_mmcr() 478 if (pmc_inuse & (1 << (pmc - 1))) power5p_compute_mmcr() 480 pmc_inuse |= 1 << (pmc - 1); power5p_compute_mmcr() 552 pmc = (event[i] >> PM_PMC_SH) & PM_PMC_MSK; power5p_compute_mmcr() 557 if (!pmc) { power5p_compute_mmcr() 559 for (pmc = 0; pmc < 4; ++pmc) { power5p_compute_mmcr() 560 if (!(pmc_inuse & (1 << pmc))) power5p_compute_mmcr() 563 if (pmc >= 4) power5p_compute_mmcr() 565 pmc_inuse |= 1 << pmc; power5p_compute_mmcr() 566 } else if (pmc <= 4) { power5p_compute_mmcr() 568 --pmc; power5p_compute_mmcr() 572 mmcr1 |= 1ul << (MMCR1_PMC1_ADDER_SEL_SH - pmc); power5p_compute_mmcr() 575 --pmc; power5p_compute_mmcr() 584 if ((psel & 0x58) == 0x40 && (byte & 1) != ((pmc >> 1) & 1)) power5p_compute_mmcr() 587 if (pmc <= 3) power5p_compute_mmcr() 588 mmcr1 |= psel << MMCR1_PMCSEL_SH(pmc); power5p_compute_mmcr() 589 hwc[i] = pmc; power5p_compute_mmcr() 603 static void power5p_disable_pmc(unsigned int pmc, unsigned long mmcr[]) power5p_disable_pmc() argument 605 if (pmc <= 3) power5p_disable_pmc() 606 mmcr[1] &= ~(0x7fUL << MMCR1_PMCSEL_SH(pmc)); power5p_disable_pmc()
|
H A D | power5-pmu.c | 143 int pmc, byte, unit, sh; power5_get_constraint() local 148 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; power5_get_constraint() 149 if (pmc) { power5_get_constraint() 150 if (pmc > 6) power5_get_constraint() 152 sh = (pmc - 1) * 2; power5_get_constraint() 155 if (pmc <= 4) power5_get_constraint() 156 grp = (pmc - 1) >> 1; power5_get_constraint() 188 if (!pmc) power5_get_constraint() 203 if (pmc < 5) { power5_get_constraint() 255 int pmc, altpmc, pp, j; find_alternative_bdecode() local 257 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; find_alternative_bdecode() 258 if (pmc == 0 || pmc > 4) find_alternative_bdecode() 260 altpmc = 5 - pmc; /* 1 <-> 4, 2 <-> 3 */ find_alternative_bdecode() 263 if (bytedecode_alternatives[pmc - 1][j] == pp) { find_alternative_bdecode() 343 int pmc, psel; power5_marked_instr_event() local 347 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; power5_marked_instr_event() 349 if (pmc >= 5) power5_marked_instr_event() 354 if (direct_event_is_marked[psel] & (1 << pmc)) power5_marked_instr_event() 359 bit = pmc - 1; power5_marked_instr_event() 361 bit = 4 - pmc; power5_marked_instr_event() 362 else if (psel == 0x1b && (pmc == 1 || pmc == 3)) power5_marked_instr_event() 390 unsigned int pmc, unit, byte, psel; power5_compute_mmcr() local 407 pmc = (event[i] >> PM_PMC_SH) & PM_PMC_MSK; power5_compute_mmcr() 408 if (pmc) { power5_compute_mmcr() 409 if (pmc > 6) power5_compute_mmcr() 411 if (pmc_inuse & (1 << (pmc - 1))) power5_compute_mmcr() 413 pmc_inuse |= 1 << (pmc - 1); power5_compute_mmcr() 415 if (pmc <= 4) power5_compute_mmcr() 416 ++pmc_grp_use[(pmc - 1) >> 1]; power5_compute_mmcr() 431 if (!pmc) power5_compute_mmcr() 492 pmc = (event[i] >> PM_PMC_SH) & PM_PMC_MSK; power5_compute_mmcr() 497 if (!pmc) { power5_compute_mmcr() 499 for (pmc = 0; pmc < 4; ++pmc) { power5_compute_mmcr() 500 if (pmc_inuse & (1 << pmc)) power5_compute_mmcr() 502 grp = (pmc >> 1) & 1; power5_compute_mmcr() 511 pmc_inuse |= 1 << pmc; power5_compute_mmcr() 512 } else if (pmc <= 4) { power5_compute_mmcr() 514 --pmc; power5_compute_mmcr() 517 mmcr1 |= 1ul << (MMCR1_PMC1_ADDER_SEL_SH - pmc); power5_compute_mmcr() 520 --pmc; power5_compute_mmcr() 529 if (pmc <= 3) power5_compute_mmcr() 530 mmcr1 |= psel << MMCR1_PMCSEL_SH(pmc); power5_compute_mmcr() 531 hwc[i] = pmc; power5_compute_mmcr() 545 static void power5_disable_pmc(unsigned int pmc, unsigned long mmcr[]) power5_disable_pmc() argument 547 if (pmc <= 3) power5_disable_pmc() 548 mmcr[1] &= ~(0x7fUL << MMCR1_PMCSEL_SH(pmc)); power5_disable_pmc()
|
H A D | mpc7450-pmu.c | 43 int pmc; mpc7450_classify_event() local 45 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; mpc7450_classify_event() 46 if (pmc) { mpc7450_classify_event() 47 if (pmc > N_COUNTER) mpc7450_classify_event() 83 int pmc, sel; mpc7450_threshold_use() local 85 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; mpc7450_threshold_use() 87 switch (pmc) { mpc7450_threshold_use() 157 int pmc, class; mpc7450_get_constraint() local 165 pmc = ((unsigned int)event >> PM_PMC_SH) & PM_PMC_MSK; mpc7450_get_constraint() 166 mask = pmcbits[pmc - 1][0]; mpc7450_get_constraint() 167 value = pmcbits[pmc - 1][1]; mpc7450_get_constraint() 272 u32 ev, pmc, thresh; mpc7450_compute_mmcr() local 293 pmc = (ev >> PM_PMC_SH) & PM_PMC_MSK; mpc7450_compute_mmcr() 294 if (pmc_inuse & (1 << (pmc - 1))) mpc7450_compute_mmcr() 301 pmc = ffs(pmc_avail); mpc7450_compute_mmcr() 303 pmc_inuse |= 1 << (pmc - 1); mpc7450_compute_mmcr() 312 ev &= pmcsel_mask[pmc - 1]; mpc7450_compute_mmcr() 313 ev <<= pmcsel_shift[pmc - 1]; mpc7450_compute_mmcr() 314 if (pmc <= 2) mpc7450_compute_mmcr() 318 hwc[event_index[class][i]] = pmc - 1; mpc7450_compute_mmcr() 336 * Note that the pmc argument is 0-based here, not 1-based. 338 static void mpc7450_disable_pmc(unsigned int pmc, unsigned long mmcr[]) mpc7450_disable_pmc() argument 340 if (pmc <= 1) mpc7450_disable_pmc() 341 mmcr[0] &= ~(pmcsel_mask[pmc] << pmcsel_shift[pmc]); mpc7450_disable_pmc() 343 mmcr[1] &= ~(pmcsel_mask[pmc] << pmcsel_shift[pmc]); mpc7450_disable_pmc()
|
H A D | power6-pmu.c | 141 int pmc, psel, ptype; power6_marked_instr_event() local 145 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; power6_marked_instr_event() 147 if (pmc >= 5) power6_marked_instr_event() 153 if (pmc == 0 || !(ptype & (1 << (pmc - 1)))) power6_marked_instr_event() 161 bit = ptype ^ (pmc - 1); power6_marked_instr_event() 183 unsigned int pmc, ev, b, u, s, psel; p6_compute_mmcr() local 190 pmc = (event[i] >> PM_PMC_SH) & PM_PMC_MSK; p6_compute_mmcr() 191 if (pmc) { p6_compute_mmcr() 192 if (pmc_inuse & (1 << (pmc - 1))) p6_compute_mmcr() 194 pmc_inuse |= 1 << (pmc - 1); p6_compute_mmcr() 199 pmc = (ev >> PM_PMC_SH) & PM_PMC_MSK; p6_compute_mmcr() 200 if (pmc) { p6_compute_mmcr() 201 --pmc; p6_compute_mmcr() 204 for (pmc = 0; pmc < 4; ++pmc) p6_compute_mmcr() 205 if (!(pmc_inuse & (1 << pmc))) p6_compute_mmcr() 207 if (pmc >= 4) p6_compute_mmcr() 209 pmc_inuse |= 1 << pmc; p6_compute_mmcr() 211 hwc[i] = pmc; p6_compute_mmcr() 234 mmcr1 |= MMCR1_PMC1_ADDR_SEL >> pmc; p6_compute_mmcr() 237 if (pmc >= 2 && (psel & 0x90) == 0x80) p6_compute_mmcr() 241 mmcr1 |= MMCR1_PMC1_LLA >> pmc; p6_compute_mmcr() 243 mmcr1 |= MMCR1_PMC1_LLA_VALUE >> pmc; p6_compute_mmcr() 247 if (pmc < 4) p6_compute_mmcr() 248 mmcr1 |= (unsigned long)psel << MMCR1_PMCSEL_SH(pmc); p6_compute_mmcr() 273 int pmc, byte, sh, subunit; p6_get_constraint() local 276 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; p6_get_constraint() 277 if (pmc) { p6_get_constraint() 278 if (pmc > 4 && !(event == 0x500009 || event == 0x600005)) p6_get_constraint() 280 sh = (pmc - 1) * 2; p6_get_constraint() 295 if (pmc <= 4) { p6_get_constraint() 306 int pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; p6_limited_pmc_event() local 308 return pmc == 5 || pmc == 6; p6_limited_pmc_event() 365 unsigned int psel, pmc; p6_get_alternatives() local 389 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; p6_get_alternatives() 390 if (pmc && (psel == 0x32 || psel == 0x34)) p6_get_alternatives() 392 ((5 - pmc) << PM_PMC_SH); p6_get_alternatives() 395 if (pmc && (psel == 0x38 || psel == 0x3a)) p6_get_alternatives() 397 ((pmc > 2? pmc - 2: pmc + 2) << PM_PMC_SH); p6_get_alternatives() 464 static void p6_disable_pmc(unsigned int pmc, unsigned long mmcr[]) p6_disable_pmc() argument 467 if (pmc <= 3) p6_disable_pmc() 468 mmcr[1] &= ~(0xffUL << MMCR1_PMCSEL_SH(pmc)); p6_disable_pmc()
|
H A D | power4-pmu.c | 220 int pmc, psel, unit, byte, bit; p4_marked_instr_event() local 223 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; p4_marked_instr_event() 225 if (pmc) { p4_marked_instr_event() 226 if (direct_marked_event[pmc - 1] & (1 << psel)) p4_marked_instr_event() 229 bit = (pmc <= 4)? pmc - 1: 8 - pmc; p4_marked_instr_event() 257 int pmc, byte, unit, lower, sh; p4_get_constraint() local 261 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; p4_get_constraint() 262 if (pmc) { p4_get_constraint() 263 if (pmc > 8) p4_get_constraint() 265 sh = (pmc - 1) * 2; p4_get_constraint() 268 grp = ((pmc - 1) >> 1) & 1; p4_get_constraint() 279 if (!pmc) p4_get_constraint() 314 if (pmc && (event & PM_PMCSEL_MSK) == 6 && byte == 2) p4_get_constraint() 362 unsigned int pmc, unit, byte, psel, lower; p4_compute_mmcr() local 379 pmc = (event[i] >> PM_PMC_SH) & PM_PMC_MSK; p4_compute_mmcr() 380 if (pmc) { p4_compute_mmcr() 381 if (pmc_inuse & (1 << (pmc - 1))) p4_compute_mmcr() 383 pmc_inuse |= 1 << (pmc - 1); p4_compute_mmcr() 385 ++pmc_grp_use[((pmc - 1) >> 1) & 1]; p4_compute_mmcr() 391 if (!pmc) p4_compute_mmcr() 471 pmc = (event[i] >> PM_PMC_SH) & PM_PMC_MSK; p4_compute_mmcr() 475 if (!pmc) { p4_compute_mmcr() 479 for (pmc = 0; pmc < 8; ++pmc) { p4_compute_mmcr() 480 if (pmc_inuse & (1 << pmc)) p4_compute_mmcr() 482 grp = (pmc >> 1) & 1; p4_compute_mmcr() 491 pmc_inuse |= 1 << pmc; p4_compute_mmcr() 494 --pmc; p4_compute_mmcr() 497 mmcr1 |= 1ull << mmcr1_adder_bits[pmc]; p4_compute_mmcr() 503 if (pmc <= 1) p4_compute_mmcr() 504 mmcr0 |= psel << (MMCR0_PMC1SEL_SH - 7 * pmc); p4_compute_mmcr() 506 mmcr1 |= psel << (MMCR1_PMC3SEL_SH - 5 * (pmc - 2)); p4_compute_mmcr() 507 if (pmc == 7) /* PMC8 */ p4_compute_mmcr() 509 hwc[i] = pmc; p4_compute_mmcr() 528 static void p4_disable_pmc(unsigned int pmc, unsigned long mmcr[]) p4_disable_pmc() argument 532 * (Note that pmc is 0-based here, not 1-based.) p4_disable_pmc() 534 if (pmc <= 1) { p4_disable_pmc() 535 mmcr[0] &= ~(0x1fUL << (MMCR0_PMC1SEL_SH - 7 * pmc)); p4_disable_pmc() 537 mmcr[1] &= ~(0x1fUL << (MMCR1_PMC3SEL_SH - 5 * (pmc - 2))); p4_disable_pmc() 538 if (pmc == 7) p4_disable_pmc()
|
H A D | power8-pmu.c | 76 * [ ] [ sample ] [cache] [ pmc ] [unit ] c m [ pmcxsel ] 90 * if pmc == 3 and unit == 0 and pmcxsel[0:6] == 0b0101011 93 * else if pmc == 4 and unit == 0xf and pmcxsel[0:6] == 0b0101001 243 #define CNST_PMC_SHIFT(pmc) ((pmc - 1) * 2) 244 #define CNST_PMC_VAL(pmc) (1 << CNST_PMC_SHIFT(pmc)) 245 #define CNST_PMC_MASK(pmc) (2 << CNST_PMC_SHIFT(pmc)) 254 #define MMCR1_UNIT_SHIFT(pmc) (60 - (4 * ((pmc) - 1))) 255 #define MMCR1_COMBINE_SHIFT(pmc) (35 - ((pmc) - 1)) 256 #define MMCR1_PMCSEL_SHIFT(pmc) (24 - (((pmc) - 1)) * 8) 271 #define MMCR2_FCS(pmc) (1ull << (63 - (((pmc) - 1) * 9))) 272 #define MMCR2_FCP(pmc) (1ull << (62 - (((pmc) - 1) * 9))) 273 #define MMCR2_FCH(pmc) (1ull << (57 - (((pmc) - 1) * 9))) 278 /* Only check pmc, unit and pmcxsel, ignore the edge bit (0) */ event_is_fab_match() 287 unsigned int unit, pmc, cache, ebb; power8_get_constraint() local 295 pmc = (event >> EVENT_PMC_SHIFT) & EVENT_PMC_MASK; power8_get_constraint() 300 if (pmc) { power8_get_constraint() 303 if (pmc > 6) power8_get_constraint() 309 if (pmc >= 5 && base_event != 0x500fa && base_event != 0x600f4) power8_get_constraint() 312 mask |= CNST_PMC_MASK(pmc); power8_get_constraint() 313 value |= CNST_PMC_VAL(pmc); power8_get_constraint() 316 if (pmc <= 4) { power8_get_constraint() 374 if (!pmc && ebb) power8_get_constraint() 406 unsigned int pmc, pmc_inuse; power8_compute_mmcr() local 413 pmc = (event[i] >> EVENT_PMC_SHIFT) & EVENT_PMC_MASK; power8_compute_mmcr() 414 if (pmc) power8_compute_mmcr() 415 pmc_inuse |= 1 << pmc; power8_compute_mmcr() 424 pmc = (event[i] >> EVENT_PMC_SHIFT) & EVENT_PMC_MASK; power8_compute_mmcr() 429 if (!pmc) { power8_compute_mmcr() 430 for (pmc = 1; pmc <= 4; ++pmc) { power8_compute_mmcr() 431 if (!(pmc_inuse & (1 << pmc))) power8_compute_mmcr() 435 pmc_inuse |= 1 << pmc; power8_compute_mmcr() 438 if (pmc <= 4) { power8_compute_mmcr() 439 mmcr1 |= unit << MMCR1_UNIT_SHIFT(pmc); power8_compute_mmcr() 440 mmcr1 |= combine << MMCR1_COMBINE_SHIFT(pmc); power8_compute_mmcr() 441 mmcr1 |= psel << MMCR1_PMCSEL_SHIFT(pmc); power8_compute_mmcr() 483 mmcr2 |= MMCR2_FCP(pmc); power8_compute_mmcr() 486 mmcr2 |= MMCR2_FCH(pmc); power8_compute_mmcr() 490 mmcr2 |= MMCR2_FCH(pmc); power8_compute_mmcr() 492 mmcr2 |= MMCR2_FCS(pmc); power8_compute_mmcr() 495 hwc[i] = pmc - 1; power8_compute_mmcr() 601 static void power8_disable_pmc(unsigned int pmc, unsigned long mmcr[]) power8_disable_pmc() argument 603 if (pmc <= 3) power8_disable_pmc() 604 mmcr[1] &= ~(0xffUL << MMCR1_PMCSEL_SHIFT(pmc + 1)); power8_disable_pmc() 612 PMU_FORMAT_ATTR(pmc, "config:16-19");
|
H A D | core-fsl-emb.c | 18 #include <asm/pmc.h>
|
H A D | core-book3s.c | 18 #include <asm/pmc.h>
|
/linux-4.4.14/drivers/soc/tegra/ |
H A D | pmc.c | 2 * drivers/soc/tegra/pmc.c 20 #define pr_fmt(fmt) "tegra-pmc: " fmt 41 #include <soc/tegra/pmc.h> 158 static struct tegra_pmc *pmc = &(struct tegra_pmc) { variable in typeref:struct:tegra_pmc 165 return readl(pmc->base + offset); tegra_pmc_readl() 170 writel(value, pmc->base + offset); tegra_pmc_writel() 182 mutex_lock(&pmc->powergates_lock); tegra_powergate_set() 187 mutex_unlock(&pmc->powergates_lock); tegra_powergate_set() 193 mutex_unlock(&pmc->powergates_lock); tegra_powergate_set() 204 if (!pmc->soc || id < 0 || id >= pmc->soc->num_powergates) tegra_powergate_power_on() 216 if (!pmc->soc || id < 0 || id >= pmc->soc->num_powergates) tegra_powergate_power_off() 231 if (!pmc->soc || id < 0 || id >= pmc->soc->num_powergates) tegra_powergate_is_powered() 246 if (!pmc->soc || id < 0 || id >= pmc->soc->num_powergates) tegra_powergate_remove_clamping() 254 if (pmc->soc->has_gpu_clamps) { tegra_powergate_remove_clamping() 330 if (pmc->soc && cpuid > 0 && cpuid < pmc->soc->num_cpu_powergates) tegra_get_cpu_powergate_id() 331 return pmc->soc->cpu_powergates[cpuid]; tegra_get_cpu_powergate_id() 423 for (i = 0; i < pmc->soc->num_powergates; i++) { powergate_show() 424 if (!pmc->soc->powergates[i]) powergate_show() 427 seq_printf(s, " %9s %7s\n", pmc->soc->powergates[i], powergate_show() 480 rate = clk_get_rate(pmc->clk); tegra_io_rail_prepare() 578 return pmc->suspend_mode; tegra_pmc_get_suspend_mode() 586 pmc->suspend_mode = mode; tegra_pmc_set_suspend_mode() 600 rate = clk_get_rate(pmc->clk); tegra_pmc_enter_suspend_mode() 610 if (rate != pmc->rate) { tegra_pmc_enter_suspend_mode() 613 ticks = pmc->cpu_good_time * rate + USEC_PER_SEC - 1; tegra_pmc_enter_suspend_mode() 617 ticks = pmc->cpu_off_time * rate + USEC_PER_SEC - 1; tegra_pmc_enter_suspend_mode() 623 pmc->rate = rate; tegra_pmc_enter_suspend_mode() 633 static int tegra_pmc_parse_dt(struct tegra_pmc *pmc, struct device_node *np) tegra_pmc_parse_dt() argument 641 pmc->suspend_mode = TEGRA_SUSPEND_LP0; tegra_pmc_parse_dt() 645 pmc->suspend_mode = TEGRA_SUSPEND_LP1; tegra_pmc_parse_dt() 649 pmc->suspend_mode = TEGRA_SUSPEND_LP2; tegra_pmc_parse_dt() 653 pmc->suspend_mode = TEGRA_SUSPEND_NONE; tegra_pmc_parse_dt() 658 pmc->suspend_mode = tegra_pm_validate_suspend_mode(pmc->suspend_mode); tegra_pmc_parse_dt() 661 pmc->suspend_mode = TEGRA_SUSPEND_NONE; tegra_pmc_parse_dt() 663 pmc->cpu_good_time = value; tegra_pmc_parse_dt() 666 pmc->suspend_mode = TEGRA_SUSPEND_NONE; tegra_pmc_parse_dt() 668 pmc->cpu_off_time = value; tegra_pmc_parse_dt() 672 pmc->suspend_mode = TEGRA_SUSPEND_NONE; tegra_pmc_parse_dt() 674 pmc->core_osc_time = values[0]; tegra_pmc_parse_dt() 675 pmc->core_pmu_time = values[1]; tegra_pmc_parse_dt() 678 pmc->suspend_mode = TEGRA_SUSPEND_NONE; tegra_pmc_parse_dt() 680 pmc->core_off_time = value; tegra_pmc_parse_dt() 682 pmc->corereq_high = of_property_read_bool(np, tegra_pmc_parse_dt() 685 pmc->sysclkreq_high = of_property_read_bool(np, tegra_pmc_parse_dt() 688 pmc->combined_req = of_property_read_bool(np, tegra_pmc_parse_dt() 691 pmc->cpu_pwr_good_en = of_property_read_bool(np, tegra_pmc_parse_dt() 696 if (pmc->suspend_mode == TEGRA_SUSPEND_LP0) tegra_pmc_parse_dt() 697 pmc->suspend_mode = TEGRA_SUSPEND_LP1; tegra_pmc_parse_dt() 699 pmc->lp0_vec_phys = values[0]; tegra_pmc_parse_dt() 700 pmc->lp0_vec_size = values[1]; tegra_pmc_parse_dt() 705 static void tegra_pmc_init(struct tegra_pmc *pmc) tegra_pmc_init() argument 716 if (pmc->sysclkreq_high) tegra_pmc_init() 730 void tegra_pmc_init_tsense_reset(struct tegra_pmc *pmc) tegra_pmc_init_tsense_reset() argument 734 struct device *dev = pmc->dev; tegra_pmc_init_tsense_reset() 738 if (!pmc->soc->has_tsense_reset) tegra_pmc_init_tsense_reset() 741 np = of_find_node_by_name(pmc->dev->of_node, "i2c-thermtrip"); tegra_pmc_init_tsense_reset() 800 dev_info(pmc->dev, "emergency thermal reset enabled\n"); tegra_pmc_init_tsense_reset() 808 void __iomem *base = pmc->base; tegra_pmc_probe() 812 err = tegra_pmc_parse_dt(pmc, pdev->dev.of_node); tegra_pmc_probe() 818 pmc->base = devm_ioremap_resource(&pdev->dev, res); tegra_pmc_probe() 819 if (IS_ERR(pmc->base)) tegra_pmc_probe() 820 return PTR_ERR(pmc->base); tegra_pmc_probe() 824 pmc->clk = devm_clk_get(&pdev->dev, "pclk"); tegra_pmc_probe() 825 if (IS_ERR(pmc->clk)) { tegra_pmc_probe() 826 err = PTR_ERR(pmc->clk); tegra_pmc_probe() 831 pmc->dev = &pdev->dev; tegra_pmc_probe() 833 tegra_pmc_init(pmc); tegra_pmc_probe() 835 tegra_pmc_init_tsense_reset(pmc); tegra_pmc_probe() 1052 { .compatible = "nvidia,tegra210-pmc", .data = &tegra210_pmc_soc }, 1053 { .compatible = "nvidia,tegra132-pmc", .data = &tegra124_pmc_soc }, 1054 { .compatible = "nvidia,tegra124-pmc", .data = &tegra124_pmc_soc }, 1055 { .compatible = "nvidia,tegra114-pmc", .data = &tegra114_pmc_soc }, 1056 { .compatible = "nvidia,tegra30-pmc", .data = &tegra30_pmc_soc }, 1057 { .compatible = "nvidia,tegra20-pmc", .data = &tegra20_pmc_soc }, 1063 .name = "tegra-pmc", 1123 pmc->soc = match->data; tegra_pmc_early_init() 1126 pmc->base = ioremap_nocache(regs.start, resource_size(®s)); tegra_pmc_early_init() 1127 if (!pmc->base) { tegra_pmc_early_init() 1132 mutex_init(&pmc->powergates_lock); tegra_pmc_early_init()
|
/linux-4.4.14/tools/testing/selftests/powerpc/pmu/ebb/ |
H A D | ebb.h | 14 #define PMC_INDEX(pmc) ((pmc)-1) 41 static inline void ebb_enable_pmc_counting(int pmc) ebb_enable_pmc_counting() argument 43 ebb_state.pmc_enable[PMC_INDEX(pmc)] = true; ebb_enable_pmc_counting() 46 bool ebb_check_count(int pmc, u64 sample_period, int fudge); 60 int count_pmc(int pmc, uint32_t sample_period); 65 void write_pmc(int pmc, u64 value); 66 u64 read_pmc(int pmc);
|
H A D | ebb.c | 73 bool ebb_check_count(int pmc, u64 sample_period, int fudge) ebb_check_count() argument 77 count = ebb_state.stats.pmc_count[PMC_INDEX(pmc)]; ebb_check_count() 83 pmc, count, lower, lower - count); ebb_check_count() 91 pmc, count, upper, count - upper); ebb_check_count() 96 pmc, count, lower, upper, count - lower, upper - count); ebb_check_count() 173 " pmc[1] count = 0x%llx\n" \ dump_summary_ebb_state() 174 " pmc[2] count = 0x%llx\n" \ dump_summary_ebb_state() 175 " pmc[3] count = 0x%llx\n" \ dump_summary_ebb_state() 176 " pmc[4] count = 0x%llx\n" \ dump_summary_ebb_state() 177 " pmc[5] count = 0x%llx\n" \ dump_summary_ebb_state() 178 " pmc[6] count = 0x%llx\n", dump_summary_ebb_state() 254 int count_pmc(int pmc, uint32_t sample_period) count_pmc() argument 262 val = read_pmc(pmc); count_pmc() 266 ebb_state.stats.pmc_count[PMC_INDEX(pmc)] += val - start_value; count_pmc() 268 trace_log_reg(ebb_state.trace, SPRN_PMC1 + pmc - 1, val); count_pmc() 271 write_pmc(pmc, start_value); count_pmc() 444 void write_pmc(int pmc, u64 value) write_pmc() argument 446 switch (pmc) { write_pmc() 456 u64 read_pmc(int pmc) read_pmc() argument 458 switch (pmc) { read_pmc()
|
/linux-4.4.14/net/ipv4/ |
H A D | igmp.c | 173 static int sf_setstate(struct ip_mc_list *pmc); 174 static void sf_markstate(struct ip_mc_list *pmc); 176 static void ip_mc_clear_src(struct ip_mc_list *pmc); 188 #define for_each_pmc_rcu(in_dev, pmc) \ 189 for (pmc = rcu_dereference(in_dev->mc_list); \ 190 pmc != NULL; \ 191 pmc = rcu_dereference(pmc->next_rcu)) 193 #define for_each_pmc_rtnl(in_dev, pmc) \ 194 for (pmc = rtnl_dereference(in_dev->mc_list); \ 195 pmc != NULL; \ 196 pmc = rtnl_dereference(pmc->next_rcu)) 267 static int is_in(struct ip_mc_list *pmc, struct ip_sf_list *psf, int type, is_in() argument 275 if (!(pmc->gsquery && !psf->sf_gsresp)) { is_in() 276 if (pmc->sfmode == MCAST_INCLUDE) is_in() 283 return pmc->sfcount[MCAST_EXCLUDE] == is_in() 294 if (pmc->sfcount[MCAST_EXCLUDE] == 0 || is_in() 297 return pmc->sfcount[MCAST_EXCLUDE] == is_in() 302 return (pmc->sfmode == MCAST_INCLUDE) ^ sdeleted; is_in() 304 if (pmc->sfmode == MCAST_INCLUDE) is_in() 312 igmp_scount(struct ip_mc_list *pmc, int type, int gdeleted, int sdeleted) igmp_scount() argument 317 for (psf = pmc->sources; psf; psf = psf->sf_next) { igmp_scount() 318 if (!is_in(pmc, psf, type, gdeleted, sdeleted)) igmp_scount() 402 static int grec_size(struct ip_mc_list *pmc, int type, int gdel, int sdel) grec_size() argument 404 return sizeof(struct igmpv3_grec) + 4*igmp_scount(pmc, type, gdel, sdel); grec_size() 407 static struct sk_buff *add_grhead(struct sk_buff *skb, struct ip_mc_list *pmc, add_grhead() argument 410 struct net_device *dev = pmc->interface->dev; add_grhead() 422 pgr->grec_mca = pmc->multiaddr; add_grhead() 431 static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc, add_grec() argument 434 struct net_device *dev = pmc->interface->dev; add_grec() 440 if (pmc->multiaddr == IGMP_ALL_HOSTS) add_grec() 442 if (ipv4_is_local_multicast(pmc->multiaddr) && !sysctl_igmp_llm_reports) add_grec() 452 psf_list = sdeleted ? &pmc->tomb : &pmc->sources; add_grec() 462 AVAILABLE(skb) < grec_size(pmc, type, gdeleted, sdeleted)) { add_grec() 475 if (!is_in(pmc, psf, type, gdeleted, sdeleted)) { add_grec() 497 skb = add_grhead(skb, pmc, type, &pgr); add_grec() 525 if (pmc->crcount || isquery) { add_grec() 531 skb = add_grhead(skb, pmc, type, &pgr); add_grec() 538 pmc->gsquery = 0; /* clear query state on report */ add_grec() 542 static int igmpv3_send_report(struct in_device *in_dev, struct ip_mc_list *pmc) igmpv3_send_report() argument 547 if (!pmc) { igmpv3_send_report() 549 for_each_pmc_rcu(in_dev, pmc) { for_each_pmc_rcu() 550 if (pmc->multiaddr == IGMP_ALL_HOSTS) for_each_pmc_rcu() 552 if (ipv4_is_local_multicast(pmc->multiaddr) && for_each_pmc_rcu() 555 spin_lock_bh(&pmc->lock); for_each_pmc_rcu() 556 if (pmc->sfcount[MCAST_EXCLUDE]) for_each_pmc_rcu() 560 skb = add_grec(skb, pmc, type, 0, 0); for_each_pmc_rcu() 561 spin_unlock_bh(&pmc->lock); for_each_pmc_rcu() 565 spin_lock_bh(&pmc->lock); 566 if (pmc->sfcount[MCAST_EXCLUDE]) 570 skb = add_grec(skb, pmc, type, 0, 0); 571 spin_unlock_bh(&pmc->lock); 601 struct ip_mc_list *pmc, *pmc_prev, *pmc_next; igmpv3_send_cr() local 610 for (pmc = in_dev->mc_tomb; pmc; pmc = pmc_next) { igmpv3_send_cr() 611 pmc_next = pmc->next; igmpv3_send_cr() 612 if (pmc->sfmode == MCAST_INCLUDE) { igmpv3_send_cr() 615 skb = add_grec(skb, pmc, type, 1, 0); igmpv3_send_cr() 616 skb = add_grec(skb, pmc, dtype, 1, 1); igmpv3_send_cr() 618 if (pmc->crcount) { igmpv3_send_cr() 619 if (pmc->sfmode == MCAST_EXCLUDE) { igmpv3_send_cr() 621 skb = add_grec(skb, pmc, type, 1, 0); igmpv3_send_cr() 623 pmc->crcount--; igmpv3_send_cr() 624 if (pmc->crcount == 0) { igmpv3_send_cr() 625 igmpv3_clear_zeros(&pmc->tomb); igmpv3_send_cr() 626 igmpv3_clear_zeros(&pmc->sources); igmpv3_send_cr() 629 if (pmc->crcount == 0 && !pmc->tomb && !pmc->sources) { igmpv3_send_cr() 634 in_dev_put(pmc->interface); igmpv3_send_cr() 635 kfree(pmc); igmpv3_send_cr() 637 pmc_prev = pmc; igmpv3_send_cr() 642 for_each_pmc_rcu(in_dev, pmc) { for_each_pmc_rcu() 643 spin_lock_bh(&pmc->lock); for_each_pmc_rcu() 644 if (pmc->sfcount[MCAST_EXCLUDE]) { for_each_pmc_rcu() 651 skb = add_grec(skb, pmc, type, 0, 0); for_each_pmc_rcu() 652 skb = add_grec(skb, pmc, dtype, 0, 1); /* deleted sources */ for_each_pmc_rcu() 655 if (pmc->crcount) { for_each_pmc_rcu() 656 if (pmc->sfmode == MCAST_EXCLUDE) for_each_pmc_rcu() 660 skb = add_grec(skb, pmc, type, 0, 0); for_each_pmc_rcu() 661 pmc->crcount--; for_each_pmc_rcu() 663 spin_unlock_bh(&pmc->lock); for_each_pmc_rcu() 672 static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc, igmp_send_report() argument 681 __be32 group = pmc ? pmc->multiaddr : 0; igmp_send_report() 687 return igmpv3_send_report(in_dev, pmc); igmp_send_report() 801 static int igmp_xmarksources(struct ip_mc_list *pmc, int nsrcs, __be32 *srcs) igmp_xmarksources() argument 807 for (psf = pmc->sources; psf; psf = psf->sf_next) { igmp_xmarksources() 813 pmc->sfcount[MCAST_EXCLUDE] != igmp_xmarksources() 822 pmc->gsquery = 0; igmp_xmarksources() 828 static int igmp_marksources(struct ip_mc_list *pmc, int nsrcs, __be32 *srcs) igmp_marksources() argument 833 if (pmc->sfmode == MCAST_EXCLUDE) igmp_marksources() 834 return igmp_xmarksources(pmc, nsrcs, srcs); igmp_marksources() 838 for (psf = pmc->sources; psf; psf = psf->sf_next) { igmp_marksources() 849 pmc->gsquery = 0; igmp_marksources() 852 pmc->gsquery = 1; igmp_marksources() 1089 struct ip_mc_list *pmc; igmpv3_add_delrec() local 1097 pmc = kzalloc(sizeof(*pmc), GFP_KERNEL); igmpv3_add_delrec() 1098 if (!pmc) igmpv3_add_delrec() 1101 pmc->interface = im->interface; igmpv3_add_delrec() 1103 pmc->multiaddr = im->multiaddr; igmpv3_add_delrec() 1104 pmc->crcount = in_dev->mr_qrv ?: sysctl_igmp_qrv; igmpv3_add_delrec() 1105 pmc->sfmode = im->sfmode; igmpv3_add_delrec() 1106 if (pmc->sfmode == MCAST_INCLUDE) { igmpv3_add_delrec() 1109 pmc->tomb = im->tomb; igmpv3_add_delrec() 1110 pmc->sources = im->sources; igmpv3_add_delrec() 1112 for (psf = pmc->sources; psf; psf = psf->sf_next) igmpv3_add_delrec() 1113 psf->sf_crcount = pmc->crcount; igmpv3_add_delrec() 1118 pmc->next = in_dev->mc_tomb; igmpv3_add_delrec() 1119 in_dev->mc_tomb = pmc; igmpv3_add_delrec() 1125 struct ip_mc_list *pmc, *pmc_prev; igmpv3_del_delrec() local 1130 for (pmc = in_dev->mc_tomb; pmc; pmc = pmc->next) { igmpv3_del_delrec() 1131 if (pmc->multiaddr == multiaddr) igmpv3_del_delrec() 1133 pmc_prev = pmc; igmpv3_del_delrec() 1135 if (pmc) { igmpv3_del_delrec() 1137 pmc_prev->next = pmc->next; igmpv3_del_delrec() 1139 in_dev->mc_tomb = pmc->next; igmpv3_del_delrec() 1142 if (pmc) { igmpv3_del_delrec() 1143 for (psf = pmc->tomb; psf; psf = psf_next) { igmpv3_del_delrec() 1147 in_dev_put(pmc->interface); igmpv3_del_delrec() 1148 kfree(pmc); igmpv3_del_delrec() 1154 struct ip_mc_list *pmc, *nextpmc; igmpv3_clear_delrec() local 1157 pmc = in_dev->mc_tomb; igmpv3_clear_delrec() 1161 for (; pmc; pmc = nextpmc) { igmpv3_clear_delrec() 1162 nextpmc = pmc->next; igmpv3_clear_delrec() 1163 ip_mc_clear_src(pmc); igmpv3_clear_delrec() 1164 in_dev_put(pmc->interface); igmpv3_clear_delrec() 1165 kfree(pmc); igmpv3_clear_delrec() 1169 for_each_pmc_rcu(in_dev, pmc) { for_each_pmc_rcu() 1172 spin_lock_bh(&pmc->lock); for_each_pmc_rcu() 1173 psf = pmc->tomb; for_each_pmc_rcu() 1174 pmc->tomb = NULL; for_each_pmc_rcu() 1175 spin_unlock_bh(&pmc->lock); for_each_pmc_rcu() 1597 struct ip_mc_list *pmc; ip_mc_unmap() local 1601 for_each_pmc_rtnl(in_dev, pmc) ip_mc_unmap() 1602 igmp_group_dropped(pmc); ip_mc_unmap() 1607 struct ip_mc_list *pmc; ip_mc_remap() local 1611 for_each_pmc_rtnl(in_dev, pmc) ip_mc_remap() 1612 igmp_group_added(pmc); ip_mc_remap() 1619 struct ip_mc_list *pmc; ip_mc_down() local 1623 for_each_pmc_rtnl(in_dev, pmc) ip_mc_down() 1624 igmp_group_dropped(pmc); ip_mc_down() 1658 struct ip_mc_list *pmc; ip_mc_up() local 1667 for_each_pmc_rtnl(in_dev, pmc) ip_mc_up() 1668 igmp_group_added(pmc); ip_mc_up() 1735 static int ip_mc_del1_src(struct ip_mc_list *pmc, int sfmode, ip_mc_del1_src() argument 1742 for (psf = pmc->sources; psf; psf = psf->sf_next) { ip_mc_del1_src() 1753 ip_rt_multicast_event(pmc->interface); ip_mc_del1_src() 1757 struct in_device *in_dev = pmc->interface; ip_mc_del1_src() 1764 pmc->sources = psf->sf_next; ip_mc_del1_src() 1769 psf->sf_next = pmc->tomb; ip_mc_del1_src() 1770 pmc->tomb = psf; ip_mc_del1_src() 1786 struct ip_mc_list *pmc; ip_mc_del_src() local 1793 for_each_pmc_rcu(in_dev, pmc) { for_each_pmc_rcu() 1794 if (*pmca == pmc->multiaddr) for_each_pmc_rcu() 1797 if (!pmc) { 1802 spin_lock_bh(&pmc->lock); 1805 sf_markstate(pmc); 1809 if (!pmc->sfcount[sfmode]) 1811 pmc->sfcount[sfmode]--; 1815 int rv = ip_mc_del1_src(pmc, sfmode, &psfsrc[i]); 1821 if (pmc->sfmode == MCAST_EXCLUDE && 1822 pmc->sfcount[MCAST_EXCLUDE] == 0 && 1823 pmc->sfcount[MCAST_INCLUDE]) { 1829 pmc->sfmode = MCAST_INCLUDE; 1831 pmc->crcount = in_dev->mr_qrv ?: sysctl_igmp_qrv; 1832 in_dev->mr_ifc_count = pmc->crcount; 1833 for (psf = pmc->sources; psf; psf = psf->sf_next) 1835 igmp_ifc_event(pmc->interface); 1836 } else if (sf_setstate(pmc) || changerec) { 1837 igmp_ifc_event(pmc->interface); 1841 spin_unlock_bh(&pmc->lock); 1848 static int ip_mc_add1_src(struct ip_mc_list *pmc, int sfmode, ip_mc_add1_src() argument 1854 for (psf = pmc->sources; psf; psf = psf->sf_next) { ip_mc_add1_src() 1867 pmc->sources = psf; ip_mc_add1_src() 1871 ip_rt_multicast_event(pmc->interface); ip_mc_add1_src() 1877 static void sf_markstate(struct ip_mc_list *pmc) sf_markstate() argument 1880 int mca_xcount = pmc->sfcount[MCAST_EXCLUDE]; sf_markstate() 1882 for (psf = pmc->sources; psf; psf = psf->sf_next) sf_markstate() 1883 if (pmc->sfcount[MCAST_EXCLUDE]) { sf_markstate() 1891 static int sf_setstate(struct ip_mc_list *pmc) sf_setstate() argument 1894 int mca_xcount = pmc->sfcount[MCAST_EXCLUDE]; sf_setstate() 1895 int qrv = pmc->interface->mr_qrv; sf_setstate() 1899 for (psf = pmc->sources; psf; psf = psf->sf_next) { sf_setstate() 1900 if (pmc->sfcount[MCAST_EXCLUDE]) { sf_setstate() 1909 for (dpsf = pmc->tomb; dpsf; dpsf = dpsf->sf_next) { sf_setstate() 1918 pmc->tomb = dpsf->sf_next; sf_setstate() 1931 for (dpsf = pmc->tomb; dpsf; dpsf = dpsf->sf_next) sf_setstate() 1939 /* pmc->lock held by callers */ sf_setstate() 1940 dpsf->sf_next = pmc->tomb; sf_setstate() 1941 pmc->tomb = dpsf; sf_setstate() 1957 struct ip_mc_list *pmc; ip_mc_add_src() local 1964 for_each_pmc_rcu(in_dev, pmc) { for_each_pmc_rcu() 1965 if (*pmca == pmc->multiaddr) for_each_pmc_rcu() 1968 if (!pmc) { 1973 spin_lock_bh(&pmc->lock); 1977 sf_markstate(pmc); 1979 isexclude = pmc->sfmode == MCAST_EXCLUDE; 1981 pmc->sfcount[sfmode]++; 1984 err = ip_mc_add1_src(pmc, sfmode, &psfsrc[i]); 1992 pmc->sfcount[sfmode]--; 1994 (void) ip_mc_del1_src(pmc, sfmode, &psfsrc[j]); 1995 } else if (isexclude != (pmc->sfcount[MCAST_EXCLUDE] != 0)) { 1998 in_dev = pmc->interface; 2002 if (pmc->sfcount[MCAST_EXCLUDE]) 2003 pmc->sfmode = MCAST_EXCLUDE; 2004 else if (pmc->sfcount[MCAST_INCLUDE]) 2005 pmc->sfmode = MCAST_INCLUDE; 2009 pmc->crcount = in_dev->mr_qrv ?: sysctl_igmp_qrv; 2010 in_dev->mr_ifc_count = pmc->crcount; 2011 for (psf = pmc->sources; psf; psf = psf->sf_next) 2014 } else if (sf_setstate(pmc)) { 2018 spin_unlock_bh(&pmc->lock); 2022 static void ip_mc_clear_src(struct ip_mc_list *pmc) ip_mc_clear_src() argument 2026 for (psf = pmc->tomb; psf; psf = nextpsf) { ip_mc_clear_src() 2030 pmc->tomb = NULL; ip_mc_clear_src() 2031 for (psf = pmc->sources; psf; psf = nextpsf) { ip_mc_clear_src() 2035 pmc->sources = NULL; ip_mc_clear_src() 2036 pmc->sfmode = MCAST_EXCLUDE; ip_mc_clear_src() 2037 pmc->sfcount[MCAST_INCLUDE] = 0; ip_mc_clear_src() 2038 pmc->sfcount[MCAST_EXCLUDE] = 1; ip_mc_clear_src() 2168 struct ip_mc_socklist *pmc; ip_mc_source() local 2192 for_each_pmc_rtnl(inet, pmc) { for_each_pmc_rtnl() 2193 if ((pmc->multi.imr_multiaddr.s_addr == for_each_pmc_rtnl() 2195 (pmc->multi.imr_ifindex == imr.imr_ifindex)) for_each_pmc_rtnl() 2198 if (!pmc) { /* must have a prior join */ 2203 if (pmc->sflist) { 2204 if (pmc->sfmode != omode) { 2208 } else if (pmc->sfmode != omode) { 2211 ip_mc_del_src(in_dev, &mreqs->imr_multiaddr, pmc->sfmode, 0, 2213 pmc->sfmode = omode; 2216 psl = rtnl_dereference(pmc->sflist); 2272 rcu_assign_pointer(pmc->sflist, newpsl); 2303 struct ip_mc_socklist *pmc; ip_mc_msfilter() local 2334 for_each_pmc_rtnl(inet, pmc) { for_each_pmc_rtnl() 2335 if (pmc->multi.imr_multiaddr.s_addr == msf->imsf_multiaddr && for_each_pmc_rtnl() 2336 pmc->multi.imr_ifindex == imr.imr_ifindex) for_each_pmc_rtnl() 2339 if (!pmc) { /* must have a prior join */ 2364 psl = rtnl_dereference(pmc->sflist); 2366 (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode, 2372 (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode, 2374 rcu_assign_pointer(pmc->sflist, newpsl); 2375 pmc->sfmode = msf->imsf_fmode; 2389 struct ip_mc_socklist *pmc; ip_mc_msfget() local 2411 for_each_pmc_rtnl(inet, pmc) { for_each_pmc_rtnl() 2412 if (pmc->multi.imr_multiaddr.s_addr == msf->imsf_multiaddr && for_each_pmc_rtnl() 2413 pmc->multi.imr_ifindex == imr.imr_ifindex) for_each_pmc_rtnl() 2416 if (!pmc) /* must have a prior join */ 2418 msf->imsf_fmode = pmc->sfmode; 2419 psl = rtnl_dereference(pmc->sflist); 2447 struct ip_mc_socklist *pmc; ip_mc_gsfget() local 2462 for_each_pmc_rtnl(inet, pmc) { for_each_pmc_rtnl() 2463 if (pmc->multi.imr_multiaddr.s_addr == addr && for_each_pmc_rtnl() 2464 pmc->multi.imr_ifindex == gsf->gf_interface) for_each_pmc_rtnl() 2467 if (!pmc) /* must have a prior join */ 2469 gsf->gf_fmode = pmc->sfmode; 2470 psl = rtnl_dereference(pmc->sflist); 2499 struct ip_mc_socklist *pmc; ip_mc_sf_allow() local 2509 for_each_pmc_rcu(inet, pmc) { for_each_pmc_rcu() 2510 if (pmc->multi.imr_multiaddr.s_addr == loc_addr && for_each_pmc_rcu() 2511 pmc->multi.imr_ifindex == dif) for_each_pmc_rcu() 2515 if (!pmc) 2517 psl = rcu_dereference(pmc->sflist); 2518 ret = (pmc->sfmode == MCAST_EXCLUDE); 2527 if (pmc->sfmode == MCAST_INCLUDE && i >= psl->sl_count) 2529 if (pmc->sfmode == MCAST_EXCLUDE && i < psl->sl_count)
|
/linux-4.4.14/net/ipv6/ |
H A D | mcast.c | 83 static void mld_add_delrec(struct inet6_dev *idev, struct ifmcaddr6 *pmc); 87 static int sf_setstate(struct ifmcaddr6 *pmc); 88 static void sf_markstate(struct ifmcaddr6 *pmc); 89 static void ip6_mc_clear_src(struct ifmcaddr6 *pmc); 118 #define for_each_pmc_rcu(np, pmc) \ 119 for (pmc = rcu_dereference(np->ipv6_mc_list); \ 120 pmc != NULL; \ 121 pmc = rcu_dereference(pmc->next)) 315 struct ipv6_mc_socklist *pmc; ip6_mc_source() local 340 for_each_pmc_rcu(inet6, pmc) { for_each_pmc_rcu() 341 if (pgsr->gsr_interface && pmc->ifindex != pgsr->gsr_interface) for_each_pmc_rcu() 343 if (ipv6_addr_equal(&pmc->addr, group)) for_each_pmc_rcu() 346 if (!pmc) { /* must have a prior join */ 351 if (pmc->sflist) { 352 if (pmc->sfmode != omode) { 356 } else if (pmc->sfmode != omode) { 359 ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0); 360 pmc->sfmode = omode; 363 write_lock(&pmc->sflock); 366 psl = pmc->sflist; 418 pmc->sflist = psl = newpsl; 435 write_unlock(&pmc->sflock); 446 struct ipv6_mc_socklist *pmc; ip6_mc_msfilter() local 477 for_each_pmc_rcu(inet6, pmc) { for_each_pmc_rcu() 478 if (pmc->ifindex != gsf->gf_interface) for_each_pmc_rcu() 480 if (ipv6_addr_equal(&pmc->addr, group)) for_each_pmc_rcu() 483 if (!pmc) { /* must have a prior join */ 512 write_lock(&pmc->sflock); 513 psl = pmc->sflist; 515 (void) ip6_mc_del_src(idev, group, pmc->sfmode, 519 (void) ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0); 520 pmc->sflist = newpsl; 521 pmc->sfmode = gsf->gf_fmode; 522 write_unlock(&pmc->sflock); 537 struct ipv6_mc_socklist *pmc; ip6_mc_msfget() local 562 for_each_pmc_rcu(inet6, pmc) { for_each_pmc_rcu() 563 if (pmc->ifindex != gsf->gf_interface) for_each_pmc_rcu() 565 if (ipv6_addr_equal(group, &pmc->addr)) for_each_pmc_rcu() 568 if (!pmc) /* must have a prior join */ 570 gsf->gf_fmode = pmc->sfmode; 571 psl = pmc->sflist; 583 * on pmc->sflock. We have the socket lock so reading here is safe. 708 struct ifmcaddr6 *pmc; mld_add_delrec() local 716 pmc = kzalloc(sizeof(*pmc), GFP_ATOMIC); mld_add_delrec() 717 if (!pmc) mld_add_delrec() 721 spin_lock_init(&pmc->mca_lock); mld_add_delrec() 722 pmc->idev = im->idev; mld_add_delrec() 724 pmc->mca_addr = im->mca_addr; mld_add_delrec() 725 pmc->mca_crcount = idev->mc_qrv; mld_add_delrec() 726 pmc->mca_sfmode = im->mca_sfmode; mld_add_delrec() 727 if (pmc->mca_sfmode == MCAST_INCLUDE) { mld_add_delrec() 730 pmc->mca_tomb = im->mca_tomb; mld_add_delrec() 731 pmc->mca_sources = im->mca_sources; mld_add_delrec() 733 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) mld_add_delrec() 734 psf->sf_crcount = pmc->mca_crcount; mld_add_delrec() 739 pmc->next = idev->mc_tomb; mld_add_delrec() 740 idev->mc_tomb = pmc; mld_add_delrec() 746 struct ifmcaddr6 *pmc, *pmc_prev; mld_del_delrec() local 751 for (pmc = idev->mc_tomb; pmc; pmc = pmc->next) { mld_del_delrec() 752 if (ipv6_addr_equal(&pmc->mca_addr, pmca)) mld_del_delrec() 754 pmc_prev = pmc; mld_del_delrec() 756 if (pmc) { mld_del_delrec() 758 pmc_prev->next = pmc->next; mld_del_delrec() 760 idev->mc_tomb = pmc->next; mld_del_delrec() 764 if (pmc) { mld_del_delrec() 765 for (psf = pmc->mca_tomb; psf; psf = psf_next) { mld_del_delrec() 769 in6_dev_put(pmc->idev); mld_del_delrec() 770 kfree(pmc); mld_del_delrec() 776 struct ifmcaddr6 *pmc, *nextpmc; mld_clear_delrec() local 779 pmc = idev->mc_tomb; mld_clear_delrec() 783 for (; pmc; pmc = nextpmc) { mld_clear_delrec() 784 nextpmc = pmc->next; mld_clear_delrec() 785 ip6_mc_clear_src(pmc); mld_clear_delrec() 786 in6_dev_put(pmc->idev); mld_clear_delrec() 787 kfree(pmc); mld_clear_delrec() 792 for (pmc = idev->mc_list; pmc; pmc = pmc->next) { mld_clear_delrec() 795 spin_lock_bh(&pmc->mca_lock); mld_clear_delrec() 796 psf = pmc->mca_tomb; mld_clear_delrec() 797 pmc->mca_tomb = NULL; mld_clear_delrec() 798 spin_unlock_bh(&pmc->mca_lock); mld_clear_delrec() 1068 static bool mld_xmarksources(struct ifmcaddr6 *pmc, int nsrcs, mld_xmarksources() argument 1075 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) { mld_xmarksources() 1081 pmc->mca_sfcount[MCAST_EXCLUDE] != mld_xmarksources() 1090 pmc->mca_flags &= ~MAF_GSQUERY; mld_xmarksources() 1096 static bool mld_marksources(struct ifmcaddr6 *pmc, int nsrcs, mld_marksources() argument 1102 if (pmc->mca_sfmode == MCAST_EXCLUDE) mld_marksources() 1103 return mld_xmarksources(pmc, nsrcs, srcs); mld_marksources() 1108 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) { mld_marksources() 1120 pmc->mca_flags &= ~MAF_GSQUERY; mld_marksources() 1123 pmc->mca_flags |= MAF_GSQUERY; mld_marksources() 1468 static bool is_in(struct ifmcaddr6 *pmc, struct ip6_sf_list *psf, int type, is_in() argument 1476 if (!((pmc->mca_flags & MAF_GSQUERY) && !psf->sf_gsresp)) { is_in() 1477 if (pmc->mca_sfmode == MCAST_INCLUDE) is_in() 1484 return pmc->mca_sfcount[MCAST_EXCLUDE] == is_in() 1495 if (pmc->mca_sfcount[MCAST_EXCLUDE] == 0 || is_in() 1498 return pmc->mca_sfcount[MCAST_EXCLUDE] == is_in() 1503 return (pmc->mca_sfmode == MCAST_INCLUDE) ^ sdeleted; is_in() 1505 if (pmc->mca_sfmode == MCAST_INCLUDE) is_in() 1513 mld_scount(struct ifmcaddr6 *pmc, int type, int gdeleted, int sdeleted) mld_scount() argument 1518 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) { mld_scount() 1519 if (!is_in(pmc, psf, type, gdeleted, sdeleted)) mld_scount() 1665 static int grec_size(struct ifmcaddr6 *pmc, int type, int gdel, int sdel) grec_size() argument 1667 return sizeof(struct mld2_grec) + 16 * mld_scount(pmc,type,gdel,sdel); grec_size() 1670 static struct sk_buff *add_grhead(struct sk_buff *skb, struct ifmcaddr6 *pmc, add_grhead() argument 1673 struct net_device *dev = pmc->idev->dev; add_grhead() 1678 skb = mld_newpack(pmc->idev, dev->mtu); add_grhead() 1685 pgr->grec_mca = pmc->mca_addr; /* structure copy */ add_grhead() 1694 static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc, add_grec() argument 1697 struct inet6_dev *idev = pmc->idev; add_grec() 1704 if (pmc->mca_flags & MAF_NOREPORT) add_grec() 1714 psf_list = sdeleted ? &pmc->mca_tomb : &pmc->mca_sources; add_grec() 1724 AVAILABLE(skb) < grec_size(pmc, type, gdeleted, sdeleted)) { add_grec() 1737 if (!is_in(pmc, psf, type, gdeleted, sdeleted)) { add_grec() 1759 skb = add_grhead(skb, pmc, type, &pgr); add_grec() 1787 if (pmc->mca_crcount || isquery || crsend) { add_grec() 1793 skb = add_grhead(skb, pmc, type, &pgr); add_grec() 1800 pmc->mca_flags &= ~MAF_GSQUERY; /* clear query state */ add_grec() 1804 static void mld_send_report(struct inet6_dev *idev, struct ifmcaddr6 *pmc) mld_send_report() argument 1810 if (!pmc) { mld_send_report() 1811 for (pmc = idev->mc_list; pmc; pmc = pmc->next) { mld_send_report() 1812 if (pmc->mca_flags & MAF_NOREPORT) mld_send_report() 1814 spin_lock_bh(&pmc->mca_lock); mld_send_report() 1815 if (pmc->mca_sfcount[MCAST_EXCLUDE]) mld_send_report() 1819 skb = add_grec(skb, pmc, type, 0, 0, 0); mld_send_report() 1820 spin_unlock_bh(&pmc->mca_lock); mld_send_report() 1823 spin_lock_bh(&pmc->mca_lock); mld_send_report() 1824 if (pmc->mca_sfcount[MCAST_EXCLUDE]) mld_send_report() 1828 skb = add_grec(skb, pmc, type, 0, 0, 0); mld_send_report() 1829 spin_unlock_bh(&pmc->mca_lock); mld_send_report() 1859 struct ifmcaddr6 *pmc, *pmc_prev, *pmc_next; mld_send_cr() local 1868 for (pmc = idev->mc_tomb; pmc; pmc = pmc_next) { mld_send_cr() 1869 pmc_next = pmc->next; mld_send_cr() 1870 if (pmc->mca_sfmode == MCAST_INCLUDE) { mld_send_cr() 1873 skb = add_grec(skb, pmc, type, 1, 0, 0); mld_send_cr() 1874 skb = add_grec(skb, pmc, dtype, 1, 1, 0); mld_send_cr() 1876 if (pmc->mca_crcount) { mld_send_cr() 1877 if (pmc->mca_sfmode == MCAST_EXCLUDE) { mld_send_cr() 1879 skb = add_grec(skb, pmc, type, 1, 0, 0); mld_send_cr() 1881 pmc->mca_crcount--; mld_send_cr() 1882 if (pmc->mca_crcount == 0) { mld_send_cr() 1883 mld_clear_zeros(&pmc->mca_tomb); mld_send_cr() 1884 mld_clear_zeros(&pmc->mca_sources); mld_send_cr() 1887 if (pmc->mca_crcount == 0 && !pmc->mca_tomb && mld_send_cr() 1888 !pmc->mca_sources) { mld_send_cr() 1893 in6_dev_put(pmc->idev); mld_send_cr() 1894 kfree(pmc); mld_send_cr() 1896 pmc_prev = pmc; mld_send_cr() 1901 for (pmc = idev->mc_list; pmc; pmc = pmc->next) { mld_send_cr() 1902 spin_lock_bh(&pmc->mca_lock); mld_send_cr() 1903 if (pmc->mca_sfcount[MCAST_EXCLUDE]) { mld_send_cr() 1910 skb = add_grec(skb, pmc, type, 0, 0, 0); mld_send_cr() 1911 skb = add_grec(skb, pmc, dtype, 0, 1, 0); /* deleted sources */ mld_send_cr() 1914 if (pmc->mca_crcount) { mld_send_cr() 1915 if (pmc->mca_sfmode == MCAST_EXCLUDE) mld_send_cr() 1919 skb = add_grec(skb, pmc, type, 0, 0, 0); mld_send_cr() 1920 pmc->mca_crcount--; mld_send_cr() 1922 spin_unlock_bh(&pmc->mca_lock); mld_send_cr() 2030 struct ifmcaddr6 *pmc; mld_send_initial_cr() local 2038 for (pmc = idev->mc_list; pmc; pmc = pmc->next) { mld_send_initial_cr() 2039 spin_lock_bh(&pmc->mca_lock); mld_send_initial_cr() 2040 if (pmc->mca_sfcount[MCAST_EXCLUDE]) mld_send_initial_cr() 2044 skb = add_grec(skb, pmc, type, 0, 0, 1); mld_send_initial_cr() 2045 spin_unlock_bh(&pmc->mca_lock); mld_send_initial_cr() 2076 static int ip6_mc_del1_src(struct ifmcaddr6 *pmc, int sfmode, ip6_mc_del1_src() argument 2083 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) { ip6_mc_del1_src() 2094 struct inet6_dev *idev = pmc->idev; ip6_mc_del1_src() 2100 pmc->mca_sources = psf->sf_next; ip6_mc_del1_src() 2101 if (psf->sf_oldin && !(pmc->mca_flags & MAF_NOREPORT) && ip6_mc_del1_src() 2104 psf->sf_next = pmc->mca_tomb; ip6_mc_del1_src() 2105 pmc->mca_tomb = psf; ip6_mc_del1_src() 2117 struct ifmcaddr6 *pmc; ip6_mc_del_src() local 2124 for (pmc = idev->mc_list; pmc; pmc = pmc->next) { ip6_mc_del_src() 2125 if (ipv6_addr_equal(pmca, &pmc->mca_addr)) ip6_mc_del_src() 2128 if (!pmc) { ip6_mc_del_src() 2133 spin_lock_bh(&pmc->mca_lock); ip6_mc_del_src() 2134 sf_markstate(pmc); ip6_mc_del_src() 2136 if (!pmc->mca_sfcount[sfmode]) { ip6_mc_del_src() 2137 spin_unlock_bh(&pmc->mca_lock); ip6_mc_del_src() 2141 pmc->mca_sfcount[sfmode]--; ip6_mc_del_src() 2145 int rv = ip6_mc_del1_src(pmc, sfmode, &psfsrc[i]); ip6_mc_del_src() 2151 if (pmc->mca_sfmode == MCAST_EXCLUDE && ip6_mc_del_src() 2152 pmc->mca_sfcount[MCAST_EXCLUDE] == 0 && ip6_mc_del_src() 2153 pmc->mca_sfcount[MCAST_INCLUDE]) { ip6_mc_del_src() 2157 pmc->mca_sfmode = MCAST_INCLUDE; ip6_mc_del_src() 2158 pmc->mca_crcount = idev->mc_qrv; ip6_mc_del_src() 2159 idev->mc_ifc_count = pmc->mca_crcount; ip6_mc_del_src() 2160 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) ip6_mc_del_src() 2162 mld_ifc_event(pmc->idev); ip6_mc_del_src() 2163 } else if (sf_setstate(pmc) || changerec) ip6_mc_del_src() 2164 mld_ifc_event(pmc->idev); ip6_mc_del_src() 2165 spin_unlock_bh(&pmc->mca_lock); ip6_mc_del_src() 2173 static int ip6_mc_add1_src(struct ifmcaddr6 *pmc, int sfmode, ip6_mc_add1_src() argument 2179 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) { ip6_mc_add1_src() 2193 pmc->mca_sources = psf; ip6_mc_add1_src() 2199 static void sf_markstate(struct ifmcaddr6 *pmc) sf_markstate() argument 2202 int mca_xcount = pmc->mca_sfcount[MCAST_EXCLUDE]; sf_markstate() 2204 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) sf_markstate() 2205 if (pmc->mca_sfcount[MCAST_EXCLUDE]) { sf_markstate() 2213 static int sf_setstate(struct ifmcaddr6 *pmc) sf_setstate() argument 2216 int mca_xcount = pmc->mca_sfcount[MCAST_EXCLUDE]; sf_setstate() 2217 int qrv = pmc->idev->mc_qrv; sf_setstate() 2221 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) { sf_setstate() 2222 if (pmc->mca_sfcount[MCAST_EXCLUDE]) { sf_setstate() 2231 for (dpsf = pmc->mca_tomb; dpsf; sf_setstate() 2242 pmc->mca_tomb = dpsf->sf_next; sf_setstate() 2254 for (dpsf = pmc->mca_tomb; dpsf; dpsf = dpsf->sf_next) sf_setstate() 2263 /* pmc->mca_lock held by callers */ sf_setstate() 2264 dpsf->sf_next = pmc->mca_tomb; sf_setstate() 2265 pmc->mca_tomb = dpsf; sf_setstate() 2281 struct ifmcaddr6 *pmc; ip6_mc_add_src() local 2288 for (pmc = idev->mc_list; pmc; pmc = pmc->next) { ip6_mc_add_src() 2289 if (ipv6_addr_equal(pmca, &pmc->mca_addr)) ip6_mc_add_src() 2292 if (!pmc) { ip6_mc_add_src() 2297 spin_lock_bh(&pmc->mca_lock); ip6_mc_add_src() 2299 sf_markstate(pmc); ip6_mc_add_src() 2300 isexclude = pmc->mca_sfmode == MCAST_EXCLUDE; ip6_mc_add_src() 2302 pmc->mca_sfcount[sfmode]++; ip6_mc_add_src() 2305 err = ip6_mc_add1_src(pmc, sfmode, &psfsrc[i]); ip6_mc_add_src() 2313 pmc->mca_sfcount[sfmode]--; ip6_mc_add_src() 2315 ip6_mc_del1_src(pmc, sfmode, &psfsrc[j]); ip6_mc_add_src() 2316 } else if (isexclude != (pmc->mca_sfcount[MCAST_EXCLUDE] != 0)) { ip6_mc_add_src() 2320 if (pmc->mca_sfcount[MCAST_EXCLUDE]) ip6_mc_add_src() 2321 pmc->mca_sfmode = MCAST_EXCLUDE; ip6_mc_add_src() 2322 else if (pmc->mca_sfcount[MCAST_INCLUDE]) ip6_mc_add_src() 2323 pmc->mca_sfmode = MCAST_INCLUDE; ip6_mc_add_src() 2326 pmc->mca_crcount = idev->mc_qrv; ip6_mc_add_src() 2327 idev->mc_ifc_count = pmc->mca_crcount; ip6_mc_add_src() 2328 for (psf = pmc->mca_sources; psf; psf = psf->sf_next) ip6_mc_add_src() 2331 } else if (sf_setstate(pmc)) ip6_mc_add_src() 2333 spin_unlock_bh(&pmc->mca_lock); ip6_mc_add_src() 2338 static void ip6_mc_clear_src(struct ifmcaddr6 *pmc) ip6_mc_clear_src() argument 2342 for (psf = pmc->mca_tomb; psf; psf = nextpsf) { ip6_mc_clear_src() 2346 pmc->mca_tomb = NULL; ip6_mc_clear_src() 2347 for (psf = pmc->mca_sources; psf; psf = nextpsf) { ip6_mc_clear_src() 2351 pmc->mca_sources = NULL; ip6_mc_clear_src() 2352 pmc->mca_sfmode = MCAST_EXCLUDE; ip6_mc_clear_src() 2353 pmc->mca_sfcount[MCAST_INCLUDE] = 0; ip6_mc_clear_src() 2354 pmc->mca_sfcount[MCAST_EXCLUDE] = 1; ip6_mc_clear_src()
|
/linux-4.4.14/arch/arm/mach-at91/ |
H A D | pm_suspend.S | 21 pmc .req r0 label 29 1: ldr tmp1, [pmc, #AT91_PMC_SR] 38 1: ldr tmp1, [pmc, #AT91_PMC_SR] 47 1: ldr tmp1, [pmc, #AT91_PMC_SR] 59 str tmp1, [pmc, #AT91_PMC_SCDR] 75 * void at91_pm_suspend_in_sram(void __iomem *pmc, void __iomem *sdramc, 112 ldr pmc, .pmc_base 115 ldr tmp1, [pmc, #AT91_PMC_MCKR] 122 str tmp1, [pmc, #AT91_PMC_MCKR] 127 ldr tmp1, [pmc, #AT91_CKGR_PLLAR] 132 str tmp1, [pmc, #AT91_CKGR_PLLAR] 135 ldr tmp1, [pmc, #AT91_CKGR_MOR] 138 str tmp1, [pmc, #AT91_CKGR_MOR] 141 ldr pmc, .pmc_base 150 ldr pmc, .pmc_base 153 ldr tmp1, [pmc, #AT91_CKGR_MOR] 156 str tmp1, [pmc, #AT91_CKGR_MOR] 162 str tmp1, [pmc, #AT91_CKGR_PLLAR] 176 str tmp1, [pmc, #AT91_PMC_MCKR]
|
H A D | pm.c | 131 static void (*at91_suspend_sram_fn)(void __iomem *pmc, void __iomem *ramc0, 134 extern void at91_pm_suspend_in_sram(void __iomem *pmc, void __iomem *ramc0,
|
/linux-4.4.14/arch/powerpc/oprofile/ |
H A D | op_model_pa6t.c | 95 int pmc; pa6t_reg_setup() local 104 for (pmc = 0; pmc < cur_cpu_spec->num_pmcs; pmc++) pa6t_reg_setup() 105 if (!ctr[pmc].enabled) { pa6t_reg_setup() 106 sys->mmcr0 &= ~(0x1UL << pmc); pa6t_reg_setup() 107 sys->mmcr0 &= ~(0x1UL << (pmc+12)); pa6t_reg_setup() 108 pr_debug("turned off counter %u\n", pmc); pa6t_reg_setup() 131 for (pmc = 0; pmc < cur_cpu_spec->num_pmcs; pmc++) { pa6t_reg_setup() 133 reset_value[pmc] = (0x1UL << 39) - ctr[pmc].count; pa6t_reg_setup() 134 pr_debug("reset_value for pmc%u inited to 0x%llx\n", pa6t_reg_setup() 135 pmc, reset_value[pmc]); pa6t_reg_setup()
|
H A D | op_model_power4.c | 45 int pmc, cntr_marked_events = 0; power7_marked_instr_event() local 51 for (pmc = 0; pmc < 4; pmc++) { power7_marked_instr_event() 53 << (OPROFILE_MAX_PMC_NUM - pmc) power7_marked_instr_event() 55 psel = (psel >> ((OPROFILE_MAX_PMC_NUM - pmc) power7_marked_instr_event() 59 - (pmc * OPROFILE_PMSEL_FIELD_WIDTH ))); power7_marked_instr_event() 61 - (pmc * OPROFILE_PMSEL_FIELD_WIDTH)); power7_marked_instr_event() 65 cntr_marked_events |= (pmc == 1 || pmc == 3) << pmc; power7_marked_instr_event() 69 cntr_marked_events |= (pmc == 0) << pmc; power7_marked_instr_event() 74 cntr_marked_events |= (pmc != 1) << pmc; power7_marked_instr_event() 78 cntr_marked_events |= 1 << pmc; power7_marked_instr_event() 82 cntr_marked_events |= (unit == 0xd) << pmc; power7_marked_instr_event() 86 cntr_marked_events |= (pmc >= 2) << pmc; power7_marked_instr_event() 89 cntr_marked_events |= (unit == 0xd) << pmc; power7_marked_instr_event()
|
H A D | op_model_7450.c | 24 #include <asm/pmc.h>
|
H A D | common.c | 21 #include <asm/pmc.h>
|
H A D | op_model_fsl_emb.c | 23 #include <asm/pmc.h>
|
H A D | op_model_cell.c | 448 * pmc values for a given node.
|
/linux-4.4.14/arch/sparc/kernel/ |
H A D | pmc.c | 0 /* pmc - Driver implementation for power management functions 28 #define PMC_OBPNAME "SUNW,pmc" 29 #define PMC_DEVNAME "pmc" 84 .name = "pmc",
|
H A D | Makefile | 86 obj-$(CONFIG_SUN_PM) += apc.o pmc.o
|
H A D | process_32.c | 47 * Set in pm platform drivers (apc.c and pmc.c)
|
/linux-4.4.14/arch/arm/boot/dts/include/dt-bindings/clock/ |
H A D | at91.h | 2 * This header provides constants for AT91 pmc status.
|
/linux-4.4.14/arch/cris/boot/dts/include/dt-bindings/clock/ |
H A D | at91.h | 2 * This header provides constants for AT91 pmc status.
|
/linux-4.4.14/include/dt-bindings/clock/ |
H A D | at91.h | 2 * This header provides constants for AT91 pmc status.
|
/linux-4.4.14/arch/metag/boot/dts/include/dt-bindings/clock/ |
H A D | at91.h | 2 * This header provides constants for AT91 pmc status.
|
/linux-4.4.14/arch/mips/boot/dts/include/dt-bindings/clock/ |
H A D | at91.h | 2 * This header provides constants for AT91 pmc status.
|
/linux-4.4.14/arch/powerpc/boot/dts/include/dt-bindings/clock/ |
H A D | at91.h | 2 * This header provides constants for AT91 pmc status.
|
/linux-4.4.14/arch/arm64/boot/dts/include/dt-bindings/clock/ |
H A D | at91.h | 2 * This header provides constants for AT91 pmc status.
|
/linux-4.4.14/arch/powerpc/sysdev/ |
H A D | fsl_pmc.c | 75 { .compatible = "fsl,mpc8548-pmc", }, 76 { .compatible = "fsl,mpc8641d-pmc", }, 82 .name = "fsl-pmc",
|
/linux-4.4.14/arch/tile/kernel/ |
H A D | Makefile | 29 obj-$(CONFIG_USE_PMC) += pmc.o
|
H A D | pmc.c | 22 #include <asm/pmc.h>
|
H A D | perf_event.c | 40 #include <asm/pmc.h>
|
/linux-4.4.14/drivers/gpu/drm/nouveau/nvkm/subdev/mc/ |
H A D | g98.c | 57 g98_mc_new(struct nvkm_device *device, int index, struct nvkm_mc **pmc) g98_mc_new() argument 59 return nvkm_mc_new_(&g98_mc, device, index, pmc); g98_mc_new()
|
H A D | gk20a.c | 36 gk20a_mc_new(struct nvkm_device *device, int index, struct nvkm_mc **pmc) gk20a_mc_new() argument 38 return nvkm_mc_new_(&gk20a_mc, device, index, pmc); gk20a_mc_new()
|
H A D | nv44.c | 50 nv44_mc_new(struct nvkm_device *device, int index, struct nvkm_mc **pmc) nv44_mc_new() argument 52 return nvkm_mc_new_(&nv44_mc, device, index, pmc); nv44_mc_new()
|
H A D | nv04.c | 80 nv04_mc_new(struct nvkm_device *device, int index, struct nvkm_mc **pmc) nv04_mc_new() argument 82 return nvkm_mc_new_(&nv04_mc, device, index, pmc); nv04_mc_new()
|
H A D | nv50.c | 61 nv50_mc_new(struct nvkm_device *device, int index, struct nvkm_mc **pmc) nv50_mc_new() argument 63 return nvkm_mc_new_(&nv50_mc, device, index, pmc); nv50_mc_new()
|
H A D | base.c | 113 int index, struct nvkm_mc **pmc) nvkm_mc_new_() 117 if (!(mc = *pmc = kzalloc(sizeof(*mc), GFP_KERNEL))) nvkm_mc_new_() 112 nvkm_mc_new_(const struct nvkm_mc_func *func, struct nvkm_device *device, int index, struct nvkm_mc **pmc) nvkm_mc_new_() argument
|
H A D | gf100.c | 94 gf100_mc_new(struct nvkm_device *device, int index, struct nvkm_mc **pmc) gf100_mc_new() argument 96 return nvkm_mc_new_(&gf100_mc, device, index, pmc); gf100_mc_new()
|
/linux-4.4.14/arch/powerpc/kernel/ |
H A D | pmc.c | 2 * arch/powerpc/kernel/pmc.c 22 #include <asm/pmc.h>
|
H A D | Makefile | 30 irq.o align.o signal_32.o pmc.o vdso.o \
|
H A D | sysfs.c | 19 #include <asm/pmc.h>
|
H A D | asm-offsets.c | 540 DEFINE(VCPU_PMC, offsetof(struct kvm_vcpu, arch.pmc)); main()
|
H A D | traps.c | 46 #include <asm/pmc.h>
|
/linux-4.4.14/drivers/video/fbdev/ |
H A D | valkyriefb.h | 24 * pmc-valkyrie.h: Console support for PowerMac "control" display adaptor. 27 * pmc-valkyrie.c: Console support for PowerMac "control" display adaptor. 32 * pmc-control.h: Console support for PowerMac "control" display adaptor. 35 * pmc-control.c: Console support for PowerMac "control" display adaptor.
|
H A D | valkyriefb.c | 17 * pmc-valkyrie.c -- Console support for PowerMac "valkyrie" display adaptor.
|
/linux-4.4.14/drivers/gpu/drm/nouveau/include/nvif/ |
H A D | os.h | 35 #include <soc/tegra/pmc.h>
|
/linux-4.4.14/drivers/clk/tegra/ |
H A D | clk-pll.c | 189 #define pll_override_readl(offset, p) readl_relaxed(p->pmc + offset) 194 #define pll_override_writel(val, offset, p) writel(val, p->pmc + offset) 278 val = readl_relaxed(pll->pmc + PMC_PLLP_WB0_OVERRIDE); clk_pll_is_enabled() 302 val = readl_relaxed(pll->pmc + PMC_PLLP_WB0_OVERRIDE); _clk_pll_enable() 304 writel_relaxed(val, pll->pmc + PMC_PLLP_WB0_OVERRIDE); _clk_pll_enable() 320 val = readl_relaxed(pll->pmc + PMC_PLLP_WB0_OVERRIDE); _clk_pll_disable() 322 writel_relaxed(val, pll->pmc + PMC_PLLP_WB0_OVERRIDE); _clk_pll_disable() 693 if (!pll->pmc) clk_plle_training() 700 val = readl(pll->pmc + PMC_SATA_PWRGT); clk_plle_training() 702 writel(val, pll->pmc + PMC_SATA_PWRGT); clk_plle_training() 704 val = readl(pll->pmc + PMC_SATA_PWRGT); clk_plle_training() 706 writel(val, pll->pmc + PMC_SATA_PWRGT); clk_plle_training() 708 val = readl(pll->pmc + PMC_SATA_PWRGT); clk_plle_training() 710 writel(val, pll->pmc + PMC_SATA_PWRGT); clk_plle_training() 1415 void __iomem *pmc, struct tegra_clk_pll_params *pll_params, _tegra_init_pll() 1425 pll->pmc = pmc; _tegra_init_pll() 1455 void __iomem *clk_base, void __iomem *pmc, tegra_clk_register_pll() 1464 pll = _tegra_init_pll(clk_base, pmc, pll_params, lock); tegra_clk_register_pll() 1486 void __iomem *clk_base, void __iomem *pmc, tegra_clk_register_plle() 1499 pll = _tegra_init_pll(clk_base, pmc, pll_params, lock); tegra_clk_register_plle() 1559 void __iomem *clk_base, void __iomem *pmc, tegra_clk_register_pllxc() 1599 pll = _tegra_init_pll(clk_base, pmc, pll_params, lock); tegra_clk_register_pllxc() 1612 void __iomem *clk_base, void __iomem *pmc, tegra_clk_register_pllre() 1625 pll = _tegra_init_pll(clk_base, pmc, pll_params, lock); tegra_clk_register_pllre() 1658 void __iomem *clk_base, void __iomem *pmc, tegra_clk_register_pllm() 1684 pll = _tegra_init_pll(clk_base, pmc, pll_params, lock); tegra_clk_register_pllm() 1697 void __iomem *clk_base, void __iomem *pmc, tegra_clk_register_pllc() 1723 pll = _tegra_init_pll(clk_base, pmc, pll_params, lock); tegra_clk_register_pllc() 1414 _tegra_init_pll(void __iomem *clk_base, void __iomem *pmc, struct tegra_clk_pll_params *pll_params, spinlock_t *lock) _tegra_init_pll() argument 1454 tegra_clk_register_pll(const char *name, const char *parent_name, void __iomem *clk_base, void __iomem *pmc, unsigned long flags, struct tegra_clk_pll_params *pll_params, spinlock_t *lock) tegra_clk_register_pll() argument 1485 tegra_clk_register_plle(const char *name, const char *parent_name, void __iomem *clk_base, void __iomem *pmc, unsigned long flags, struct tegra_clk_pll_params *pll_params, spinlock_t *lock) tegra_clk_register_plle() argument 1558 tegra_clk_register_pllxc(const char *name, const char *parent_name, void __iomem *clk_base, void __iomem *pmc, unsigned long flags, struct tegra_clk_pll_params *pll_params, spinlock_t *lock) tegra_clk_register_pllxc() argument 1611 tegra_clk_register_pllre(const char *name, const char *parent_name, void __iomem *clk_base, void __iomem *pmc, unsigned long flags, struct tegra_clk_pll_params *pll_params, spinlock_t *lock, unsigned long parent_rate) tegra_clk_register_pllre() argument 1657 tegra_clk_register_pllm(const char *name, const char *parent_name, void __iomem *clk_base, void __iomem *pmc, unsigned long flags, struct tegra_clk_pll_params *pll_params, spinlock_t *lock) tegra_clk_register_pllm() argument 1696 tegra_clk_register_pllc(const char *name, const char *parent_name, void __iomem *clk_base, void __iomem *pmc, unsigned long flags, struct tegra_clk_pll_params *pll_params, spinlock_t *lock) tegra_clk_register_pllc() argument
|
H A D | clk.h | 259 * @pmc: address of PMC, required to read override bits 266 void __iomem *pmc; member in struct:tegra_clk_pll 291 void __iomem *clk_base, void __iomem *pmc, 296 void __iomem *clk_base, void __iomem *pmc, 301 void __iomem *clk_base, void __iomem *pmc, 307 void __iomem *clk_base, void __iomem *pmc, 313 void __iomem *clk_base, void __iomem *pmc, 319 void __iomem *clk_base, void __iomem *pmc,
|
H A D | clk-tegra114.c | 1049 void __iomem *pmc) tegra114_pll_init() 1056 pmc, 0, &pll_c_params, NULL); tegra114_pll_init() 1069 clk = tegra_clk_register_pllc("pll_c2", "pll_ref", clk_base, pmc, 0, tegra114_pll_init() 1074 clk = tegra_clk_register_pllc("pll_c3", "pll_ref", clk_base, pmc, 0, tegra114_pll_init() 1079 clk = tegra_clk_register_pllm("pll_m", "pll_ref", clk_base, pmc, tegra114_pll_init() 1102 clk = tegra_clk_register_pll("pll_u", "pll_ref", clk_base, pmc, 0, tegra114_pll_init() 1130 clk = tegra_clk_register_pll("pll_d", "pll_ref", clk_base, pmc, 0, tegra114_pll_init() 1140 clk = tegra_clk_register_pll("pll_d2", "pll_ref", clk_base, pmc, 0, tegra114_pll_init() 1150 clk = tegra_clk_register_pllre("pll_re_vco", "pll_ref", clk_base, pmc, tegra114_pll_init() 1280 { .compatible = "nvidia,tegra114-pmc" }, 1463 pr_err("Failed to find pmc node\n"); tegra114_clock_init() 1470 pr_err("Can't map pmc registers\n"); tegra114_clock_init() 1048 tegra114_pll_init(void __iomem *clk_base, void __iomem *pmc) tegra114_pll_init() argument
|
H A D | clk-tegra124.c | 1151 void __iomem *pmc) tegra124_pll_init() 1158 pmc, 0, &pll_c_params, NULL); tegra124_pll_init() 1179 clk = tegra_clk_register_pllc("pll_c2", "pll_ref", clk_base, pmc, 0, tegra124_pll_init() 1185 clk = tegra_clk_register_pllc("pll_c3", "pll_ref", clk_base, pmc, 0, tegra124_pll_init() 1191 clk = tegra_clk_register_pllm("pll_m", "pll_ref", clk_base, pmc, tegra124_pll_init() 1218 clk = tegra_clk_register_pll("pll_u", "pll_ref", clk_base, pmc, 0, tegra124_pll_init() 1251 clk = tegra_clk_register_pll("pll_d", "pll_ref", clk_base, pmc, 0, tegra124_pll_init() 1263 clk = tegra_clk_register_pllre("pll_re_vco", "pll_ref", clk_base, pmc, tegra124_pll_init() 1358 { .compatible = "nvidia,tegra124-pmc" }, 1537 pr_err("Failed to find pmc node\n"); tegra124_132_clock_init_pre() 1544 pr_err("Can't map pmc registers\n"); tegra124_132_clock_init_pre() 1150 tegra124_pll_init(void __iomem *clk_base, void __iomem *pmc) tegra124_pll_init() argument
|
H A D | clk-tegra30.c | 25 #include <soc/tegra/pmc.h> 1404 { .compatible = "nvidia,tegra30-pmc" }, 1424 pr_err("Failed to find pmc node\n"); tegra30_clock_init() 1430 pr_err("Can't map pmc registers\n"); tegra30_clock_init()
|
H A D | clk-tegra20.c | 1087 { .compatible = "nvidia,tegra20-pmc" }, 1103 pr_err("Failed to find pmc node\n"); tegra20_clock_init() 1109 pr_err("Can't map pmc registers\n"); tegra20_clock_init()
|
/linux-4.4.14/arch/mn10300/include/asm/ |
H A D | mmu_context.h | 65 unsigned long *pmc = &mmu_context_cache[smp_processor_id()]; allocate_mmu_context() local 66 unsigned long mc = ++(*pmc); allocate_mmu_context() 76 *pmc = mc = MMU_CONTEXT_FIRST_VERSION; allocate_mmu_context()
|
/linux-4.4.14/arch/powerpc/include/asm/ |
H A D | pmc.h | 2 * pmc.h
|
H A D | perf_event_server.h | 43 void (*disable_pmc)(unsigned int pmc, unsigned long mmcr[]);
|
H A D | kvm_host.h | 537 u32 pmc[8]; member in struct:kvmppc_slb::kvm_vcpu_arch
|
/linux-4.4.14/arch/powerpc/platforms/83xx/ |
H A D | suspend.c | 357 "pmc", ofdev); pmc_probe() 425 .compatible = "fsl,mpc8313-pmc", 429 .compatible = "fsl,mpc8349-pmc", 437 .name = "mpc83xx-pmc",
|
/linux-4.4.14/arch/mips/include/asm/mach-pmcs-msp71xx/ |
H A D | msp_int.h | 5 * Author: Andrew Hughes, Andrew_Hughes@pmc-sierra.com
|
H A D | msp_regs.h | 12 * Author: Andrew Hughes, Andrew_Hughes@pmc-sierra.com
|
/linux-4.4.14/arch/mips/pmcs-msp71xx/ |
H A D | msp_elb.c | 6 * Author: Marc St-Jean, Marc_St-Jean@pmc-sierra.com
|
H A D | msp_irq_slp.c | 5 * Author: Andrew Hughes, Andrew_Hughes@pmc-sierra.com
|
H A D | msp_setup.c | 224 * link order in arch/mips/pmc-sierra/msp71xx/Makefile. prom_init()
|
/linux-4.4.14/arch/arm/mach-vt8500/ |
H A D | vt8500.c | 144 np = of_find_compatible_node(NULL, NULL, "via,vt8500-pmc"); vt8500_init() 149 pr_err("%s:of_iomap(pmc) failed\n", __func__); vt8500_init()
|
/linux-4.4.14/drivers/scsi/aacraid/ |
H A D | nark.c | 8 * 2010 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
|
H A D | rkt.c | 9 * 2010 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
|
H A D | dpcsup.c | 9 * 2010 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
|
H A D | sa.c | 9 * 2010 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
|
H A D | comminit.c | 9 * 2010 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
|
H A D | rx.c | 9 * 2010 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
|
H A D | commctrl.c | 9 * 2010 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
|
H A D | src.c | 9 * 2010 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
|
H A D | linit.c | 9 * 2010 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
|
H A D | commsup.c | 9 * 2010 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
|
H A D | aachba.c | 9 * 2010 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
|
/linux-4.4.14/arch/ia64/kernel/ |
H A D | perfmon_generic.h | 3 * and pmc checker used by perfmon.c.
|
H A D | perfmon_mckinley.h | 3 * and pmc checker used by perfmon.c. 68 DPRINT(("pmc[%d]=0x%lx, mask=0x%lx, reset=0x%lx, val=0x%lx\n", pfm_mck_reserved() 106 DPRINT(("pmc[%d]=0x%lx has active pmc13 settings, clearing dbr\n", cnum, *val)); pfm_mck_pmc_check() 124 DPRINT(("pmc[%d]=0x%lx has active pmc14 settings, clearing ibr\n", cnum, *val)); pfm_mck_pmc_check()
|
H A D | perfmon_itanium.h | 3 * and pmc checker used by perfmon.c. 67 DPRINT(("pmc[%d]=0x%lx has active pmc13.ta cleared, clearing ibr\n", cnum, *val)); pfm_ita_pmc_check() 86 DPRINT(("pmc[%d]=0x%lx has active pmc11.pt cleared, clearing dbr\n", cnum, *val)); pfm_ita_pmc_check()
|
H A D | perfmon_montecito.h | 3 * and pmc checker used by perfmon.c. 146 DPRINT(("pmc[%d]=0x%lx, mask=0x%lx, reset=0x%lx, val=0x%lx\n", pfm_mont_reserved() 190 DPRINT(("pmc[%d]=0x%lx has active pmc41 settings, clearing dbr\n", cnum, tmpval)); pfm_mont_pmc_check()
|
H A D | perfmon.c | 82 * bit4 : pmc has pmc.pm 83 * bit5 : pmc controls a counter (has pmc.oi), pmd is used as counter 90 #define PFM_REG_MONITOR (0x1<<4|PFM_REG_IMPL) /* a PMC with a pmc.pm field only */ 91 #define PFM_REG_COUNTING (0x2<<4|PFM_REG_MONITOR) /* a monitor + pmc.oi+ PMD used as a counter */ 123 #define PMU_PMC_OI 5 /* position of pmc.oi bit */ 981 DPRINT_ovfl(("pmc[%d]=0x%lx\n", i, ctx->th_pmcs[i])); pfm_mask_monitoring() 1065 DPRINT(("[%d] pmc[%d]=0x%lx\n", pfm_restore_monitoring() 1169 DPRINT(("pmc[%d]=0x%lx\n", i, ctx->th_pmcs[i])); pfm_copy_pmcs() 2481 DPRINT(("pmc[%d]=0x%lx\n", i, ctx->ctx_pmcs[i])); pfm_reset_pmu_state() 2488 * On context switched restore, we must restore ALL pmc and ALL pmd even pfm_reset_pmu_state() 2867 DPRINT(("pmc%u is invalid\n", cnum)); pfm_write_pmcs() 2882 DPRINT(("pmc%u is unimplemented or no-access pmc_type=%x\n", cnum, pmc_type)); pfm_write_pmcs() 2892 DPRINT(("pmc%u pmc_pm=%lu is_system=%d\n", pfm_write_pmcs() 2914 DPRINT(("invalid smpl_pmds 0x%lx for pmc%u\n", smpl_pmds, cnum)); pfm_write_pmcs() 2920 DPRINT(("invalid reset_pmds 0x%lx for pmc%u\n", reset_pmds, cnum)); pfm_write_pmcs() 2925 DPRINT(("cannot set ovfl_notify or random on pmc%u\n", cnum)); pfm_write_pmcs() 2990 * we save the value of the pmc in ctx_pmcs[] and if pfm_write_pmcs() 3033 DPRINT(("pmc[%u]=0x%lx ld=%d apmu=%d flags=0x%x all_pmcs=0x%lx used_pmds=0x%lx eventid=%ld smpl_pmds=0x%lx reset_pmds=0x%lx reloads_pmcs=0x%lx used_monitors=0x%lx ovfl_regs=0x%lx\n", pfm_write_pmcs() 4128 DPRINT(("pmc_reset_val pmc[%u]=0x%lx\n", cnum, req->reg_value)); pfm_get_pmc_reset() 5701 "CPU%-2d pmc%u : 0x%lx\n" pfm_proc_show() 6616 printk(KERN_ERR "perfmon: not enough pmc/pmd, perfmon disabled\n"); pfm_init() 6732 printk("->CPU%d pmc[%d]=0x%lx thread_pmc[%d]=0x%lx\n", this_cpu, i, ia64_get_pmc(i), i, ctx->th_pmcs[i]); dump_pmu_state()
|
/linux-4.4.14/arch/arm/mach-tegra/ |
H A D | tegra.c | 39 #include <soc/tegra/pmc.h>
|
H A D | platsmp.c | 25 #include <soc/tegra/pmc.h>
|
H A D | pm.c | 32 #include <soc/tegra/pmc.h>
|
/linux-4.4.14/arch/ia64/include/uapi/asm/ |
H A D | perfmon.h | 89 unsigned long reg_value; /* initial pmc/pmd value */ 90 unsigned long reg_flags; /* input: pmc/pmd flags, return: reg error */
|
H A D | gcc_intrin.h | 434 asm volatile ("mov pmc[%0]=%1" :: "r"(index), "r"(val) : "memory") 473 asm volatile ("mov %0=pmc[%1]" : "=r"(ia64_intri_res) : "r"(index)); \
|
/linux-4.4.14/include/uapi/linux/ |
H A D | perf_event.h | 416 * s64 pmc = 0; 436 * pmc = rdpmc(index - 1); 468 * pmc <<= 64 - width; 469 * pmc >>= 64 - width; // signed shift right 470 * count += pmc;
|
/linux-4.4.14/drivers/net/wireless/ath/wcn36xx/ |
H A D | debug.c | 23 #include "pmc.h"
|
H A D | wcn36xx.h | 29 #include "pmc.h"
|
/linux-4.4.14/drivers/watchdog/ |
H A D | riowd.c | 231 .name = "pmc",
|
/linux-4.4.14/arch/x86/include/asm/ |
H A D | kvm_emulate.h | 210 int (*check_pmc)(struct x86_emulate_ctxt *ctxt, u32 pmc); 211 int (*read_pmc)(struct x86_emulate_ctxt *ctxt, u32 pmc, u64 *pdata);
|
/linux-4.4.14/drivers/gpu/drm/tegra/ |
H A D | gr3d.c | 16 #include <soc/tegra/pmc.h>
|
H A D | dc.c | 15 #include <soc/tegra/pmc.h>
|
H A D | sor.c | 18 #include <soc/tegra/pmc.h>
|
/linux-4.4.14/drivers/ata/ |
H A D | ahci_tegra.c | 30 #include <soc/tegra/pmc.h>
|
/linux-4.4.14/arch/powerpc/platforms/cell/ |
H A D | pmu.c | 31 #include <asm/pmc.h>
|
/linux-4.4.14/drivers/pci/ |
H A D | pci.c | 2166 u16 pmc; pci_pm_init() local 2182 pci_read_config_word(dev, pm + PCI_PM_PMC, &pmc); pci_pm_init() 2184 if ((pmc & PCI_PM_CAP_VER_MASK) > 3) { pci_pm_init() 2186 pmc & PCI_PM_CAP_VER_MASK); pci_pm_init() 2198 if (pmc & PCI_PM_CAP_D1) pci_pm_init() 2200 if (pmc & PCI_PM_CAP_D2) pci_pm_init() 2209 pmc &= PCI_PM_CAP_PME_MASK; pci_pm_init() 2210 if (pmc) { pci_pm_init() 2213 (pmc & PCI_PM_CAP_PME_D0) ? " D0" : "", pci_pm_init() 2214 (pmc & PCI_PM_CAP_PME_D1) ? " D1" : "", pci_pm_init() 2215 (pmc & PCI_PM_CAP_PME_D2) ? " D2" : "", pci_pm_init() 2216 (pmc & PCI_PM_CAP_PME_D3) ? " D3hot" : "", pci_pm_init() 2217 (pmc & PCI_PM_CAP_PME_D3cold) ? " D3cold" : ""); pci_pm_init() 2218 dev->pme_support = pmc >> PCI_PM_CAP_PME_SHIFT; pci_pm_init()
|
/linux-4.4.14/drivers/platform/x86/ |
H A D | intel_pmc_ipc.c | 691 dev_err(&pdev->dev, "Failed to create pmc devices\n"); ipc_plat_probe() 744 .name = "pmc-ipc-plat",
|
/linux-4.4.14/drivers/clk/ |
H A D | clk-vt8500.c | 62 of_find_compatible_node(NULL, NULL, "via,vt8500-pmc"); vtwm_set_pmc_base() 71 pr_err("%s:of_iomap(pmc) failed\n", __func__); vtwm_set_pmc_base()
|
/linux-4.4.14/drivers/mfd/ |
H A D | sm501.c | 139 unsigned long pmc = smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL); sm501_dump_clk() local 175 (pmc & 3 ) == 0 ? '*' : '-', sm501_dump_clk() 184 (pmc & 3 ) == 1 ? '*' : '-', sm501_dump_clk()
|
/linux-4.4.14/arch/powerpc/platforms/powermac/ |
H A D | setup.c | 74 #include <asm/pmc.h>
|
/linux-4.4.14/drivers/net/wireless/iwlegacy/ |
H A D | 3945.h | 339 u16 pmc; /* abs.ofs: 20 */ member in struct:il3945_eeprom
|
/linux-4.4.14/arch/powerpc/platforms/pseries/ |
H A D | setup.c | 59 #include <asm/pmc.h>
|
/linux-4.4.14/drivers/scsi/ |
H A D | pmcraid.h | 4 * Written By: Anil Ravindranath<anil_ravindranath@pmc-sierra.com>
|
H A D | pmcraid.c | 4 * Written By: Anil Ravindranath<anil_ravindranath@pmc-sierra.com> 85 MODULE_AUTHOR("Anil Ravindranath<anil_ravindranath@pmc-sierra.com>");
|
/linux-4.4.14/arch/powerpc/kvm/ |
H A D | book3s_hv.c | 1079 *val = get_reg_val(id, vcpu->arch.pmc[i]); kvmppc_get_one_reg_hv() 1271 vcpu->arch.pmc[i] = set_reg_val(id, *val); kvmppc_set_one_reg_hv()
|
/linux-4.4.14/drivers/pinctrl/ |
H A D | pinctrl-tegra20.c | 2130 MUX_PG(pmc, PWR_ON, PWR_INTR, RSVD3, RSVD4, 0x14, 23, 0x98, 18, -1, -1),
|
/linux-4.4.14/drivers/net/ethernet/broadcom/bnx2x/ |
H A D | bnx2x_main.c | 9112 u16 pmc; bnx2x_send_unload_req() local 9127 pci_read_config_word(pdev, pdev->pm_cap + PCI_PM_CTRL, &pmc); bnx2x_send_unload_req() 9128 pmc |= PCI_PM_CTRL_PME_ENABLE | PCI_PM_CTRL_PME_STATUS; bnx2x_send_unload_req() 9129 pci_write_config_word(pdev, pdev->pm_cap + PCI_PM_CTRL, pmc); bnx2x_send_unload_req() 10882 u16 pmc; bnx2x_get_common_hwinfo() local 11050 pci_read_config_word(bp->pdev, bp->pdev->pm_cap + PCI_PM_PMC, &pmc); bnx2x_get_common_hwinfo() 11051 bp->flags |= (pmc & PCI_PM_CAP_PME_D3cold) ? 0 : NO_WOL_FLAG; bnx2x_get_common_hwinfo()
|
/linux-4.4.14/drivers/pci/host/ |
H A D | pci-tegra.c | 50 #include <soc/tegra/pmc.h>
|