void __init sabre_init(int pnode, char *model_name) 
void sabre_init(int pnode, char *model_name) 
void __init sabre_init(int pnode, char *model_name){	struct linux_prom64_registers pr_regs[2];	struct pci_controller_info *p;	struct pci_iommu *iommu;	int tsbsize, err;	u32 busrange[2];	u32 vdma[2];	u32 upa_portid, dma_mask;	u64 clear_irq;	hummingbird_p = 0;	if (!strcmp(model_name, "pci108e,a001"))		hummingbird_p = 1;	else if (!strcmp(model_name, "SUNW,sabre")) {		char compat[64];		if (prom_getproperty(pnode, "compatible",				     compat, sizeof(compat)) > 0 &&		    !strcmp(compat, "pci108e,a001")) {			hummingbird_p = 1;		} else {			int cpu_node;			/* Of course, Sun has to encode things a thousand			 * different ways, inconsistently.			 */			cpu_find_by_instance(0, &cpu_node, NULL);			if (prom_getproperty(cpu_node, "name",					     compat, sizeof(compat)) > 0 &&			    !strcmp(compat, "SUNW,UltraSPARC-IIe"))				hummingbird_p = 1;		}	}	p = kmalloc(sizeof(*p), GFP_ATOMIC);	if (!p) {		prom_printf("SABRE: Error, kmalloc(pci_controller_info) failed.\n");		prom_halt();	}	memset(p, 0, sizeof(*p));	iommu = kmalloc(sizeof(*iommu), GFP_ATOMIC);	if (!iommu) {		prom_printf("SABRE: Error, kmalloc(pci_iommu) failed.\n");		prom_halt();	}	memset(iommu, 0, sizeof(*iommu));	p->pbm_A.iommu = p->pbm_B.iommu = iommu;	upa_portid = prom_getintdefault(pnode, "upa-portid", 0xff);	p->next = pci_controller_root;	pci_controller_root = p;	p->pbm_A.portid = upa_portid;	p->pbm_B.portid = upa_portid;	p->index = pci_num_controllers++;	p->pbms_same_domain = 1;	p->scan_bus = sabre_scan_bus;	p->irq_build = sabre_irq_build;	p->base_address_update = sabre_base_address_update;	p->resource_adjust = sabre_resource_adjust;	p->pci_ops = &sabre_ops;	/*	 * Map in SABRE register set and report the presence of this SABRE.	 */	err = prom_getproperty(pnode, "reg",			       (char *)&pr_regs[0], sizeof(pr_regs));	if(err == 0 || err == -1) {		prom_printf("SABRE: Error, cannot get U2P registers "			    "from PROM.\n");		prom_halt();	}	/*	 * First REG in property is base of entire SABRE register space.	 */	p->pbm_A.controller_regs = pr_regs[0].phys_addr;	p->pbm_B.controller_regs = pr_regs[0].phys_addr;	printk("PCI: Found SABRE, main regs at %016lx\n",	       p->pbm_A.controller_regs);	/* Clear interrupts */	/* PCI first */	for (clear_irq = SABRE_ICLR_A_SLOT0; clear_irq < SABRE_ICLR_B_SLOT0 + 0x80; clear_irq += 8)		sabre_write(p->pbm_A.controller_regs + clear_irq, 0x0UL);	/* Then OBIO */	for (clear_irq = SABRE_ICLR_SCSI; clear_irq < SABRE_ICLR_SCSI + 0x80; clear_irq += 8)		sabre_write(p->pbm_A.controller_regs + clear_irq, 0x0UL);	/* Error interrupts are enabled later after the bus scan. */	sabre_write(p->pbm_A.controller_regs + SABRE_PCICTRL,		    (SABRE_PCICTRL_MRLEN   | SABRE_PCICTRL_SERR |		     SABRE_PCICTRL_ARBPARK | SABRE_PCICTRL_AEN));	/* Now map in PCI config space for entire SABRE. */	p->pbm_A.config_space = p->pbm_B.config_space =		(p->pbm_A.controller_regs + SABRE_CONFIGSPACE);	printk("SABRE: Shared PCI config space at %016lx\n",	       p->pbm_A.config_space);	err = prom_getproperty(pnode, "virtual-dma",			       (char *)&vdma[0], sizeof(vdma));	if(err == 0 || err == -1) {		prom_printf("SABRE: Error, cannot get virtual-dma property "			    "from PROM.\n");		prom_halt();	}	dma_mask = vdma[0];	switch(vdma[1]) {		case 0x20000000:			dma_mask |= 0x1fffffff;			tsbsize = 64;			break;		case 0x40000000:			dma_mask |= 0x3fffffff;			tsbsize = 128;			break;		case 0x80000000:			dma_mask |= 0x7fffffff;			tsbsize = 128;			break;		default:			prom_printf("SABRE: strange virtual-dma size.\n");			prom_halt();	}	sabre_iommu_init(p, tsbsize, vdma[0], dma_mask);	printk("SABRE: DVMA at %08x [%08x]\n", vdma[0], vdma[1]);	err = prom_getproperty(pnode, "bus-range",				       (char *)&busrange[0], sizeof(busrange));	if(err == 0 || err == -1) {		prom_printf("SABRE: Error, cannot get PCI bus-range "			    " from PROM.\n");		prom_halt();	}	p->pci_first_busno = busrange[0];	p->pci_last_busno = busrange[1];	/*	 * Look for APB underneath.	 */	sabre_pbm_init(p, pnode, vdma[0]);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/085ae41f66657a9655ce832b0a61832a06f0e1dc/pci_sabre.c/buggy/arch/sparc64/kernel/pci_sabre.c