示例#1
0
static inline uint8_t set_apicid_cpuid_lo(void)
{
#if CONFIG_K8_REV_F_SUPPORT == 0
        if(is_cpu_pre_e0()) return 0; // pre_e0 can not be set
#endif

        // set the NB_CFG[54]=1; why the OS will be happy with that ???
        msr_t msr;
        msr = rdmsr(NB_CFG_MSR);
        msr.hi |= (1<<(54-32)); // InitApicIdCpuIdLo
        wrmsr(NB_CFG_MSR, msr);

        return 1;
}
示例#2
0
static unsigned ht_read_freq_cap(device_t dev, unsigned pos)
{
	/* Handle bugs in valid hypertransport frequency reporting. */
	unsigned freq_cap;

	freq_cap = pci_read_config16(dev, pos);
	freq_cap &= ~(1 << HT_FREQ_VENDOR); /* Ignore Vendor HT frequencies. */

	/* AMD 8131 Errata 48. */
	if ((dev->vendor == PCI_VENDOR_ID_AMD) &&
	    (dev->device == PCI_DEVICE_ID_AMD_8131_PCIX)) {
		freq_cap &= ~(1 << HT_FREQ_800Mhz);
	}

	/* AMD 8151 Errata 23. */
	if ((dev->vendor == PCI_VENDOR_ID_AMD) &&
	    (dev->device == PCI_DEVICE_ID_AMD_8151_SYSCTRL)) {
		freq_cap &= ~(1 << HT_FREQ_800Mhz);
	}

	/* AMD K8 unsupported 1GHz? */
	if ((dev->vendor == PCI_VENDOR_ID_AMD) && (dev->device == 0x1100)) {
#if CONFIG_K8_HT_FREQ_1G_SUPPORT == 1

#if CONFIG_K8_REV_F_SUPPORT == 0
		/* Only e0 later suupport 1GHz HT. */
		if (is_cpu_pre_e0())
			freq_cap &= ~(1 << HT_FREQ_1000Mhz);
#endif

#else
		freq_cap &= ~(1 << HT_FREQ_1000Mhz);
#endif
	}

	return freq_cap;
}