Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
void pe_level_printk(const struct pnv_ioda_pe *pe, const char *level, const char *fmt, ...) { struct va_format vaf; va_list args; char pfix[32]; va_start(args, fmt); vaf.fmt = fmt; vaf.va = &args; if (pe->flags & PNV_IODA_PE_DEV) strscpy(pfix, dev_name(&pe->pdev->dev), sizeof(p...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static int __init iommu_setup(char *str) { if (!str) return -EINVAL; while (*str) { if (!strncmp(str, "nobypass", 8)) { pnv_iommu_bypass_disabled = true; pr_info("PowerNV: IOMMU bypass window disabled.\n"); break; } str += strcspn(str, ","); if (*str == ',') str++; } ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static struct pnv_ioda_pe *pnv_ioda_init_pe(struct pnv_phb *phb, int pe_no) { s64 rc; phb->ioda.pe_array[pe_no].phb = phb; phb->ioda.pe_array[pe_no].pe_number = pe_no; phb->ioda.pe_array[pe_no].dma_setup_done = false; rc = opal_pci_eeh_freeze_clear(phb->opal_id, pe_no, OPAL_...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static void pnv_ioda_reserve_pe(struct pnv_phb *phb, int pe_no) { if (!(pe_no >= 0 && pe_no < phb->ioda.total_pe_num)) { pr_warn("%s: Invalid PE %x on PHB#%x\n", __func__, pe_no, phb->hose->global_number); return; } mutex_lock(&phb->ioda.pe_alloc_mutex); if (test_and_set_bit(pe_no, phb->io...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
struct pnv_ioda_pe *pnv_ioda_alloc_pe(struct pnv_phb *phb, int count) { struct pnv_ioda_pe *ret = NULL; int run = 0, pe, i; mutex_lock(&phb->ioda.pe_alloc_mutex); for (pe = phb->ioda.total_pe_num - 1; pe >= 0; pe--) { if (test_bit(pe, phb->ioda.pe_alloc)) { run = 0; continue; } run++;...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
void pnv_ioda_free_pe(struct pnv_ioda_pe *pe) { struct pnv_phb *phb = pe->phb; unsigned int pe_num = pe->pe_number; WARN_ON(pe->pdev); memset(pe, 0, sizeof(struct pnv_ioda_pe)); mutex_lock(&phb->ioda.pe_alloc_mutex); clear_bit(pe_num, phb->ioda.pe_alloc); mutex_unlock(&phb->ioda.pe_alloc_mutex); }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static int pnv_ioda2_init_m64(struct pnv_phb *phb) { const char *desc; struct resource *r; s64 rc; rc = opal_pci_set_phb_mem_window(phb->opal_id, OPAL_M64_WINDOW_TYPE, phb->ioda.m64_bar_idx, phb->ioda.m64_base, 0, /* unused */ ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static struct pnv_ioda_pe *pnv_ioda_pick_m64_pe(struct pci_bus *bus, bool all) { struct pnv_phb *phb = pci_bus_to_pnvhb(bus); struct pnv_ioda_pe *master_pe, *pe; unsigned long size, *pe_alloc; int i; if (pci_is_root_bus(bus)) return NULL; /* Allocate bitmap */ size = ALIGN(phb->ioda.total_pe_num / 8...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
struct pnv_ioda_pe *pnv_ioda_get_pe(struct pci_dev *dev) { struct pnv_phb *phb = pci_bus_to_pnvhb(dev->bus); struct pci_dn *pdn = pci_get_pdn(dev); if (!pdn) return NULL; if (pdn->pe_number == IODA_INVALID_PE) return NULL; return &phb->ioda.pe_array[pdn->pe_number]; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static void pnv_ioda_unset_peltv(struct pnv_phb *phb, struct pnv_ioda_pe *pe, struct pci_dev *parent) { int64_t rc; while (parent) { struct pci_dn *pdn = pci_get_pdn(parent); if (pdn && pdn->pe_number != IODA_INVALID_PE) { rc = opal_pci_set_peltv(phb->opal_id, pdn->p...
[ 1, 1 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static struct pnv_ioda_pe *pnv_ioda_setup_dev_PE(struct pci_dev *dev) { struct pnv_phb *phb = pci_bus_to_pnvhb(dev->bus); struct pci_dn *pdn = pci_get_pdn(dev); struct pnv_ioda_pe *pe; if (!pdn) { pr_err("%s: Device tree node not associated properly\n", pci_name(dev)); return NULL; } if (pdn->pe_nu...
[ 1, 1 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static bool pnv_pci_ioda_iommu_bypass_supported(struct pci_dev *pdev, u64 dma_mask) { struct pnv_phb *phb = pci_bus_to_pnvhb(pdev->bus); struct pci_dn *pdn = pci_get_pdn(pdev); struct pnv_ioda_pe *pe; if (WARN_ON(!pdn || pdn->pe_number == IODA_INVALID_PE)) re...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static inline __be64 __iomem *pnv_ioda_get_inval_reg(struct pnv_phb *phb) { return phb->regs + 0x210; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static int pnv_ioda_tce_xchg_no_kill(struct iommu_table *tbl, long index, unsigned long *hpa, enum dma_data_direction *direction) { return pnv_tce_xchg(tbl, index, hpa, direction); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static inline void pnv_pci_phb3_tce_invalidate_pe(struct pnv_ioda_pe *pe) { __be64 __iomem *invalidate = pnv_ioda_get_inval_reg(pe->phb); unsigned long val = PHB3_TCE_KILL_INVAL_PE | (pe->pe_number & 0xFF); mb(); /* Ensure above stores are visible */ __raw_writeq_be(val, invalidate); }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static inline void pnv_pci_ioda2_tce_invalidate_pe(struct pnv_ioda_pe *pe) { struct pnv_phb *phb = pe->phb; if (phb->model == PNV_PHB_MODEL_PHB3 && phb->regs) pnv_pci_phb3_tce_invalidate_pe(pe); else opal_pci_tce_kill(phb->opal_id, OPAL_PCI_TCE_KILL_PE, pe->pe_number, 0, 0, 0); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static void pnv_pci_ioda2_set_bypass(struct pnv_ioda_pe *pe, bool enable) { uint16_t window_id = (pe->pe_number << 1) + 1; int64_t rc; pe_info(pe, "%sabling 64-bit DMA bypass\n", enable ? "En" : "Dis"); if (enable) { phys_addr_t top = memblock_end_of_DRAM(); top = roundup_pow_of_two(top); rc = op...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static long pnv_pci_ioda2_create_table_userspace( struct iommu_table_group *table_group, int num, __u32 page_shift, __u64 window_size, __u32 levels, struct iommu_table **ptbl) { long ret = pnv_pci_ioda2_create_table(table_group, num, page_shift, window_size, levels, tr...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static void pnv_ioda2_take_ownership(struct iommu_table_group *table_group) { struct pnv_ioda_pe *pe = container_of(table_group, struct pnv_ioda_pe, table_group); struct iommu_table *tbl = pe->table_group.tables[0]; pnv_pci_ioda2_set_bypass(pe, false); pnv_pci_ioda2_unset_window(&pe->table_group, 0); ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe) { int64_t rc; pe->tce_bypass_base = 1ull << 59; /* The PE will reserve all possible 32-bits space */ pe_info(pe, "Setting up 32-bit TCE table at 0..%08x\n", phb->ioda.m32_pci_base); /* Setup linux iommu table */ pe->ta...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
int64_t pnv_opal_pci_msi_eoi(struct irq_data *d) { struct pci_controller *hose = irq_data_get_irq_chip_data(d->parent_data); struct pnv_phb *phb = hose->private_data; return opal_pci_msi_eoi(phb->opal_id, d->parent_data->hwirq); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
void pnv_set_msi_irq_chip(struct pnv_phb *phb, unsigned int virq) { struct irq_data *idata; struct irq_chip *ichip; if (phb->model != PNV_PHB_MODEL_PHB3) return; if (!phb->ioda.irq_chip_init) { /* * First time we setup an MSI IRQ, we need to setup the * corresponding IRQ chip to route correc...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
bool is_pnv_opal_msi(struct irq_chip *chip) { return chip == &pnv_pci_msi_irq_chip; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static void pnv_msi_compose_msg(struct irq_data *d, struct msi_msg *msg) { struct msi_desc *entry = irq_data_get_msi_desc(d); struct pci_dev *pdev = msi_desc_to_pci_dev(entry); struct pci_controller *hose = irq_data_get_irq_chip_data(d); struct pnv_phb *phb = hose->private_data; int rc; rc = __pnv_pci_iod...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static void pnv_msi_eoi(struct irq_data *d) { struct pci_controller *hose = irq_data_get_irq_chip_data(d); struct pnv_phb *phb = hose->private_data; if (phb->model == PNV_PHB_MODEL_PHB3) { WARN_ON_ONCE(opal_pci_msi_eoi(phb->opal_id, d->hwirq)); } irq_chip_eoi_parent(d); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static void pnv_irq_domain_free(struct irq_domain *domain, unsigned int virq, unsigned int nr_irqs) { struct irq_data *d = irq_domain_get_irq_data(domain, virq); struct pci_controller *hose = irq_data_get_irq_chip_data(d); struct pnv_phb *phb = hose->private_data; pr_debug("%s b...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static int pnv_pci_diag_data_set(void *data, u64 val) { struct pnv_phb *phb = data; s64 ret; ret = opal_pci_get_phb_diag_data2(phb->opal_id, phb->diag_data, phb->diag_data_size); if (ret != OPAL_SUCCESS) return -EIO; /* Print the diag data to the kernel log */ pnv_p...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static void pnv_pci_enable_bridge(struct pci_bus *bus) { struct pci_dev *dev = bus->self; struct pci_bus *child; if (list_empty(&bus->devices)) return; /* * If there's a bridge associated with that bus enable it. This works * around races in the generic code if the enabling is done during * paral...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static void pnv_pci_ioda_fixup(void) { pnv_pci_ioda_create_dbgfs(); pnv_pci_enable_bridges(); #ifdef CONFIG_EEH pnv_eeh_post_init(); #endif }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static void pnv_pci_fixup_bridge_resources(struct pci_bus *bus, unsigned long type) { struct pci_controller *hose = pci_bus_to_host(bus); struct pnv_phb *phb = hose->private_data; struct pci_dev *bridge = bus->self; struct resource *r, *w; bool msi_region = false; ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static resource_size_t pnv_pci_default_alignment(void) { return PAGE_SIZE; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static bool pnv_pci_enable_device_hook(struct pci_dev *dev) { struct pci_dn *pdn; pdn = pci_get_pdn(dev); if (!pdn || pdn->pe_number == IODA_INVALID_PE) { pci_err(dev, "pci_enable_device() blocked, no PE assigned.\n"); return false; } return true; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static void pnv_ioda_release_pe(struct pnv_ioda_pe *pe) { struct pnv_phb *phb = pe->phb; struct pnv_ioda_pe *slave, *tmp; pe_info(pe, "Releasing PE\n"); mutex_lock(&phb->ioda.pe_list_mutex); list_del(&pe->list); mutex_unlock(&phb->ioda.pe_list_mutex); switch (phb->type) { case PNV_PHB_IODA1: pnv_...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
static void pnv_pci_release_device(struct pci_dev *pdev) { struct pnv_phb *phb = pci_bus_to_pnvhb(pdev->bus); struct pci_dn *pdn = pci_get_pdn(pdev); struct pnv_ioda_pe *pe; if (pdev->is_virtfn) return; if (!pdn || pdn->pe_number == IODA_INVALID_PE) return; #ifdef CONFIG_PCI_IOV /* * FIXME: Tr...
[ 1, 1 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci-ioda.c
void __init pnv_pci_init_npu2_opencapi_phb(struct device_node *np) { pnv_pci_init_ioda_phb(np, 0, PNV_PHB_NPU_OCAPI); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci.c
int pnv_pci_get_power_state(uint64_t id, uint8_t *state) { int64_t rc; if (!opal_check_token(OPAL_PCI_GET_POWER_STATE)) return -ENXIO; rc = opal_pci_get_power_state(id, (uint64_t)state); if (rc != OPAL_SUCCESS) return -EIO; return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci.c
int pnv_pci_cfg_read(struct pci_dn *pdn, int where, int size, u32 *val) { struct pnv_phb *phb = pdn->phb->private_data; u32 bdfn = (pdn->busno << 8) | pdn->devfn; s64 rc; switch (size) { case 1: { u8 v8; rc = opal_pci_config_read_byte(phb->opal_id, bdfn, where, &v8); *val = (rc == OPAL_SUCCESS) ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci.c
static int pnv_pci_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val) { struct pci_dn *pdn; struct pnv_phb *phb; int ret; *val = 0xFFFFFFFF; pdn = pci_get_pdn_by_devfn(bus, devfn); if (!pdn) return PCIBIOS_DEVICE_NOT_FOUND; if (!pnv_pc...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/pci.c
void pnv_pci_shutdown(void) { struct pci_controller *hose; list_for_each_entry(hose, &hose_list, list_node) if (hose->controller_ops.shutdown) hose->controller_ops.shutdown(hose); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/powernv.h
static inline void pnv_smp_init(void) {}
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/rng.c
static unsigned long rng_whiten(struct pnv_rng *rng, unsigned long val) { unsigned long parity; asm(".machine push; \ .machine power7; \ popcntd %0,%1; \ .machine pop;" : "=r"(parity) : "r"(val)); /* xor our value with the previous mask */ val ^= rng->mask; /* update th...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/rng.c
static __init void rng_init_per_cpu(struct pnv_rng *rng, struct device_node *dn) { int chip_id, cpu; chip_id = of_get_ibm_chip_id(dn); if (chip_id == -1) pr_warn("No ibm,chip-id found for %pOF.\n", dn); for_each_possible_cpu(cpu) { if (per_cpu(pnv_rng, cpu) == NULL...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/rng.c
void __init pnv_rng_init(void) { struct device_node *dn; if (!initialise_darn()) return; dn = of_find_compatible_node(NULL, NULL, "ibm,power-rng"); if (dn) ppc_md.get_random_seed = pnv_get_random_long_early; of_node_put(dn); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/rng.c
static int __init pnv_rng_late_init(void) { struct device_node *dn; unsigned long v; if (ppc_md.get_random_seed == pnv_get_random_long_early) pnv_get_random_long_early(&v); if (ppc_md.get_random_seed == pnv_get_random_long) { for_each_compatible_node(dn, NULL, "ibm,power-rng") of_platform_devi...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/setup.c
static void __init pnv_setup_arch(void) { set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT); pnv_setup_security_mitigations(); pnv_smp_init(); /* Setup RTC and NVRAM callbacks */ if (firmware_has_feature(FW_FEATURE_OPAL)) opal_nvram_init(); /* Enable NAP mode */ powersave_nap = 1; pnv_check_guarde...
[ 0, 1 ]
Linux Kernel
arch/powerpc/platforms/powernv/setup.c
static void __init pnv_init_IRQ(void) { if (!xive_native_init()) xics_init(); WARN_ON(!ppc_md.get_irq); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/setup.c
static void pnv_show_cpuinfo(struct seq_file *m) { struct device_node *root; const char *model = ""; root = of_find_node_by_path("/"); if (root) model = of_get_property(root, "model", NULL); seq_printf(m, "machine\t\t: PowerNV %s\n", model); if (firmware_has_feature(FW_FEATURE_OPAL)) seq_printf(m,...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/setup.c
static void __noreturn pnv_restart(char *cmd) { long rc; pnv_prepare_going_down(); do { if (!cmd || !strlen(cmd)) rc = opal_cec_reboot(); else if (strcmp(cmd, "full") == 0) rc = opal_cec_reboot2(OPAL_REBOOT_FULL_IPL, NULL); else if (strcmp(cmd, "mpipl") == 0) rc = opal_cec_reboot2(...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/setup.c
static void pnv_shutdown(void) { pnv_pci_shutdown(); /* * Stop OPAL activity: Unregister all OPAL interrupts so they * don't fire up while we kexec and make sure all potentially * DMA'ing ops are complete (such as dump retrieval). */ opal_shutdown(); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/setup.c
static void pnv_kexec_wait_secondaries_down(void) { int my_cpu, i, notified = -1; my_cpu = get_cpu(); for_each_online_cpu(i) { uint8_t status; int64_t rc, timeout = 1000; if (i == my_cpu) continue; for (;;) { rc = opal_query_cpu_status(get_hard_smp_processor_id(i), &status); ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/setup.c
static int __init pnv_probe(void) { if (!of_machine_is_compatible("ibm,powernv")) return 0; if (firmware_has_feature(FW_FEATURE_OPAL)) pnv_setup_machdep_opal(); pr_debug("PowerNV detected !\n"); pnv_init(); return 1; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/smp.c
static int pnv_smp_kick_cpu(int nr) { unsigned int pcpu; unsigned long start_here = __pa(ppc_function_entry(generic_secondary_smp_init)); long rc; uint8_t status; if (nr < 0 || nr >= nr_cpu_ids) return -EINVAL; pcpu = get_hard_smp_processor_id(nr); if (paca_ptrs[nr]->cpu_start || !firmware_ha...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/smp.c
static int pnv_smp_cpu_disable(void) { int cpu = smp_processor_id(); set_cpu_online(cpu, false); vdso_data->processorCount--; if (cpu == boot_cpuid) boot_cpuid = cpumask_any(cpu_online_mask); if (xive_enabled()) xive_smp_disable_cpu(); else xics_migrate_irqs_away(); cleanup_cpu_mmu_context()...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/smp.c
static void pnv_flush_interrupts(void) { if (cpu_has_feature(CPU_FTR_ARCH_300)) { if (xive_enabled()) xive_flush_interrupt(); else icp_opal_flush_interrupt(); } else { icp_native_flush_interrupt(); } }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/smp.c
static void __init pnv_smp_probe(void) { if (xive_enabled()) xive_smp_probe(); else xics_smp_probe(); if (cpu_has_feature(CPU_FTR_DBELL)) { ic_cause_ipi = smp_ops->cause_ipi; WARN_ON(!ic_cause_ipi); if (cpu_has_feature(CPU_FTR_ARCH_300)) smp_ops->cause_ipi = doorbell_global_ipi; e...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/smp.c
noinstr static int pnv_system_reset_exception(struct pt_regs *regs) { if (smp_handle_nmi_ipi(regs)) return 1; return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/subcore.c
static void wait_for_sync_step(int step) { int i, cpu = smp_processor_id(); for (i = cpu + 1; i < cpu + threads_per_core; i++) while (per_cpu(split_state, i).step < step) barrier(); mb(); }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/subcore.c
static void update_hid_in_slw(u64 hid0) { u64 idle_states = pnv_get_supported_cpuidle_states(); if (idle_states & OPAL_PM_WINKLE_ENABLED) { u64 cpu_pir = hard_smp_processor_id(); opal_slw_set_reg(cpu_pir, SPRN_HID0, hid0); } }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/subcore.h
static inline void update_subcore_sibling_mask(void) {} #endif #endif /* __ASSEMBLY__ */
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/ultravisor.c
static int __init uv_init(void) { struct device_node *node; if (!firmware_has_feature(FW_FEATURE_ULTRAVISOR)) return 0; node = of_find_compatible_node(NULL, NULL, "ibm,uv-firmware"); if (!node) return -ENODEV; uv_memcons = memcons_init(node, "memcons"); of_node_put(node); if (!uv_memcons) ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/vas-window.c
static void init_rsvd_tx_buf_count(struct pnv_vas_window *txwin, struct vas_winctx *winctx) { write_hvwc_reg(txwin, VREG(TX_RSVD_BUF_COUNT), 0ULL); }
[ 0, 1 ]
Linux Kernel
arch/powerpc/platforms/powernv/vas-window.c
static int vas_assign_window_id(struct ida *ida) { int winid = ida_alloc_max(ida, VAS_WINDOWS_PER_CHIP - 1, GFP_KERNEL); if (winid == -ENOSPC) { pr_err("Too many (%d) open windows\n", VAS_WINDOWS_PER_CHIP); return -EAGAIN; } return winid; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/vas-window.c
static void set_vinst_win(struct vas_instance *vinst, struct pnv_vas_window *window) { int id = window->vas_win.winid; mutex_lock(&vinst->mutex); if (!window->user_win && !window->tx_win) { WARN_ON_ONCE(vinst->rxwin[window->vas_win.cop]); vinst->rxwin[window->vas_win.cop] = win...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/vas-window.c
static bool tx_win_args_valid(enum vas_cop_type cop, struct vas_tx_win_attr *attr) { if (attr->tc_mode != VAS_THRESH_DISABLED) return false; if (cop > VAS_COP_TYPE_MAX) return false; if (attr->wcreds_max > VAS_TX_WCREDS_MAX) return false; if (attr->user_win) { i...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/vas-window.c
int vas_paste_crb(struct vas_window *vwin, int offset, bool re) { struct pnv_vas_window *txwin; int rc; void *addr; uint64_t val; txwin = container_of(vwin, struct pnv_vas_window, vas_win); trace_vas_paste_crb(current, txwin); WARN_ON_ONCE(txwin->nx_win && !re); addr = txwin->paste_kaddr; if (re) {...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/vas-window.c
void vas_return_credit(struct pnv_vas_window *window, bool tx) { uint64_t val; val = 0ULL; if (tx) { val = SET_FIELD(VAS_TX_WCRED, val, 1); write_hvwc_reg(window, VREG(TX_WCRED_ADDER), val); } else { val = SET_FIELD(VAS_LRX_WCRED, val, 1); write_hvwc_reg(window, VREG(LRX_WCRED_ADDER), val); }...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/vas-window.c
static u64 vas_user_win_paste_addr(struct vas_window *txwin) { struct pnv_vas_window *win; u64 paste_addr; win = container_of(txwin, struct pnv_vas_window, vas_win); vas_win_paste_addr(win, &paste_addr, NULL); return paste_addr; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/vas.c
static int vas_probe(struct platform_device *pdev) { return init_vas_instance(pdev); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/vas.h
static inline int vas_window_pid(struct vas_window *window) { return pid_vnr(window->task_ref.pid); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/vas.h
static inline u64 read_hvwc_reg(struct pnv_vas_window *win, char *name __maybe_unused, s32 reg) { return in_be64(win->hvwc_map + reg); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/powernv/vas.h
static inline void decode_pswid(u32 pswid, int *vasid, int *winid) { if (vasid) *vasid = pswid >> (31 - 7) & 0xFF; if (winid) *winid = pswid & 0xFFFF; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/device-init.c
static int __init ps3_setup_ohci_device(const struct ps3_repository_device *repo) { return ps3_setup_uhc_device(repo, PS3_MATCH_ID_OHCI, PS3_INTERRUPT_TYPE_SB_OHCI, PS3_REG_TYPE_SB_OHCI); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/device-init.c
static int __init ps3_setup_vuart_device(enum ps3_match_id match_id, unsigned int port_number) { int result; struct layout { struct ps3_system_bus_device dev; } *p; pr_debug(" -> %s:%d: match_id %u, port %u\n", __func__, __LINE__, match_id, port_number);...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/device-init.c
static int __init ps3_register_ramdisk_device(void) { int result; struct layout { struct ps3_system_bus_device dev; } *p; pr_debug(" -> %s:%d\n", __func__, __LINE__); p = kzalloc(sizeof(struct layout), GFP_KERNEL); if (!p) return -ENOMEM; p->dev.match_id = PS3_MATCH_ID_GPU; p->dev.match_sub...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/device-init.c
static int __init ps3_setup_static_device(const struct ps3_repository_device *repo) { int result; switch (repo->dev_type) { case PS3_DEV_TYPE_SB_GELIC: result = ps3_setup_gelic_device(repo); if (result) { pr_debug("%s:%d ps3_setup_gelic_device failed\n", __func__, __LINE__); } break; case...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/device-init.c
static int ps3_stop_probe_thread(struct notifier_block *nb, unsigned long code, void *data) { if (probe_task) kthread_stop(probe_task); return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/device-init.c
static int __init ps3_register_devices(void) { int result; if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) return -ENODEV; pr_debug(" -> %s:%d\n", __func__, __LINE__); result = ps3_start_probe_thread(PS3_BUS_TYPE_STORAGE); ps3_register_vuart_devices(); ps3_register_graphics_devices(); ps3_reposit...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/gelic_udbg.c
static void map_dma_mem(int bus_id, int dev_id, void *start, size_t len, u64 *real_bus_addr) { s64 result; u64 real_addr = ((u64)start) & 0x0fffffffffffffffUL; u64 real_end = real_addr + len; u64 map_start = real_addr & ~0xfff; u64 map_end = (real_end + 0xfff) & ~0xfff; u64 bus_addr...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/gelic_udbg.c
static void gelic_debug_shutdown(void) { if (bus_addr) unmap_dma_mem(GELIC_BUS_ID, GELIC_DEVICE_ID, bus_addr, sizeof(dbg)); lv1_close_device(GELIC_BUS_ID, GELIC_DEVICE_ID); }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/gelic_udbg.c
void __init udbg_init_ps3gelic(void) { gelic_debug_init(); udbg_putc = ps3gelic_udbg_putc; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/htab.c
static notrace void ps3_hpte_clear(void) { unsigned long hpte_count = (1UL << ppc64_pft_size) >> 4; u64 i; for (i = 0; i < hpte_count; i++) lv1_write_htab_entry(PS3_LPAR_VAS_ID_CURRENT, i, 0, 0); ps3_mm_shutdown(); ps3_mm_vas_destroy(); }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/interrupt.c
static int ps3_virq_setup(enum ps3_cpu_binding cpu, unsigned long outlet, unsigned int *virq) { int result; struct ps3_private *pd; if (cpu == PS3_BINDING_CPU_ANY) cpu = 0; pd = &per_cpu(ps3_private, cpu); *virq = irq_create_mapping(NULL, outlet); if (!*virq) { FAIL("%s...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/interrupt.c
static int ps3_virq_destroy(unsigned int virq) { const struct ps3_private *pd = irq_get_chip_data(virq); DBG("%s:%d: ppe_id %llu, thread_id %llu, virq %u\n", __func__, __LINE__, pd->ppe_id, pd->thread_id, virq); irq_set_chip_data(virq, NULL); irq_dispose_mapping(virq); DBG("%s:%d <-\n", __func__, __L...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/interrupt.c
int ps3_sb_event_receive_port_setup(struct ps3_system_bus_device *dev, enum ps3_cpu_binding cpu, unsigned int *virq) { int result; result = ps3_event_receive_port_setup(cpu, virq); if (result) return result; result = lv1_connect_int...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/interrupt.c
int ps3_spe_irq_setup(enum ps3_cpu_binding cpu, unsigned long spe_id, unsigned int class, unsigned int *virq) { int result; u64 outlet; BUG_ON(class > 2); result = lv1_get_spe_irq_outlet(spe_id, class, &outlet); if (result) { FAIL("%s:%d: lv1_get_spe_irq_outlet failed: %s\n", __fu...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/interrupt.c
int ps3_spe_irq_destroy(unsigned int virq) { int result; ps3_chip_mask(irq_get_irq_data(virq)); result = ps3_irq_plug_destroy(virq); BUG_ON(result); return result; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/interrupt.c
static void _dump_bmp(struct ps3_private *pd, const char *func, int line) { unsigned long flags; spin_lock_irqsave(&pd->bmp_lock, flags); _dump_64_bmp("stat", &pd->bmp.status, pd->thread_id, func, line); _dump_64_bmp("mask", (u64 *)&pd->bmp.mask, pd->thread_id, func, line); spin_unlock_irqrestore(&pd->bmp_lo...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/interrupt.c
static void __maybe_unused _dump_mask(struct ps3_private *pd, const char *func, int line) { unsigned long flags; spin_lock_irqsave(&pd->bmp_lock, flags); _dump_64_bmp("mask", (u64 *)&pd->bmp.mask, pd->thread_id, func, line); spin_unlock_irqrestore(&pd->bmp_lock, flags); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/interrupt.c
static int ps3_host_map(struct irq_domain *h, unsigned int virq, irq_hw_number_t hwirq) { DBG("%s:%d: hwirq %lu, virq %u\n", __func__, __LINE__, hwirq, virq); irq_set_chip_and_handler(virq, &ps3_irq_chip, handle_fasteoi_irq); return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/mm.c
static unsigned long __init make_page_sizes(unsigned long a, unsigned long b) { return (a << 56) | (b << 48); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/mm.c
void __init ps3_mm_vas_create(unsigned long *htab_size) { int result; u64 start_address; u64 size; u64 access_right; u64 max_page_size; u64 flags; result = lv1_query_logical_partition_address_region_info( 0, &start_address, &size, &access_right, &max_page_size, &flags); if (result) { DBG("%s...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/mm.c
/** * dma_sb_lpar_to_bus - Translate an lpar address to ioc mapped bus address. * @r: pointer to dma region structure * @lpar_addr: HV lpar address */ static unsigned long dma_sb_lpar_to_bus(struct ps3_dma_region *r, unsigned long lpar_addr) { if (lpar_addr >= map.rm.size)...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/mm.c
static int dma_sb_region_free(struct ps3_dma_region *r) { int result; struct dma_chunk *c; struct dma_chunk *tmp; BUG_ON(!r); if (!r->dev->bus_id) { pr_info("%s:%d: %llu:%llu no dma\n", __func__, __LINE__, r->dev->bus_id, r->dev->dev_id); return 0; } list_for_each_entry_safe(c, tmp,...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/mm.c
static int dma_ioc0_map_area(struct ps3_dma_region *r, unsigned long virt_addr, unsigned long len, dma_addr_t *bus_addr, u64 iopte_flag) { int result; unsigned long flags; struct dma_chunk *c; unsigned long phys_addr = is_kernel_addr(virt_addr) ? _...
[ 1, 1 ]
Linux Kernel
arch/powerpc/platforms/ps3/mm.c
static int dma_sb_unmap_area(struct ps3_dma_region *r, dma_addr_t bus_addr, unsigned long len) { unsigned long flags; struct dma_chunk *c; spin_lock_irqsave(&r->chunk_list.lock, flags); c = dma_find_chunk(r, bus_addr, len); if (!c) { unsigned long aligned_bus = ALIGN_DOWN(bu...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/mm.c
static int dma_ioc0_unmap_area(struct ps3_dma_region *r, dma_addr_t bus_addr, unsigned long len) { unsigned long flags; struct dma_chunk *c; DBG("%s: start a=%#llx l=%#lx\n", __func__, bus_addr, len); spin_lock_irqsave(&r->chunk_list.lock, flags); c = dma_find_chunk(r, bus_add...
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/mm.c
static int dma_sb_region_create_linear(struct ps3_dma_region *r) { int result; unsigned long virt_addr, len; dma_addr_t tmp; if (r->len > 16 * 1024 * 1024) { /* FIXME: need proper fix */ /* force 16M dma pages for linear mapping */ if (r->page_size != PS3_DMA_16M) { pr_info("%s:%d: forcing 16M pa...
[ 1, 1 ]
Linux Kernel
arch/powerpc/platforms/ps3/mm.c
int ps3_dma_region_free(struct ps3_dma_region *r) { BUG_ON(!r); BUG_ON(!r->region_ops); BUG_ON(!r->region_ops->free); return r->region_ops->free(r); }
[ 1, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/os-area.c
static void _dump_params(const struct os_area_params *p, const char *func, int line) { pr_debug("%s:%d: p.boot_flag: %u\n", func, line, p->boot_flag); pr_debug("%s:%d: p.num_params: %u\n", func, line, p->num_params); pr_debug("%s:%d: p.rtc_diff %lld\n", func, line, p->r...
[ 0, 0 ]
Linux Kernel
arch/powerpc/platforms/ps3/os-area.c
static int db_verify(const struct os_area_db *db) { if (memcmp(db->magic_num, OS_AREA_DB_MAGIC_NUM, sizeof(db->magic_num))) { pr_debug("%s:%d magic_num failed\n", __func__, __LINE__); return -EINVAL; } if (db->version != 1) { pr_debug("%s:%d version failed\n", __func__, __LINE__); return -EINVAL...
[ 1, 0 ]