- /* cpu vendor/model specific handling */
- if (!strncmp(infop->cpuid_vendor, CPUID_VID_AMD, sizeof(CPUID_VID_AMD)))
- {
- /* Check for AMD Athlon 64 and Opteron */
- if (cpuid_family() == 0xF)
- {
- uint32_t cpuid_result[4];
-
- /* check if cpu support Address Sizes function */
- do_cpuid(0x80000000, cpuid_result);
- if (cpuid_result[0] >= 0x80000008)
- {
- int bits;
-
- do_cpuid(0x80000008, cpuid_result);
- DBG("MTRR: AMD 8000_0008 EAX = %08x\n",
- cpuid_result[0]);
-
- /*
- * Function 8000_0008 (Address Sizes) EAX
- * Bits 7-0 : phys address size
- * Bits 15-8 : virt address size
- */
- bits = cpuid_result[0] & 0xFF;
- if ((bits < 36) || (bits > 64))
- {
- printf("MTRR: bad address size\n");
- return; /* bogus size */
- }
-
- mtrr_phys_mask = PHYS_BITS_TO_MASK(bits);
- }
- }
- }
-