Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | arch/powerpc/platforms/cell/spu_manage.c |
static int __init of_has_vicinity(void) {
struct device_node *dn;
for_each_node_by_type(dn, "spe") {
if (of_find_property(dn, "vicinity", NULL)) {
of_node_put(dn);
return 1;
}
}
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/cell/spu_manage.c |
static void __init init_affinity_fw(void) {
int cbe;
for (cbe = 0; cbe < MAX_NUMNODES; cbe++)
init_affinity_node(cbe);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/cell/spu_priv1_mmio.c |
static void int_mask_and(struct spu *spu, int class, u64 mask) {
u64 old_mask;
old_mask = in_be64(&spu->priv1->int_mask_RW[class]);
out_be64(&spu->priv1->int_mask_RW[class], old_mask & mask);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/cell/spu_priv1_mmio.c |
static void int_mask_or(struct spu *spu, int class, u64 mask) {
u64 old_mask;
old_mask = in_be64(&spu->priv1->int_mask_RW[class]);
out_be64(&spu->priv1->int_mask_RW[class], old_mask | mask);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/cell/spu_priv1_mmio.c |
static void int_mask_set(struct spu *spu, int class, u64 mask) {
out_be64(&spu->priv1->int_mask_RW[class], mask);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/cell/spu_priv1_mmio.c |
static u64 mfc_dar_get(struct spu *spu) {
return in_be64(&spu->priv1->mfc_dar_RW);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/cell/spu_syscalls.c |
void unregister_spu_syscalls(struct spufs_calls *calls) {
BUG_ON(spufs_calls->owner != calls->owner);
RCU_INIT_POINTER(spufs_calls, NULL);
synchronize_rcu();
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/chrp/pci.c | static int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
int len, u32 val) {
volatile void __iomem *cfg_data;
struct pci_controller *hose = pci_bus_to_host(bus);
if (bus->number > 7)
return PCIBIOS_DEVICE_NOT_FOUND;
cfg_data = hose->cfg_data + ((bus->number... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/chrp/pci.c | static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
int len, u32 *val) {
struct pci_controller *hose = pci_bus_to_host(bus);
unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) |
(((bus->number - hose->first_busno) & 0xff) << 1... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/chrp/pci.c | static void __init setup_python(struct pci_controller *hose,
struct device_node *dev) {
u32 __iomem *reg;
u32 val;
struct resource r;
if (of_address_to_resource(dev, 0, &r)) {
printk(KERN_ERR "No address for Python PCI controller\n");
return;
}
reg = ioremap(r.start... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/chrp/pci.c | static void __init setup_peg2(struct pci_controller *hose,
struct device_node *dev) {
struct device_node *root = of_find_node_by_path("/");
struct device_node *rtas;
rtas = of_find_node_by_name(root, "rtas");
if (rtas) {
hose->ops = &rtas_pci_ops;
of_node_put(rtas);
} el... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/chrp/pci.c | static void chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide) {
u8 progif;
struct pci_dev *viaisa;
if (!machine_is(chrp) || _chrp_type != _CHRP_Pegasos)
return;
if (viaide->irq != 14)
return;
viaisa = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL);
if (!viaisa)
return;
dev_i... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/chrp/pegasos_eth.c |
static int __init Enable_SRAM(void) {
u32 ALong;
if (mv643xx_reg_base == NULL)
mv643xx_reg_base =
ioremap(PEGASOS2_MARVELL_REGBASE, PEGASOS2_MARVELL_REGSIZE);
if (mv643xx_reg_base == NULL)
return -ENOMEM;
#ifdef BE_VERBOSE
printk("Pegasos II/Marvell MV64361: register remapped from %p to %p\n... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/chrp/setup.c | static void __init sio_fixup_irq(const char *name, u8 device, u8 level,
u8 type) {
u8 level0, type0, active;
sio_write(device, 0x07);
active = sio_read(0x30);
level0 = sio_read(0x70);
type0 = sio_read(0x71);
if (level0 != level || type0 != type || !active) {
printk(KERN... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/chrp/setup.c | static void __init pegasos_set_l2cr(void) {
struct device_node *np;
if (_chrp_type != _CHRP_Pegasos)
return;
/* Enable L2 cache if needed */
np = of_find_node_by_type(NULL, "cpu");
if (np != NULL) {
const unsigned int *l2cr = of_get_property(np, "l2cr", NULL);
if (l2cr == NULL) {
printk("P... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/chrp/setup.c | static void __init chrp_find_8259(void) {
struct device_node *np, *pic = NULL;
unsigned long chrp_int_ack = 0;
unsigned int cascade_irq;
for_each_node_by_type(
np, "interrupt-controller") if (of_device_is_compatible(np, "chrp,iic")) {
pic = np;
break;
}
/* Ok, 8259 wasn't found. We need to ha... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/chrp/smp.c |
static int smp_chrp_kick_cpu(int nr) {
*(unsigned long *)KERNELBASE = nr;
asm volatile("dcbf 0,%0" ::"r"(KERNELBASE) : "memory");
return 0;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/chrp/time.c |
long __init chrp_time_init(void) {
struct device_node *rtcs;
struct resource r;
int base;
rtcs = of_find_compatible_node(NULL, "rtc", "pnpPNP,b00");
if (rtcs == NULL)
rtcs = of_find_compatible_node(NULL, "rtc", "ds1385-rtc");
if (rtcs == NULL)
return 0;
if (of_address_to_resource(rtcs, 0, &r)) {... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/chrp/time.c |
static void chrp_cmos_clock_write(unsigned long val, int addr) {
if (nvram_as1 != 0)
outb(addr >> 8, nvram_as1);
outb(addr, nvram_as0);
outb(val, nvram_data);
return;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/flipper-pic.c | static void flipper_pic_ack(struct irq_data *d) {
int irq = irqd_to_hwirq(d);
void __iomem *io_base = irq_data_get_irq_chip_data(d);
out_be32(io_base + FLIPPER_ICR, 1 << irq);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/flipper-pic.c |
static void flipper_pic_unmask(struct irq_data *d) {
int irq = irqd_to_hwirq(d);
void __iomem *io_base = irq_data_get_irq_chip_data(d);
setbits32(io_base + FLIPPER_IMR, 1 << irq);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/flipper-pic.c | static void __flipper_quiesce(void __iomem *io_base) {
out_be32(io_base + FLIPPER_IMR, 0x00000000);
out_be32(io_base + FLIPPER_ICR, 0xffffffff);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/flipper-pic.c | unsigned int flipper_pic_get_irq(void) {
void __iomem *io_base = flipper_irq_host->host_data;
int irq;
u32 irq_status;
irq_status = in_be32(io_base + FLIPPER_ICR) & in_be32(io_base + FLIPPER_IMR);
if (irq_status == 0)
return 0;
irq = __ffs(irq_status);
return irq_linear_revmap(flipper_irq_host, irq)... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/gamecube.c |
static void __noreturn gamecube_halt(void) { gamecube_restart(NULL); } | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/holly.c |
static int holly_exclude_device(struct pci_controller *hose, u_char bus,
u_char devfn) {
if (bus == 0 && PCI_SLOT(devfn) == 0)
return PCIBIOS_DEVICE_NOT_FOUND;
else
return PCIBIOS_SUCCESSFUL;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/holly.c | static int __init holly_probe(void) {
if (!of_machine_is_compatible("ibm,holly"))
return 0;
return 1;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/linkstation.c | static int __init linkstation_add_bridge(struct device_node *dev) {
#ifdef CONFIG_PCI
int len;
struct pci_controller *hose;
const int *bus_range;
printk("Adding PCI host bridge %pOF\n", dev);
bus_range = of_get_property(dev, "bus-range", &len);
if (bus_range == NULL || len < 2 * sizeof(int))
printk(KE... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/linkstation.c | static void __init linkstation_init_IRQ(void) {
struct mpic *mpic;
mpic = mpic_alloc(NULL, 0, 0, 4, 0, " EPIC ");
BUG_ON(mpic == NULL);
mpic_assign_isu(mpic, 0, mpic->paddr + 0x10200);
/* I2C */
mpic_assign_isu(mpic, 1, mpic->paddr + 0x11000);
/* ttyS0, ttyS1 */
mpic_assign_isu(mpic, 2, mpic->pa... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/linkstation.c |
static void linkstation_show_cpuinfo(struct seq_file *m) {
seq_printf(m, "vendor\t\t: Buffalo Technology\n");
seq_printf(m, "machine\t\t: Linkstation I/Kurobox(HG)\n");
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/ls_uart.c | void avr_uart_configure(void) {
unsigned char cval = UART_LCR_WLEN8;
unsigned int quot = AVR_QUOT(avr_clock);
if (!avr_addr || !avr_clock)
return;
out_8(avr_addr + UART_LCR, cval);
out_8(avr_addr + UART_MCR, 0);
out_8(avr_addr + UART_IER, 0);
cval |= UART_LCR_STOP | UART_LCR_PARITY | UART_LCR_EPAR;... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c | static void __noreturn mpc7448_hpc2_restart(char *cmd) {
local_irq_disable();
mtmsr(mfmsr() | MSR_IP);
isync();
for (;;)
; /* Spin until reset happens */
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c | static int __init mpc7448_hpc2_probe(void) {
if (!of_machine_is_compatible("mpc74xx"))
return 0;
return 1;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/mvme5100.c |
static void mvme5100_8259_cascade(struct irq_desc *desc) {
struct irq_chip *chip = irq_desc_get_chip(desc);
unsigned int cascade_irq = i8259_irq();
if (cascade_irq)
generic_handle_irq(cascade_irq);
chip->irq_eoi(&desc->irq_data);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/mvme5100.c |
static void mvme5100_show_cpuinfo(struct seq_file *m) {
seq_puts(m, "Vendor\t\t: Motorola/Emerson\n");
seq_puts(m, "Machine\t\t: MVME5100\n");
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/mvme5100.c | static int __init mvme5100_probe(void) {
return of_machine_is_compatible("MVME5100");
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/storcenter.c |
static int __init storcenter_device_probe(void) {
of_platform_bus_probe(NULL, storcenter_of_bus, NULL);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/storcenter.c | static void __init storcenter_init_IRQ(void) {
struct mpic *mpic;
mpic = mpic_alloc(NULL, 0, 0, 16, 0, " OpenPIC ");
BUG_ON(mpic == NULL);
mpic_assign_isu(mpic, 0, mpic->paddr + 0x10200);
mpic_assign_isu(mpic, 1, mpic->paddr + 0x11000);
mpic_init(mpic);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c | static void ug_raw_putc(char ch) { ug_io_transaction(0xb0000000 | (ch << 20)); } | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c | static int ug_is_rxfifo_ready(void) {
return ug_io_transaction(0xd0000000) & 0x04000000;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c | static int ug_getc(void) {
int count = UG_READ_ATTEMPTS;
if (!ug_io_base)
return -1;
while (!ug_is_rxfifo_ready() && count--)
barrier();
return ug_raw_getc();
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c | static void __iomem *__init ug_udbg_setup_exi_io_base(struct device_node *np) {
void __iomem *exi_io_base = NULL;
phys_addr_t paddr;
const unsigned int *reg;
reg = of_get_property(np, "reg", NULL);
if (reg) {
paddr = of_translate_address(np, reg);
if (paddr)
exi_io_base = ioremap(paddr, reg[1])... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c | static void __iomem *__init ug_udbg_probe(void __iomem *exi_io_base) {
int i;
for (i = 0; i < 2; i++) {
ug_io_base = exi_io_base + 0x14 * i;
if (ug_is_adapter_present())
break;
}
if (i == 2)
ug_io_base = NULL;
return ug_io_base;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/embedded6xx/wii.c |
static void __noreturn wii_halt(void) {
if (ppc_md.restart)
ppc_md.restart(NULL);
wii_spin();
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/fsl_uli1575.c | static void early_uli5249(struct pci_dev *dev) {
unsigned char temp;
if (!is_quirk_valid())
return;
pci_write_config_word(dev, PCI_COMMAND,
PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
PCI_COMMAND_MASTER);
pci_read_config_byte(dev, 0x7c, &temp);
pci_write_co... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/fsl_uli1575.c | static void quirk_uli5229(struct pci_dev *dev) {
unsigned short temp;
if (!is_quirk_valid())
return;
pci_write_config_word(dev, PCI_COMMAND,
PCI_COMMAND_INTX_DISABLE | PCI_COMMAND_MASTER |
PCI_COMMAND_IO);
pci_read_config_word(dev, 0x4a, &temp);
pci_w... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/fsl_uli1575.c | static void hpcd_quirk_uli1575(struct pci_dev *dev) {
u32 temp32;
if (!machine_is(mpc86xx_hpcd))
return;
pci_read_config_dword(dev, 0x48, &temp32);
pci_write_config_dword(dev, 0x48, (temp32 | 1 << 26));
/* Enable sideband interrupt */
pci_read_config_dword(dev, 0x90, &temp32);
pci_write_config_dwor... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/fsl_uli1575.c | static void hpcd_quirk_uli5229(struct pci_dev *dev) {
unsigned char c;
if (!machine_is(mpc86xx_hpcd))
return;
pci_read_config_byte(dev, 0x4b, &c);
c |= 0x10;
pci_write_config_byte(dev, 0x4b, c);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/maple/pci.c | static int __init fixup_one_level_bus_range(struct device_node *node,
int higher) {
for (; node; node = node->sibling) {
const int *bus_range;
const unsigned int *class_code;
int len;
class_code = of_get_property(node, "class-code", NULL);
if (!class_co... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/maple/pci.c | static void __init fixup_bus_range(struct device_node *bridge) {
int *bus_range;
struct property *prop;
int len;
prop = of_find_property(bridge, "bus-range", &len);
if (prop == NULL || prop->value == NULL || len < 2 * sizeof(int)) {
printk(KERN_WARNING "Can't get bus-range for %pOF\n", bridge);
retur... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/maple/pci.c |
static int u3_ht_root_write_config(struct pci_controller *hose, u8 offset,
int len, u32 val) {
volatile void __iomem *addr;
addr = hose->cfg_addr + ((offset & ~3) << 2) + (4 - len - (offset & 3));
if (offset >= PCI_BASE_ADDRESS_0 && offset < PCI_CAPABILITY_LIST)
return PC... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/maple/pci.c | static int u3_ht_read_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 *val) {
struct pci_controller *hose;
volatile void __iomem *addr;
hose = pci_bus_to_host(bus);
if (hose == NULL)
return PCIBIOS_DEVICE_NOT_FOUND;
if (bus->number == hose->first_bus... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/maple/pci.c | static volatile void __iomem *
u4_pcie_cfg_access(struct pci_controller *hose, u8 bus, u8 dev_fn, int offset) {
unsigned int caddr;
if (bus == hose->first_busno)
caddr = u4_pcie_cfa0(dev_fn, offset);
else
caddr = u4_pcie_cfa1(bus, dev_fn, offset);
do {
out_le32(hose->cfg_addr, caddr);
} while (i... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/maple/pci.c | static void __init setup_u3_agp(struct pci_controller *hose) {
hose->first_busno = 0xf0;
hose->last_busno = 0xff;
hose->ops = &u3_agp_pci_ops;
hose->cfg_addr = ioremap(0xf0000000 + 0x800000, 0x1000);
hose->cfg_data = ioremap(0xf0000000 + 0xc00000, 0x1000);
u3_agp = hose;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/maple/pci.c | static void __init setup_u3_ht(struct pci_controller *hose) {
hose->ops = &u3_ht_pci_ops;
hose->cfg_data = ioremap(0xf2000000, 0x02000000);
hose->cfg_addr = ioremap(0xf8070000, 0x1000);
hose->first_busno = 0;
hose->last_busno = 0xef;
u3_ht = hose;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/maple/pci.c |
int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel) {
struct device_node *np;
unsigned int defirq = channel ? 15 : 14;
unsigned int irq;
if (pdev->vendor != PCI_VENDOR_ID_AMD ||
pdev->device != PCI_DEVICE_ID_AMD_8111_IDE)
return defirq;
np = pci_device_to_OF_node(pdev);
if (np =... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/maple/setup.c | static unsigned long maple_find_nvram_base(void) {
struct device_node *rtcs;
unsigned long result = 0;
rtcs = of_find_compatible_node(NULL, "nvram", "AMD8111");
if (rtcs) {
struct resource r;
if (of_address_to_resource(rtcs, 0, &r)) {
printk(KERN_EMERG "Maple: Unable to translate NVRAM"
... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/maple/setup.c | static void __init maple_setup_arch(void) {
loops_per_jiffy = 50000000;
/* Setup SMP callback */
#ifdef CONFIG_SMP
smp_ops = &maple_smp_ops;
#endif
maple_use_rtas_reboot_and_halt_if_present();
printk(KERN_DEBUG "Using native/NAP idle loop\n");
mmio_nvram_init();
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/maple/setup.c | static int __init maple_probe(void) {
if (!of_machine_is_compatible("Momentum,Maple") &&
!of_machine_is_compatible("Momentum,Apache"))
return 0;
pm_power_off = maple_power_off;
iommu_init_early_dart(&maple_pci_controller_ops);
return 1;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/maple/time.c |
static void maple_clock_write(unsigned long val, int addr) {
outb_p(addr, maple_rtc_addr);
outb_p(val, maple_rtc_addr + 1);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/maple/time.c | time64_t __init maple_get_boot_time(void) {
struct rtc_time tm;
struct device_node *rtcs;
rtcs = of_find_compatible_node(NULL, "rtc", "pnpPNP,b00");
if (rtcs) {
struct resource r;
if (of_address_to_resource(rtcs, 0, &r)) {
printk(KERN_EMERG "Maple: Unable to translate RTC"
... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/dma_lib.c | unsigned int pasemi_read_mac_reg(int intf, unsigned int reg) {
return in_le32(mac_regs[intf] + reg);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/dma_lib.c | void pasemi_write_dma_reg(unsigned int reg, unsigned int val) {
out_le32(dma_regs + reg, val);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/dma_lib.c |
static int pasemi_alloc_tx_chan(enum pasemi_dmachan_type type) {
int bit;
int start, limit;
switch (type & (TXCHAN_EVT0 | TXCHAN_EVT1)) {
case TXCHAN_EVT0:
start = 0;
limit = 10;
break;
case TXCHAN_EVT1:
start = 10;
limit = MAX_TXCH;
break;
default:
start = 0;
limit = MAX_T... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/dma_lib.c |
static void pasemi_free_tx_chan(int chan) {
BUG_ON(test_bit(chan, txch_free));
set_bit(chan, txch_free);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/dma_lib.c |
static int pasemi_alloc_rx_chan(void) {
int bit;
retry:
bit = find_first_bit(rxch_free, MAX_RXCH);
if (bit >= MAX_TXCH)
return -ENOSPC;
if (!test_and_clear_bit(bit, rxch_free))
goto retry;
return bit;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/dma_lib.c |
static void pasemi_free_rx_chan(int chan) {
BUG_ON(test_bit(chan, rxch_free));
set_bit(chan, rxch_free);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/dma_lib.c | void pasemi_dma_free_chan(struct pasemi_dmachan *chan) {
if (chan->ring_virt)
pasemi_dma_free_ring(chan);
switch (chan->chan_type & (RXCHAN | TXCHAN)) {
case RXCHAN:
pasemi_free_rx_chan(chan->chno);
break;
case TXCHAN:
pasemi_free_tx_chan(chan->chno);
break;
}
kfree(chan->priv);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/dma_lib.c | void pasemi_dma_free_ring(struct pasemi_dmachan *chan) {
BUG_ON(!chan->ring_virt);
dma_free_coherent(&dma_pdev->dev, chan->ring_size * sizeof(u64),
chan->ring_virt, chan->ring_dma);
chan->ring_virt = NULL;
chan->ring_size = 0;
chan->ring_dma = 0;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/dma_lib.c | void pasemi_dma_start_chan(const struct pasemi_dmachan *chan,
const u32 cmdsta) {
if (chan->chan_type == RXCHAN)
pasemi_write_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(chan->chno),
cmdsta | PAS_DMA_RXCHAN_CCMDSTA_EN);
else
pasemi_write_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/dma_lib.c | void pasemi_dma_free_buf(struct pasemi_dmachan *chan, int size,
dma_addr_t *handle) {
dma_free_coherent(&dma_pdev->dev, size, handle, GFP_KERNEL);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/dma_lib.c | void pasemi_dma_free_flag(int flag) {
BUG_ON(test_bit(flag, flags_free));
BUG_ON(flag >= MAX_FLAGS);
set_bit(flag, flags_free);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/dma_lib.c | int pasemi_dma_alloc_fun(void) {
int bit;
retry:
bit = find_first_bit(fun_free, MAX_FLAGS);
if (bit >= MAX_FLAGS)
return -ENOSPC;
if (!test_and_clear_bit(bit, fun_free))
goto retry;
return bit;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/dma_lib.c | static void *map_onedev(struct pci_dev *p, int index) {
struct device_node *dn;
void __iomem *ret;
dn = pci_device_to_OF_node(p);
if (!dn)
goto fallback;
ret = of_iomap(dn, index);
if (!ret)
goto fallback;
return ret;
fallback:
/* This is hardcoded and ugly, but we have some firmware versions... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/gpio_mdio.c |
static inline void mdc_lo(struct mii_bus *bus) {
out_le32(gpio_regs + 0x10, 1 << MDC_PIN(bus));
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/gpio_mdio.c |
static inline void mdc_hi(struct mii_bus *bus) {
out_le32(gpio_regs, 1 << MDC_PIN(bus));
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/gpio_mdio.c |
static inline int mdio_read(struct mii_bus *bus) {
return !!(in_le32(gpio_regs + 0x40) & (1 << MDIO_PIN(bus)));
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/gpio_mdio.c | static void bitbang_pre(struct mii_bus *bus, int read, u8 addr, u8 reg) {
int i;
mdio_active(bus);
for (i = 0; i < 40; i++) {
clock_out(bus, 1);
}
/* send the start bit (01) and the read opcode (10) or write (10) */
clock_out(bus, 0);
clock_out(bus, 1);
clock_out(bus, read);
clock_out(bus, !rea... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/gpio_mdio.c | static int gpio_mdio_read(struct mii_bus *bus, int phy_id, int location) {
u16 rdreg;
int ret, i;
u8 addr = phy_id & 0xff;
u8 reg = location & 0xff;
bitbang_pre(bus, 1, addr, reg);
mdio_tristate(bus);
udelay(DELAY);
mdc_hi(bus);
udelay(DELAY);
mdc_lo(bus);
/* read 16 bits of register data, MSB ... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/gpio_mdio.c | static int gpio_mdio_write(struct mii_bus *bus, int phy_id, int location,
u16 val) {
int i;
u8 addr = phy_id & 0xff;
u8 reg = location & 0xff;
u16 value = val & 0xffff;
bitbang_pre(bus, 0, addr, reg);
mdc_lo(bus);
mdio_hi(bus);
udelay(DELAY);
mdc_hi(bus);
udelay(DELAY);... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/gpio_mdio.c |
static int gpio_mdio_probe(struct platform_device *ofdev) {
struct device *dev = &ofdev->dev;
struct device_node *np = ofdev->dev.of_node;
struct mii_bus *new_bus;
struct gpio_priv *priv;
const unsigned int *prop;
int err;
err = -ENOMEM;
priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL);
if (!pr... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/iommu.c |
static void pci_dma_bus_setup_pasemi(struct pci_bus *bus) {
pr_debug("pci_dma_bus_setup, bus %p, bus->self %p\n", bus, bus->self);
if (!iommu_table_iobmap_inited) {
iommu_table_iobmap_inited = 1;
iommu_table_iobmap_setup();
}
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/iommu.c | static void pci_dma_dev_setup_pasemi(struct pci_dev *dev) {
pr_debug("pci_dma_dev_setup, dev %p (%s)\n", dev, pci_name(dev));
#if !defined(CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE)
if (dev->vendor == 0x1959 && dev->device == 0xa007 &&
!firmware_has_feature(FW_FEATURE_LPAR)) {
dev->dev.dma_ops = NULL;
/*
... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/msi.c |
static void mpic_pasemi_msi_unmask_irq(struct irq_data *data) {
pr_debug("mpic_pasemi_msi_unmask_irq %d\n", data->irq);
mpic_unmask_irq(data);
pci_msi_unmask_irq(data);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/msi.c | static int pasemi_msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) {
unsigned int virq;
struct msi_desc *entry;
struct msi_msg msg;
int hwirq;
if (type == PCI_CAP_ID_MSIX)
pr_debug("pasemi_msi: MSI-X untested, trying anyway\n");
pr_debug("pasemi_msi_setup_msi_irqs, pdev %p nvec %d type %d\n... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/pasemi.h | static inline void restore_astate(int cpu) {} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/pci.c | static inline int pa_pxp_offset_valid(u8 bus, u8 devfn, int offset) {
if (bus == 0 && devfn == 0)
return offset < 8192;
else
return offset < 4096;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/pci.c |
static inline int is_root_port(int busno, int devfn) {
return ((busno == 0) && (PCI_FUNC(devfn) < 4) &&
((PCI_SLOT(devfn) == 16) || (PCI_SLOT(devfn) == 17)));
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/pci.c |
static inline int is_5945_reg(int reg) {
return (((reg >= 0x18) && (reg < 0x34)) || ((reg >= 0x158) && (reg < 0x178)));
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/pci.c | static int workaround_5945(struct pci_bus *bus, unsigned int devfn, int offset,
int len, u32 *val) {
struct pci_controller *hose;
void volatile __iomem *addr, *dummy;
int byte;
u32 tmp;
if (!is_root_port(bus->number, devfn) || !is_5945_reg(offset))
return 0;
hose = pci_bus_t... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/pci.c | static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 *val) {
struct pci_controller *hose;
void volatile __iomem *addr;
hose = pci_bus_to_host(bus);
if (!hose)
return PCIBIOS_DEVICE_NOT_FOUND;
if (!pa_pxp_offset_valid(bus->number, d... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/pci.c | static int __init pas_add_bridge(struct device_node *dev) {
struct pci_controller *hose;
pr_debug("Adding PCI host bridge %pOF\n", dev);
hose = pcibios_alloc_controller(dev);
if (!hose)
return -ENOMEM;
hose->first_busno = 0;
hose->last_busno = 0xff;
hose->controller_ops = pasemi_pci_controller_ops;... | [
1,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/pci.c |
void __iomem *__init pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset) {
struct pci_controller *hose;
hose = pci_bus_to_host(dev->bus);
return (void __iomem *)pa_pxp_cfg_addr(hose, dev->bus->number, dev->devfn,
offset);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/setup.c | void pas_shutdown(void) {
void __iomem *pld_map = ioremap(0xf5000000, 4096);
while (1)
out_8(pld_map + 7, 0x01);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/setup.c |
static void pas_take_timebase(void) {
while (!timebase)
smp_rmb();
arch_spin_lock(&timebase_lock);
set_tb(timebase >> 32, timebase & 0xffffffff);
timebase = 0;
arch_spin_unlock(&timebase_lock);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/setup.c | static void __init nemo_init_IRQ(struct mpic *mpic) {
struct device_node *np;
int gpio_virq;
np = of_find_node_by_path("/pxp@0,e0000000");
i8259_init(np, 0);
of_node_put(np);
gpio_virq = irq_create_mapping(NULL, 3);
irq_set_irq_type(gpio_virq, IRQ_TYPE_LEVEL_HIGH);
irq_set_chained_handler(gpio_virq, s... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/setup.c |
static void __init pas_progress(char *s, unsigned short hex) {
printk("[%04x] : %s\n", hex, s ? s : "");
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/setup.c | static int __init pasemi_publish_devices(void) {
of_platform_bus_probe(NULL, pasemi_bus_ids, NULL);
nemo_init_rtc();
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/pasemi/time.c | time64_t __init pas_get_boot_time(void) {
return mktime64(2006, 1, 1, 12, 0, 0);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/powermac/backlight.c |
int pmac_has_backlight_type(const char *type) {
struct device_node *bk_node = of_find_node_by_name(NULL, "backlight");
if (bk_node) {
const char *prop = of_get_property(bk_node, "backlight-control", NULL);
if (prop && strncmp(prop, type, strlen(type)) == 0) {
of_node_put(bk_node);
return 1;
... | [
0,
0
] |
Linux Kernel | arch/powerpc/platforms/powermac/backlight.c |
static int __pmac_backlight_set_legacy_brightness(int brightness) {
int error = -ENXIO;
mutex_lock(&pmac_backlight_mutex);
if (pmac_backlight) {
struct backlight_properties *props;
props = &pmac_backlight->props;
props->brightness =
brightness * (props->max_brightness + 1) / (OLD_BACKLIGHT_... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.