Пример #1
0
void get_bus_conf(void)
{
	unsigned apicid_base, sbdn;
	device_t dev;
	int i;

	if (get_bus_conf_done == 1)
		return;		/* Do it only once. */

	get_bus_conf_done = 1;

	sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
	for (i = 0; i < sysconf.hc_possible_num; i++) {
		sysconf.pci1234[i] = pci1234x[i];
		sysconf.hcdn[i] = hcdnx[i];
	}

	get_sblk_pci1234();

	sysconf.sbdn = (sysconf.hcdn[0] & 0xff); // first byte of first chain
	sbdn = sysconf.sbdn;

	for (i = 0; i < 6; i++)
		bus_ck804[i] = 0;

	/* CK804 */
	dev = dev_find_slot(bus_ck804[0], PCI_DEVFN(sbdn + 0x09, 0));
	if (dev) {
		bus_ck804[1] = pci_read_config8(dev, PCI_SECONDARY_BUS);
		bus_ck804[2] = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
		bus_ck804[2]++;
	} else {
		printk
		    (BIOS_DEBUG, "ERROR - could not find PCI 1:%02x.0, using defaults\n",
		     sbdn + 0x09);
		bus_ck804[1] = 2;
		bus_ck804[2] = 3;
	}

	for (i = 2; i < 6; i++) {
		dev = dev_find_slot(bus_ck804[0],
				    PCI_DEVFN(sbdn + 0x0b + i - 2, 0));
		if (dev) {
			bus_ck804[i] = pci_read_config8(dev, PCI_SECONDARY_BUS);
		} else {
			printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n",
			     bus_ck804[0], sbdn + 0x0b + i - 2);
		}
	}

	if (IS_ENABLED(CONFIG_LOGICAL_CPUS)) {
		apicid_base = get_apicid_base(1);
		printk(BIOS_SPEW, "CONFIG_LOGICAL_CPUS==1: apicid_base: %08x\n", apicid_base);
	} else {
		apicid_base = CONFIG_MAX_PHYSICAL_CPUS;
		printk(BIOS_SPEW, "CONFIG_LOGICAL_CPUS==0: apicid_base: %08x\n", apicid_base);
	}
	apicid_ck804 = apicid_base + 0;
}
Пример #2
0
void get_bus_conf(void)
{
	unsigned apicid_base;
	struct mb_sysconf_t *m;

	device_t dev;
	int i;

	if(get_bus_conf_done==1) return; //do it only once

	get_bus_conf_done = 1;

	sysconf.mb = &mb_sysconf;

	m = sysconf.mb;
	memset(m, 0, sizeof(struct mb_sysconf_t));

	sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
	for(i=0;i<sysconf.hc_possible_num; i++) {
		sysconf.pci1234[i] = pci1234x[i];
		sysconf.hcdn[i] = hcdnx[i];
	}

	get_sblk_pci1234();

	sysconf.sbdn = (sysconf.hcdn[0] & 0xff); // first byte of first chain

	m->bus_mcp55[0] = (sysconf.pci1234[0] >> 16) & 0xff;

	/* MCP55 */
	dev = dev_find_slot(m->bus_mcp55[0], PCI_DEVFN(sysconf.sbdn + 0x06,0));
	if (dev) {
		m->bus_mcp55[1] = pci_read_config8(dev, PCI_SECONDARY_BUS);
	} else {
		printk(BIOS_DEBUG, "ERROR - could not find PCI 1:%02x.0, using defaults\n", sysconf.sbdn + 0x06);
	}

	for(i=2; i<8;i++) {
		dev = dev_find_slot(m->bus_mcp55[0], PCI_DEVFN(sysconf.sbdn + 0x0a + i - 2 , 0));
		if (dev) {
			m->bus_mcp55[i] = pci_read_config8(dev, PCI_SECONDARY_BUS);
		} else {
			printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", m->bus_mcp55[0], sysconf.sbdn + 0x0a + i - 2 );
		}
	}

/*I/O APICs:	APIC ID	Version	State		Address*/
#if CONFIG_LOGICAL_CPUS==1
	apicid_base = get_apicid_base(1);
#else
	apicid_base = CONFIG_MAX_PHYSICAL_CPUS;
#endif
	m->apicid_mcp55 = apicid_base+0;
}
Пример #3
0
void get_bus_conf(void)
{
	unsigned apicid_base;
	struct mb_sysconf_t *m;

	int i;

	if (get_bus_conf_done)
		return; //do it only once

	get_bus_conf_done = 1;

	sysconf.mb = &mb_sysconf;

	m = sysconf.mb;
	memset(m, 0, sizeof(struct mb_sysconf_t));

	sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
	for (i = 0; i < sysconf.hc_possible_num; i++) {
		sysconf.pci1234[i] = pci1234x[i];
		sysconf.hcdn[i] = hcdnx[i];
	}

	get_sblk_pci1234();

	sysconf.sbdn = (sysconf.hcdn[0] & 0xff); // first byte of first chain

	m->sbdnb = (sysconf.hcdn[1] & 0xff); // first byte of second chain

	m->bus_mcp55 = (sysconf.pci1234[0] >> 16) & 0xff;

		/* MCP55b */
	for (i = 1; i < sysconf.hc_possible_num; i++) {
		if (!(sysconf.pci1234[i] & 0x0f))
			continue;
		// check hcid type here
		sysconf.hcid[i] = get_hcid(i);
		if (!sysconf.hcid[i])
			continue; //unknown co processor

		m->bus_mcp55b = (sysconf.pci1234[1]>>16) & 0xff;
	}

/*I/O APICs:	APIC ID	Version	State		Address*/
#if CONFIG_LOGICAL_CPUS==1
	apicid_base = get_apicid_base(2);
#else
	apicid_base = CONFIG_MAX_PHYSICAL_CPUS;
#endif
	m->apicid_mcp55 = apicid_base+0;
	m->apicid_mcp55b = apicid_base+1;
}
Пример #4
0
void get_bus_conf(void)
{

	unsigned apicid_base;

	device_t dev;
	int i, j;
	struct mb_sysconf_t *m;

	if (get_bus_conf_done == 1)
		return;		//do it only once

	get_bus_conf_done = 1;

	sysconf.mb = &mb_sysconf;

	m = sysconf.mb;

	sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
	for (i = 0; i < sysconf.hc_possible_num; i++) {
		sysconf.pci1234[i] = pci1234x[i];
		sysconf.hcdn[i] = hcdnx[i];
	}

	get_sblk_pci1234();

	sysconf.sbdn = (sysconf.hcdn[0] >> 8) & 0xff;
	m->sbdn3 = sysconf.hcdn[0] & 0xff;

	m->bus_8132_0 = (sysconf.pci1234[0] >> 16) & 0xff;
	m->bus_8111_0 = m->bus_8132_0;

	/* 8111 */
	dev = dev_find_slot(m->bus_8111_0, PCI_DEVFN(sysconf.sbdn, 0));
	if (dev) {
		m->bus_8111_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
	} else {
		printk(BIOS_DEBUG,
		       "ERROR - could not find PCI %02x:%02x.0, using defaults\n",
		       m->bus_8111_0, sysconf.sbdn);
	}

	/* 8132-1 */
	dev = dev_find_slot(m->bus_8132_0, PCI_DEVFN(m->sbdn3, 0));
	if (dev) {
		m->bus_8132_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
	} else {
		printk(BIOS_DEBUG,
		       "ERROR - could not find PCI %02x:%02x.0, using defaults\n",
		       m->bus_8132_0, m->sbdn3);
	}

	/* 8132-2 */
	dev = dev_find_slot(m->bus_8132_0, PCI_DEVFN(m->sbdn3 + 1, 0));
	if (dev) {
		m->bus_8132_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
	} else {
		printk(BIOS_DEBUG,
		       "ERROR - could not find PCI %02x:%02x.0, using defaults\n",
		       m->bus_8132_0, m->sbdn3 + 1);
	}

	/* HT chain 1 */
	j = 0;
	for (i = 1; i < sysconf.hc_possible_num; i++) {
		if (!(sysconf.pci1234[i] & 0x1))
			continue;

		// check hcid type here
		sysconf.hcid[i] = get_hcid(i);

		switch (sysconf.hcid[i]) {

		case 1:	//8132
		case 3:	//8131

			m->bus_8132a[j][0] = (sysconf.pci1234[i] >> 16) & 0xff;

			m->sbdn3a[j] = sysconf.hcdn[i] & 0xff;

			/* 8132-1 */
			dev =
			    dev_find_slot(m->bus_8132a[j][0],
					  PCI_DEVFN(m->sbdn3a[j], 0));
			if (dev) {
				m->bus_8132a[j][1] =
				    pci_read_config8(dev, PCI_SECONDARY_BUS);
			} else {
				printk(BIOS_DEBUG,
				       "ERROR - could not find PCI %02x:%02x.0, using defaults\n",
				       m->bus_8132a[j][0], m->sbdn3a[j]);
			}

			/* 8132-2 */
			dev =
			    dev_find_slot(m->bus_8132a[j][0],
					  PCI_DEVFN(m->sbdn3a[j] + 1, 0));
			if (dev) {
				m->bus_8132a[j][2] =
				    pci_read_config8(dev, PCI_SECONDARY_BUS);
			} else {
				printk(BIOS_DEBUG,
				       "ERROR - could not find PCI %02x:%02x.0, using defaults\n",
				       m->bus_8132a[j][0], m->sbdn3a[j] + 1);
			}

			break;

		case 2:	//8151

			m->bus_8151[j][0] = (sysconf.pci1234[i] >> 16) & 0xff;
			m->sbdn5[j] = sysconf.hcdn[i] & 0xff;
			/* 8151 */
			dev =
			    dev_find_slot(m->bus_8151[j][0],
					  PCI_DEVFN(m->sbdn5[j] + 1, 0));

			if (dev) {
				m->bus_8151[j][1] =
				    pci_read_config8(dev, PCI_SECONDARY_BUS);
			} else {
				printk(BIOS_DEBUG,
				       "ERROR - could not find PCI %02x:%02x.0, using defaults\n",
				       m->bus_8151[j][0], m->sbdn5[j] + 1);
			}

			break;
		}

		j++;
	}

/*I/O APICs:	APIC ID	Version	State		Address*/
	if (IS_ENABLED(CONFIG_LOGICAL_CPUS))
		apicid_base = get_apicid_base(3);
	else
		apicid_base = CONFIG_MAX_PHYSICAL_CPUS;
	m->apicid_8111 = apicid_base + 0;
	m->apicid_8132_1 = apicid_base + 1;
	m->apicid_8132_2 = apicid_base + 2;
	for (i = 0; i < j; i++) {
		m->apicid_8132a[i][0] = apicid_base + 3 + i * 2;
		m->apicid_8132a[i][1] = apicid_base + 3 + i * 2 + 1;
	}

}
Пример #5
0
void get_bus_conf(void)
{

	unsigned apicid_base;

	device_t dev;
	int i;
	struct mb_sysconf_t *m;

	if(get_bus_conf_done==1) return; //do it only once

	get_bus_conf_done = 1;

	sysconf.mb = &mb_sysconf;

	m = sysconf.mb;

	sysconf.hc_possible_num = sizeof(pci1234x)/sizeof(pci1234x[0]);

	for(i=0;i<sysconf.hc_possible_num; i++) {
		sysconf.pci1234[i] = pci1234x[i];
		sysconf.hcdn[i] = hcdnx[i];
	}

	get_sblk_pci1234();

	sysconf.sbdn = (sysconf.hcdn[0] >> 8) & 0xff;
	m->sbdn2 = sysconf.hcdn[0] & 0xff; // bcm5780

	m->bus_bcm5785_0 = (sysconf.pci1234[0] >> 16) & 0xff;
	m->bus_bcm5780[0] = m->bus_bcm5785_0;

		/* bcm5785 */
	printk(BIOS_DEBUG, "search for def %d.0 on bus %d\n",sysconf.sbdn,m->bus_bcm5785_0);
	dev = dev_find_slot(m->bus_bcm5785_0, PCI_DEVFN(sysconf.sbdn,0));
	if (dev) {
		printk(BIOS_DEBUG, "found dev %s...\n",dev_path(dev));
		m->bus_bcm5785_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
		printk(BIOS_DEBUG, "secondary is %d...\n",m->bus_bcm5785_1);
		dev = dev_find_slot(m->bus_bcm5785_1, PCI_DEVFN(0xd,0));
		printk(BIOS_DEBUG, "now found %s...\n",dev_path(dev));
		if(dev) {
			m->bus_bcm5785_1_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
#if CONFIG_HT_CHAIN_END_UNITID_BASE >= CONFIG_HT_CHAIN_UNITID_BASE
			m->bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
			m->bus_isa++;
			printk(BIOS_DEBUG, "bus_isa 1=%d\n",m->bus_isa);
#endif
		}
	}
	else {
		printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", m->bus_bcm5785_0, sysconf.sbdn);
	}

		/* bcm5780 */
	for(i = 1; i < 6; i++) {
		dev = dev_find_slot(m->bus_bcm5780[0], PCI_DEVFN(m->sbdn2 + i - 1,0));
		if(dev) {
			m->bus_bcm5780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS);
#if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
			m->bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
			m->bus_isa++;
			printk(BIOS_DEBUG, "bus_isa 2=%d\n",m->bus_isa);
#endif

		}
		else {
			printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", m->bus_bcm5780[0], m->sbdn2+i-1);
		}
	}


/*I/O APICs:   APIC ID Version State	   Address*/
#if CONFIG_LOGICAL_CPUS==1
	apicid_base = get_apicid_base(3);
#else
	apicid_base = CONFIG_MAX_PHYSICAL_CPUS;
#endif
	for(i=0;i<3;i++)
		m->apicid_bcm5785[i] = apicid_base+i;
}
Пример #6
0
void get_bus_conf(void)
{

	unsigned apicid_base;

	device_t dev;
	int i;

	if(get_bus_conf_done==1) return; //do it only once

	get_bus_conf_done = 1;

	sysconf.mb = &mb_sysconf;
	struct mb_sysconf_t *m = sysconf.mb;

	sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);
	for(i=0;i<sysconf.hc_possible_num; i++) {
		sysconf.pci1234[i] = pci1234x[i];
		sysconf.hcdn[i] = hcdnx[i];
	}

	get_sblk_pci1234();

	sysconf.sbdn = (sysconf.hcdn[0] >> 8) & 0xff;
	m->sbdn3 = sysconf.hcdn[0] & 0xff;

	m->bus_8131_0 = (sysconf.pci1234[0] >> 16) & 0xff;
	m->bus_8111_0 = m->bus_8131_0;

	/* 8111 */
	dev = dev_find_slot(m->bus_8111_0, PCI_DEVFN(sysconf.sbdn,0));
	if (dev) {
		m->bus_8111_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
	}
	else {
		printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:03.0, using defaults\n", m->bus_8111_0);
	}

	/* 8131-1 */
	dev = dev_find_slot(m->bus_8131_0, PCI_DEVFN(m->sbdn3,0));
	if (dev) {
		m->bus_8131_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
	}
	else {
		printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:01.0, using defaults\n", m->bus_8131_0);
	}

	/* 8131-2 */
	dev = dev_find_slot(m->bus_8131_0, PCI_DEVFN(m->sbdn3+1,0));
	if (dev) {
		m->bus_8131_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
	}
	else {
		printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:02.0, using defaults\n", m->bus_8131_0);
	}


/*I/O APICs:	APIC ID	Version	State		Address*/
#if CONFIG_LOGICAL_CPUS
	apicid_base = get_apicid_base(3);
#else
	apicid_base = CONFIG_MAX_PHYSICAL_CPUS;
#endif
	m->apicid_8111 = apicid_base+0;
	m->apicid_8131_1 = apicid_base+1;
	m->apicid_8131_2 = apicid_base+2;
}
Пример #7
0
void get_bus_conf(void)
{

       unsigned apicid_base;

        device_t dev;
        int i;
       struct mb_sysconf_t *m;

        if(get_bus_conf_done==1) return; //do it only once

        get_bus_conf_done = 1;

       sysconf.mb = &mb_sysconf;

       m = sysconf.mb;

        sysconf.hc_possible_num = ARRAY_SIZE(pci1234x);

        for(i=0;i<sysconf.hc_possible_num; i++) {
                sysconf.pci1234[i] = pci1234x[i];
                sysconf.hcdn[i] = hcdnx[i];
        }

        get_sblk_pci1234();

        sysconf.sbdn = (sysconf.hcdn[0] >> 8) & 0xff;
        m->sbdn2 = sysconf.hcdn[0] & 0xff; // bcm5780

       m->bus_bcm5785_0 = (sysconf.pci1234[0] >> 16) & 0xff;
       m->bus_bcm5780[0] = m->bus_bcm5785_0;

                /* bcm5785 */
        dev = dev_find_slot(m->bus_bcm5785_0, PCI_DEVFN(sysconf.sbdn,0));
        if (dev) {
                m->bus_bcm5785_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
               dev = dev_find_slot(m->bus_bcm5785_1, PCI_DEVFN(0xd,0));
               if(dev) {
                       m->bus_bcm5785_1_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
               }
        }
       else {
                printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", m->bus_bcm5785_0, sysconf.sbdn);
        }

               /* bcm5780 */
       for(i = 1; i < 7; i++) {
               dev = dev_find_slot(m->bus_bcm5780[0], PCI_DEVFN(m->sbdn2 + i - 1,0));
               if(dev) {
                       m->bus_bcm5780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS);
               }
               else {
                       printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", m->bus_bcm5780[0], m->sbdn2+i-1);
               }
       }


/*I/O APICs:   APIC ID Version State           Address*/
#if CONFIG_LOGICAL_CPUS==1
       apicid_base = get_apicid_base(3);
#else
       apicid_base = CONFIG_MAX_PHYSICAL_CPUS;
#endif
       for(i=0;i<3;i++)
               m->apicid_bcm5785[i] = apicid_base+i;
}