|
Lines 866-882
static void
Link Here
|
| 866 |
pn_identify(driver_t *driver, device_t parent) |
866 |
pn_identify(driver_t *driver, device_t parent) |
| 867 |
{ |
867 |
{ |
| 868 |
|
868 |
|
| 869 |
if ((amd_pminfo & AMDPM_FID) == 0 || (amd_pminfo & AMDPM_VID) == 0) |
869 |
if ((amd_pminfo & AMDPM_FID) == 0 || (amd_pminfo & AMDPM_VID) == 0) { |
|
|
870 |
printf("powernow: pn_identify: amd_pminfo=0x%04x .\n", amd_pminfo); |
| 870 |
return; |
871 |
return; |
|
|
872 |
} |
| 871 |
switch (cpu_id & 0xf00) { |
873 |
switch (cpu_id & 0xf00) { |
| 872 |
case 0x600: |
874 |
case 0x600: |
| 873 |
case 0xf00: |
875 |
case 0xf00: |
| 874 |
break; |
876 |
break; |
| 875 |
default: |
877 |
default: |
|
|
878 |
printf("powernow: pn_identify: cpu_id=0x%04x.\n", cpu_id); |
| 876 |
return; |
879 |
return; |
| 877 |
} |
880 |
} |
| 878 |
if (device_find_child(parent, "powernow", -1) != NULL) |
881 |
if (device_find_child(parent, "powernow", -1) != NULL) { |
|
|
882 |
printf("powernow: pn_identify: No \"powernow\"device found.\n"); |
| 879 |
return; |
883 |
return; |
|
|
884 |
} |
| 880 |
if (BUS_ADD_CHILD(parent, 10, "powernow", -1) == NULL) |
885 |
if (BUS_ADD_CHILD(parent, 10, "powernow", -1) == NULL) |
| 881 |
device_printf(parent, "powernow: add child failed\n"); |
886 |
device_printf(parent, "powernow: add child failed\n"); |
| 882 |
} |
887 |
} |
|
Lines 895-902
pn_probe(device_t dev)
Link Here
|
| 895 |
status = rdmsr(MSR_AMDK7_FIDVID_STATUS); |
900 |
status = rdmsr(MSR_AMDK7_FIDVID_STATUS); |
| 896 |
|
901 |
|
| 897 |
pc = cpu_get_pcpu(dev); |
902 |
pc = cpu_get_pcpu(dev); |
| 898 |
if (pc == NULL) |
903 |
if (pc == NULL) { |
|
|
904 |
printf("powernow: cpu_get_pcpu() returned NULL.\n"); |
| 899 |
return (ENODEV); |
905 |
return (ENODEV); |
|
|
906 |
} |
| 900 |
|
907 |
|
| 901 |
cpu_est_clockrate(pc->pc_cpuid, &rate); |
908 |
cpu_est_clockrate(pc->pc_cpuid, &rate); |
| 902 |
|
909 |
|
|
Lines 936-941
pn_probe(device_t dev)
Link Here
|
| 936 |
device_set_desc(dev, "Cool`n'Quiet K8"); |
943 |
device_set_desc(dev, "Cool`n'Quiet K8"); |
| 937 |
break; |
944 |
break; |
| 938 |
default: |
945 |
default: |
|
|
946 |
printf("powernow: cpuid 0x%04x & 0xf00 not matched.\n", cpu_id); |
| 939 |
return (ENODEV); |
947 |
return (ENODEV); |
| 940 |
} |
948 |
} |
| 941 |
|
949 |
|