Пример #1
0
static void pci_init(struct device *dev)
{
	u32 dword;
	device_t pci_domain_dev;
	struct resource *mem, *pref;

	dword = pci_read_config32(dev, 0x04);
	dword |= (1 << 8);	/* System error enable */
	dword |= (1 << 30);	/* Clear possible errors */
	pci_write_config32(dev, 0x04, dword);

#if 0
	word = pci_read_config16(dev, 0x48);
	word |= (1 << 0);	/* MRL2MRM */
	word |= (1 << 2);	/* MR2MRM */
	pci_write_config16(dev, 0x48, word);
#endif

#if 1
	dword = pci_read_config32(dev, 0x4c);
	dword |= 0x00440000;	/* TABORT_SER_ENABLE Park Last Enable. */
	pci_write_config32(dev, 0x4c, dword);
#endif

	pci_domain_dev = dev->bus->dev;
	while (pci_domain_dev) {
		if (pci_domain_dev->path.type == DEVICE_PATH_PCI_DOMAIN)
			break;
		pci_domain_dev = pci_domain_dev->bus->dev;
	}

	if (!pci_domain_dev)
		return;		/* Impossible */

	pref = probe_resource(pci_domain_dev, IOINDEX_SUBTRACTIVE(2,0));
	mem = probe_resource(pci_domain_dev, IOINDEX_SUBTRACTIVE(1,0));

	if (!mem)
		return;		/* Impossible */

	if (!pref || pref->base > mem->base) {
		dword = mem->base & (0xffff0000UL);
		printk(BIOS_DEBUG, "PCI DOMAIN mem base = 0x%010Lx\n", mem->base);
	} else {
		dword = pref->base & (0xffff0000UL);
		printk(BIOS_DEBUG, "PCI DOMAIN pref base = 0x%010Lx\n", pref->base);
	}

	printk(BIOS_DEBUG, "[0x50] <-- 0x%08x\n", dword);
	pci_write_config32(dev, 0x50, dword);	/* TOM */
}
Пример #2
0
static int reg_useable(unsigned reg, device_t goal_dev, unsigned goal_nodeid,
		       unsigned goal_link)
{
	struct resource *res;
	unsigned nodeid, link = 0;
	int result;
	res = 0;
	for (nodeid = 0; !res && (nodeid < fx_devs); nodeid++) {
		device_t dev;
		dev = __f0_dev[nodeid];
		if (!dev)
			continue;
		for (link = 0; !res && (link < 8); link++) {
			res = probe_resource(dev, IOINDEX(0x1000 + reg, link));
		}
	}
	result = 2;
	if (res) {
		result = 0;
		if ((goal_link == (link - 1)) &&
		    (goal_nodeid == (nodeid - 1)) && (res->flags <= 1)) {
			result = 1;
		}
	}
	return result;
}
Пример #3
0
static int reg_useable(unsigned reg, device_t goal_dev, unsigned goal_nodeid,
            unsigned goal_link)
{
    struct resource *res;
    unsigned nodeid, link = 0;
    int result;
    printk(BIOS_DEBUG, "\nFam12h - northbridge.c - reg_useable - Start.\n");
    res = 0;
    for(nodeid = 0; !res && (nodeid < fx_devs); nodeid++) {
        device_t dev;
        dev = __f0_dev[nodeid];
        if (!dev)
            continue;
        for(link = 0; !res && (link < 8); link++) {
            res = probe_resource(dev, IOINDEX(0x1000 + reg, link));
        }
    }
    result = 2;
    if (res) {
        result = 0;
        if (    (goal_link == (link - 1)) &&
            (goal_nodeid == (nodeid - 1)) &&
            (res->flags <= 1)) {
            result = 1;
        }
    }
    printk(BIOS_DEBUG, "Fam12h - northbridge.c - reg_useable - End.\n");
    return result;
}