diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-26 22:38:11 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-30 13:56:47 -0400 |
commit | 3e57eef64c53d4a45790fb7bb60a4ee6bf2bad30 (patch) | |
tree | dbddcdac6350f5cb0b9d482058ac752e09822572 /drivers/edac | |
parent | 116389ed21e4ad88f65e7ec5ed6ca224acb89115 (diff) |
i7300_edac: Better name PCI devices
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/i7300_edac.c | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c index 36265e21fef2..3e60dbaa0e7e 100644 --- a/drivers/edac/i7300_edac.c +++ b/drivers/edac/i7300_edac.c | |||
@@ -398,10 +398,10 @@ struct i7300_dimm_info { | |||
398 | 398 | ||
399 | /* driver private data structure */ | 399 | /* driver private data structure */ |
400 | struct i7300_pvt { | 400 | struct i7300_pvt { |
401 | struct pci_dev *system_address; /* 16.0 */ | 401 | struct pci_dev *pci_dev_16_0_fsb_ctlr; /* 16.0 */ |
402 | struct pci_dev *branchmap_werrors; /* 16.1 */ | 402 | struct pci_dev *pci_dev_16_1_fsb_addr_map; /* 16.1 */ |
403 | struct pci_dev *fsb_error_regs; /* 16.2 */ | 403 | struct pci_dev *pci_dev_16_2_fsb_err_regs; /* 16.2 */ |
404 | struct pci_dev *branch_pci[MAX_BRANCHES]; /* 21.0 and 22.0 */ | 404 | struct pci_dev *pci_dev_2x_0_fbd_branch[MAX_BRANCHES]; /* 21.0 and 22.0 */ |
405 | 405 | ||
406 | u16 tolm; /* top of low memory */ | 406 | u16 tolm; /* top of low memory */ |
407 | u64 ambase; /* AMB BAR */ | 407 | u64 ambase; /* AMB BAR */ |
@@ -509,7 +509,7 @@ static void i7300_get_error_info(struct mem_ctl_info *mci, | |||
509 | pvt = mci->pvt_info; | 509 | pvt = mci->pvt_info; |
510 | 510 | ||
511 | /* read in the 1st FATAL error register */ | 511 | /* read in the 1st FATAL error register */ |
512 | pci_read_config_dword(pvt->branchmap_werrors, FERR_FAT_FBD, &value); | 512 | pci_read_config_dword(pvt->pci_dev_16_1_fsb_addr_map, FERR_FAT_FBD, &value); |
513 | 513 | ||
514 | /* Mask only the bits that the doc says are valid | 514 | /* Mask only the bits that the doc says are valid |
515 | */ | 515 | */ |
@@ -522,15 +522,15 @@ static void i7300_get_error_info(struct mem_ctl_info *mci, | |||
522 | info->ferr_fat_fbd = value; | 522 | info->ferr_fat_fbd = value; |
523 | 523 | ||
524 | /* harvest the various error data we need */ | 524 | /* harvest the various error data we need */ |
525 | pci_read_config_dword(pvt->branchmap_werrors, | 525 | pci_read_config_dword(pvt->pci_dev_16_1_fsb_addr_map, |
526 | NERR_FAT_FBD, &info->nerr_fat_fbd); | 526 | NERR_FAT_FBD, &info->nerr_fat_fbd); |
527 | pci_read_config_word(pvt->branchmap_werrors, | 527 | pci_read_config_word(pvt->pci_dev_16_1_fsb_addr_map, |
528 | NRECMEMA, &info->nrecmema); | 528 | NRECMEMA, &info->nrecmema); |
529 | pci_read_config_word(pvt->branchmap_werrors, | 529 | pci_read_config_word(pvt->pci_dev_16_1_fsb_addr_map, |
530 | NRECMEMB, &info->nrecmemb); | 530 | NRECMEMB, &info->nrecmemb); |
531 | 531 | ||
532 | /* Clear the error bits, by writing them back */ | 532 | /* Clear the error bits, by writing them back */ |
533 | pci_write_config_dword(pvt->branchmap_werrors, | 533 | pci_write_config_dword(pvt->pci_dev_16_1_fsb_addr_map, |
534 | FERR_FAT_FBD, value); | 534 | FERR_FAT_FBD, value); |
535 | } else { | 535 | } else { |
536 | info->ferr_fat_fbd = 0; | 536 | info->ferr_fat_fbd = 0; |
@@ -540,7 +540,7 @@ static void i7300_get_error_info(struct mem_ctl_info *mci, | |||
540 | } | 540 | } |
541 | 541 | ||
542 | /* read in the 1st NON-FATAL error register */ | 542 | /* read in the 1st NON-FATAL error register */ |
543 | pci_read_config_dword(pvt->branchmap_werrors, FERR_NF_FBD, &value); | 543 | pci_read_config_dword(pvt->pci_dev_16_1_fsb_addr_map, FERR_NF_FBD, &value); |
544 | 544 | ||
545 | /* If there is an error, then read in the 1st NON-FATAL error | 545 | /* If there is an error, then read in the 1st NON-FATAL error |
546 | * register as well */ | 546 | * register as well */ |
@@ -548,17 +548,17 @@ static void i7300_get_error_info(struct mem_ctl_info *mci, | |||
548 | info->ferr_nf_fbd = value; | 548 | info->ferr_nf_fbd = value; |
549 | 549 | ||
550 | /* harvest the various error data we need */ | 550 | /* harvest the various error data we need */ |
551 | pci_read_config_dword(pvt->branchmap_werrors, | 551 | pci_read_config_dword(pvt->pci_dev_16_1_fsb_addr_map, |
552 | NERR_NF_FBD, &info->nerr_nf_fbd); | 552 | NERR_NF_FBD, &info->nerr_nf_fbd); |
553 | pci_read_config_word(pvt->branchmap_werrors, | 553 | pci_read_config_word(pvt->pci_dev_16_1_fsb_addr_map, |
554 | RECMEMA, &info->recmema); | 554 | RECMEMA, &info->recmema); |
555 | pci_read_config_dword(pvt->branchmap_werrors, | 555 | pci_read_config_dword(pvt->pci_dev_16_1_fsb_addr_map, |
556 | RECMEMB, &info->recmemb); | 556 | RECMEMB, &info->recmemb); |
557 | pci_read_config_dword(pvt->branchmap_werrors, | 557 | pci_read_config_dword(pvt->pci_dev_16_1_fsb_addr_map, |
558 | REDMEMB, &info->redmemb); | 558 | REDMEMB, &info->redmemb); |
559 | 559 | ||
560 | /* Clear the error bits, by writing them back */ | 560 | /* Clear the error bits, by writing them back */ |
561 | pci_write_config_dword(pvt->branchmap_werrors, | 561 | pci_write_config_dword(pvt->pci_dev_16_1_fsb_addr_map, |
562 | FERR_NF_FBD, value); | 562 | FERR_NF_FBD, value); |
563 | } else { | 563 | } else { |
564 | info->ferr_nf_fbd = 0; | 564 | info->ferr_nf_fbd = 0; |
@@ -769,13 +769,13 @@ static void i7300_enable_error_reporting(struct mem_ctl_info *mci) | |||
769 | pvt = mci->pvt_info; | 769 | pvt = mci->pvt_info; |
770 | 770 | ||
771 | /* Read the FBD Error Mask Register */ | 771 | /* Read the FBD Error Mask Register */ |
772 | pci_read_config_dword(pvt->branchmap_werrors, EMASK_FBD, | 772 | pci_read_config_dword(pvt->pci_dev_16_1_fsb_addr_map, EMASK_FBD, |
773 | &fbd_error_mask); | 773 | &fbd_error_mask); |
774 | 774 | ||
775 | /* Enable with a '0' */ | 775 | /* Enable with a '0' */ |
776 | fbd_error_mask &= ~(ENABLE_EMASK_ALL); | 776 | fbd_error_mask &= ~(ENABLE_EMASK_ALL); |
777 | 777 | ||
778 | pci_write_config_dword(pvt->branchmap_werrors, EMASK_FBD, | 778 | pci_write_config_dword(pvt->pci_dev_16_1_fsb_addr_map, EMASK_FBD, |
779 | fbd_error_mask); | 779 | fbd_error_mask); |
780 | } | 780 | } |
781 | #endif | 781 | #endif |
@@ -957,13 +957,13 @@ static int i7300_init_csrows(struct mem_ctl_info *mci) | |||
957 | for (branch = 0; branch < MAX_BRANCHES; branch++) { | 957 | for (branch = 0; branch < MAX_BRANCHES; branch++) { |
958 | /* Read and dump branch 0's MTRs */ | 958 | /* Read and dump branch 0's MTRs */ |
959 | channel = to_channel(0, branch); | 959 | channel = to_channel(0, branch); |
960 | pci_read_config_word(pvt->branch_pci[branch], AMBPRESENT_0, | 960 | pci_read_config_word(pvt->pci_dev_2x_0_fbd_branch[branch], AMBPRESENT_0, |
961 | &pvt->ambpresent[channel]); | 961 | &pvt->ambpresent[channel]); |
962 | debugf2("\t\tAMB-present CH%d = 0x%x:\n", | 962 | debugf2("\t\tAMB-present CH%d = 0x%x:\n", |
963 | channel, pvt->ambpresent[channel]); | 963 | channel, pvt->ambpresent[channel]); |
964 | 964 | ||
965 | channel = to_channel(1, branch); | 965 | channel = to_channel(1, branch); |
966 | pci_read_config_word(pvt->branch_pci[branch], AMBPRESENT_1, | 966 | pci_read_config_word(pvt->pci_dev_2x_0_fbd_branch[branch], AMBPRESENT_1, |
967 | &pvt->ambpresent[channel]); | 967 | &pvt->ambpresent[channel]); |
968 | debugf2("\t\tAMB-present CH%d = 0x%x:\n", | 968 | debugf2("\t\tAMB-present CH%d = 0x%x:\n", |
969 | channel, pvt->ambpresent[channel]); | 969 | channel, pvt->ambpresent[channel]); |
@@ -973,7 +973,7 @@ static int i7300_init_csrows(struct mem_ctl_info *mci) | |||
973 | for (slot = 0; slot < MAX_SLOTS; slot++) { | 973 | for (slot = 0; slot < MAX_SLOTS; slot++) { |
974 | int where = mtr_regs[slot]; | 974 | int where = mtr_regs[slot]; |
975 | for (branch = 0; branch < MAX_BRANCHES; branch++) { | 975 | for (branch = 0; branch < MAX_BRANCHES; branch++) { |
976 | pci_read_config_word(pvt->branch_pci[branch], | 976 | pci_read_config_word(pvt->pci_dev_2x_0_fbd_branch[branch], |
977 | where, | 977 | where, |
978 | &pvt->mtr[slot][branch]); | 978 | &pvt->mtr[slot][branch]); |
979 | for (ch = 0; ch < MAX_BRANCHES; ch++) { | 979 | for (ch = 0; ch < MAX_BRANCHES; ch++) { |
@@ -1027,13 +1027,13 @@ static int i7300_get_mc_regs(struct mem_ctl_info *mci) | |||
1027 | 1027 | ||
1028 | pvt = mci->pvt_info; | 1028 | pvt = mci->pvt_info; |
1029 | 1029 | ||
1030 | pci_read_config_dword(pvt->system_address, AMBASE, | 1030 | pci_read_config_dword(pvt->pci_dev_16_0_fsb_ctlr, AMBASE, |
1031 | (u32 *) &pvt->ambase); | 1031 | (u32 *) &pvt->ambase); |
1032 | 1032 | ||
1033 | debugf2("AMBASE= 0x%lx\n", (long unsigned int)pvt->ambase); | 1033 | debugf2("AMBASE= 0x%lx\n", (long unsigned int)pvt->ambase); |
1034 | 1034 | ||
1035 | /* Get the Branch Map regs */ | 1035 | /* Get the Branch Map regs */ |
1036 | pci_read_config_word(pvt->branchmap_werrors, TOLM, &pvt->tolm); | 1036 | pci_read_config_word(pvt->pci_dev_16_1_fsb_addr_map, TOLM, &pvt->tolm); |
1037 | pvt->tolm >>= 12; | 1037 | pvt->tolm >>= 12; |
1038 | debugf2("TOLM (number of 256M regions) =%u (0x%x)\n", pvt->tolm, | 1038 | debugf2("TOLM (number of 256M regions) =%u (0x%x)\n", pvt->tolm, |
1039 | pvt->tolm); | 1039 | pvt->tolm); |
@@ -1043,7 +1043,7 @@ static int i7300_get_mc_regs(struct mem_ctl_info *mci) | |||
1043 | actual_tolm/1000, actual_tolm % 1000, pvt->tolm << 28); | 1043 | actual_tolm/1000, actual_tolm % 1000, pvt->tolm << 28); |
1044 | 1044 | ||
1045 | /* Get memory controller settings */ | 1045 | /* Get memory controller settings */ |
1046 | pci_read_config_dword(pvt->branchmap_werrors, MC_SETTINGS, | 1046 | pci_read_config_dword(pvt->pci_dev_16_1_fsb_addr_map, MC_SETTINGS, |
1047 | &pvt->mc_settings); | 1047 | &pvt->mc_settings); |
1048 | debugf0("Memory controller operating on %s mode\n", | 1048 | debugf0("Memory controller operating on %s mode\n", |
1049 | pvt->mc_settings & (1 << 16)? "mirrored" : "non-mirrored"); | 1049 | pvt->mc_settings & (1 << 16)? "mirrored" : "non-mirrored"); |
@@ -1051,9 +1051,9 @@ static int i7300_get_mc_regs(struct mem_ctl_info *mci) | |||
1051 | pvt->mc_settings & (1 << 5)? "enabled" : "disabled"); | 1051 | pvt->mc_settings & (1 << 5)? "enabled" : "disabled"); |
1052 | 1052 | ||
1053 | /* Get Memory Interleave Range registers */ | 1053 | /* Get Memory Interleave Range registers */ |
1054 | pci_read_config_word(pvt->branchmap_werrors, MIR0, &pvt->mir[0]); | 1054 | pci_read_config_word(pvt->pci_dev_16_1_fsb_addr_map, MIR0, &pvt->mir[0]); |
1055 | pci_read_config_word(pvt->branchmap_werrors, MIR1, &pvt->mir[1]); | 1055 | pci_read_config_word(pvt->pci_dev_16_1_fsb_addr_map, MIR1, &pvt->mir[1]); |
1056 | pci_read_config_word(pvt->branchmap_werrors, MIR2, &pvt->mir[2]); | 1056 | pci_read_config_word(pvt->pci_dev_16_1_fsb_addr_map, MIR2, &pvt->mir[2]); |
1057 | 1057 | ||
1058 | /* Decode the MIR regs */ | 1058 | /* Decode the MIR regs */ |
1059 | for (i = 0; i < MAX_MIR; i++) | 1059 | for (i = 0; i < MAX_MIR; i++) |
@@ -1083,9 +1083,9 @@ static void i7300_put_devices(struct mem_ctl_info *mci) | |||
1083 | 1083 | ||
1084 | /* Decrement usage count for devices */ | 1084 | /* Decrement usage count for devices */ |
1085 | for (branch = 0; branch < MAX_CH_PER_BRANCH; branch++) | 1085 | for (branch = 0; branch < MAX_CH_PER_BRANCH; branch++) |
1086 | pci_dev_put(pvt->branch_pci[branch]); | 1086 | pci_dev_put(pvt->pci_dev_2x_0_fbd_branch[branch]); |
1087 | pci_dev_put(pvt->fsb_error_regs); | 1087 | pci_dev_put(pvt->pci_dev_16_2_fsb_err_regs); |
1088 | pci_dev_put(pvt->branchmap_werrors); | 1088 | pci_dev_put(pvt->pci_dev_16_1_fsb_addr_map); |
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | /* | 1091 | /* |
@@ -1103,7 +1103,7 @@ static int i7300_get_devices(struct mem_ctl_info *mci, int dev_idx) | |||
1103 | 1103 | ||
1104 | /* Attempt to 'get' the MCH register we want */ | 1104 | /* Attempt to 'get' the MCH register we want */ |
1105 | pdev = NULL; | 1105 | pdev = NULL; |
1106 | while (!pvt->branchmap_werrors || !pvt->fsb_error_regs) { | 1106 | while (!pvt->pci_dev_16_1_fsb_addr_map || !pvt->pci_dev_16_2_fsb_err_regs) { |
1107 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, | 1107 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, |
1108 | PCI_DEVICE_ID_INTEL_I7300_MCH_ERR, pdev); | 1108 | PCI_DEVICE_ID_INTEL_I7300_MCH_ERR, pdev); |
1109 | if (!pdev) { | 1109 | if (!pdev) { |
@@ -1121,28 +1121,28 @@ static int i7300_get_devices(struct mem_ctl_info *mci, int dev_idx) | |||
1121 | /* Store device 16 funcs 1 and 2 */ | 1121 | /* Store device 16 funcs 1 and 2 */ |
1122 | switch (PCI_FUNC(pdev->devfn)) { | 1122 | switch (PCI_FUNC(pdev->devfn)) { |
1123 | case 1: | 1123 | case 1: |
1124 | pvt->branchmap_werrors = pdev; | 1124 | pvt->pci_dev_16_1_fsb_addr_map = pdev; |
1125 | break; | 1125 | break; |
1126 | case 2: | 1126 | case 2: |
1127 | pvt->fsb_error_regs = pdev; | 1127 | pvt->pci_dev_16_2_fsb_err_regs = pdev; |
1128 | break; | 1128 | break; |
1129 | } | 1129 | } |
1130 | } | 1130 | } |
1131 | 1131 | ||
1132 | debugf1("System Address, processor bus- PCI Bus ID: %s %x:%x\n", | 1132 | debugf1("System Address, processor bus- PCI Bus ID: %s %x:%x\n", |
1133 | pci_name(pvt->system_address), | 1133 | pci_name(pvt->pci_dev_16_0_fsb_ctlr), |
1134 | pvt->system_address->vendor, pvt->system_address->device); | 1134 | pvt->pci_dev_16_0_fsb_ctlr->vendor, pvt->pci_dev_16_0_fsb_ctlr->device); |
1135 | debugf1("Branchmap, control and errors - PCI Bus ID: %s %x:%x\n", | 1135 | debugf1("Branchmap, control and errors - PCI Bus ID: %s %x:%x\n", |
1136 | pci_name(pvt->branchmap_werrors), | 1136 | pci_name(pvt->pci_dev_16_1_fsb_addr_map), |
1137 | pvt->branchmap_werrors->vendor, pvt->branchmap_werrors->device); | 1137 | pvt->pci_dev_16_1_fsb_addr_map->vendor, pvt->pci_dev_16_1_fsb_addr_map->device); |
1138 | debugf1("FSB Error Regs - PCI Bus ID: %s %x:%x\n", | 1138 | debugf1("FSB Error Regs - PCI Bus ID: %s %x:%x\n", |
1139 | pci_name(pvt->fsb_error_regs), | 1139 | pci_name(pvt->pci_dev_16_2_fsb_err_regs), |
1140 | pvt->fsb_error_regs->vendor, pvt->fsb_error_regs->device); | 1140 | pvt->pci_dev_16_2_fsb_err_regs->vendor, pvt->pci_dev_16_2_fsb_err_regs->device); |
1141 | 1141 | ||
1142 | pvt->branch_pci[0] = pci_get_device(PCI_VENDOR_ID_INTEL, | 1142 | pvt->pci_dev_2x_0_fbd_branch[0] = pci_get_device(PCI_VENDOR_ID_INTEL, |
1143 | PCI_DEVICE_ID_INTEL_I7300_MCH_FB0, | 1143 | PCI_DEVICE_ID_INTEL_I7300_MCH_FB0, |
1144 | NULL); | 1144 | NULL); |
1145 | if (!pvt->branch_pci[0]) { | 1145 | if (!pvt->pci_dev_2x_0_fbd_branch[0]) { |
1146 | i7300_printk(KERN_ERR, | 1146 | i7300_printk(KERN_ERR, |
1147 | "MC: 'BRANCH 0' device not found:" | 1147 | "MC: 'BRANCH 0' device not found:" |
1148 | "vendor 0x%x device 0x%x Func 0 (broken BIOS?)\n", | 1148 | "vendor 0x%x device 0x%x Func 0 (broken BIOS?)\n", |
@@ -1150,10 +1150,10 @@ static int i7300_get_devices(struct mem_ctl_info *mci, int dev_idx) | |||
1150 | goto error; | 1150 | goto error; |
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | pvt->branch_pci[1] = pci_get_device(PCI_VENDOR_ID_INTEL, | 1153 | pvt->pci_dev_2x_0_fbd_branch[1] = pci_get_device(PCI_VENDOR_ID_INTEL, |
1154 | PCI_DEVICE_ID_INTEL_I7300_MCH_FB1, | 1154 | PCI_DEVICE_ID_INTEL_I7300_MCH_FB1, |
1155 | NULL); | 1155 | NULL); |
1156 | if (!pvt->branch_pci[1]) { | 1156 | if (!pvt->pci_dev_2x_0_fbd_branch[1]) { |
1157 | i7300_printk(KERN_ERR, | 1157 | i7300_printk(KERN_ERR, |
1158 | "MC: 'BRANCH 1' device not found:" | 1158 | "MC: 'BRANCH 1' device not found:" |
1159 | "vendor 0x%x device 0x%x Func 0 " | 1159 | "vendor 0x%x device 0x%x Func 0 " |
@@ -1222,7 +1222,7 @@ static int i7300_probe1(struct pci_dev *pdev, int dev_idx) | |||
1222 | mci->dev = &pdev->dev; /* record ptr to the generic device */ | 1222 | mci->dev = &pdev->dev; /* record ptr to the generic device */ |
1223 | 1223 | ||
1224 | pvt = mci->pvt_info; | 1224 | pvt = mci->pvt_info; |
1225 | pvt->system_address = pdev; /* Record this device in our private */ | 1225 | pvt->pci_dev_16_0_fsb_ctlr = pdev; /* Record this device in our private */ |
1226 | 1226 | ||
1227 | /* 'get' the pci devices we want to reserve for our use */ | 1227 | /* 'get' the pci devices we want to reserve for our use */ |
1228 | if (i7300_get_devices(mci, dev_idx)) | 1228 | if (i7300_get_devices(mci, dev_idx)) |