Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200014
b: refs/heads/master
c: 1c6fed8
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed May 10, 2010
1 parent b0dee55 commit dada388
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ef708b53b98f2b53d9686a9f8f0b8d437952c295
refs/heads/master: 1c6fed808f1ccd0804786e87f6b2c907dcd730fa
48 changes: 38 additions & 10 deletions trunk/drivers/edac/i7core_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,17 @@ static int i7core_get_active_channels(int *channels)
(*channels)++;
}

debugf0("Number of active channels: %d\n", *channels);

return 0;
}

static int get_dimm_config(struct mem_ctl_info *mci)
{
struct i7core_pvt *pvt = mci->pvt_info;
int i;
struct csrow_info *csr;
int i, csrow = 0;
enum edac_type mode;

if (!pvt->pci_mcr[0])
return -ENODEV;
Expand All @@ -365,18 +369,24 @@ static int get_dimm_config(struct mem_ctl_info *mci)
pci_read_config_dword(pvt->pci_mcr[0], MC_STATUS,
&pvt->info.mc_status);
pci_read_config_dword(pvt->pci_mcr[0], MC_MAX_DOD,
&pvt->info.max_dod);
&pvt->info.max_dod);
pci_read_config_dword(pvt->pci_mcr[0], MC_CHANNEL_MAPPER,
&pvt->info.ch_map);

debugf0("MC control=0x%08x status=0x%08x dod=0x%08x map=0x%08x\n",
pvt->info.mc_control, pvt->info.mc_status,
pvt->info.max_dod, pvt->info.ch_map);

if (ECC_ENABLED(pvt))
if (ECC_ENABLED(pvt)) {
debugf0("ECC enabled with x%d SDCC\n", ECCx8(pvt)?8:4);
else
if (ECCx8(pvt))
mode = EDAC_S8ECD8ED;
else
mode = EDAC_S4ECD4ED;
} else {
debugf0("ECC disabled\n");
mode = EDAC_NONE;
}

/* FIXME: need to handle the error codes */
debugf0("DOD Maximum limits: DIMMS: %d, %d-ranked, %d-banked\n",
Expand Down Expand Up @@ -411,13 +421,31 @@ static int get_dimm_config(struct mem_ctl_info *mci)
else
pvt->channel[i].dimms = 2;

debugf0("Ch%d (0x%08x): rd ch %d, wr ch %d, "
"%d ranks, %d %cDIMMs\n",
i, data,
RDLCH(pvt->info.ch_map, i),
WRLCH(pvt->info.ch_map, i),
debugf0("Ch%d phy rd%d, wr%d (0x%08x): "
"%d ranks, %d %cDIMMs, offset = %d\n",
i,
RDLCH(pvt->info.ch_map, i), WRLCH(pvt->info.ch_map, i),
data,
pvt->channel[i].ranks, pvt->channel[i].dimms,
(data & REGISTERED_DIMM)? 'R' : 'U' );
(data & REGISTERED_DIMM)? 'R' : 'U',
RANKOFFSET(data));

csr = &mci->csrows[csrow];
csr->first_page = 0;
csr->last_page = 0;
csr->page_mask = 0;
csr->nr_pages = 0;
csr->grain = 0;
csr->csrow_idx = csrow;
csr->dtype = DEV_X8; /* FIXME: check this */

if (data & REGISTERED_DIMM)
csr->mtype = MEM_RDDR3;
else
csr->mtype = MEM_DDR3;
csr->edac_mode = mode;

csrow++;
}

return 0;
Expand Down

0 comments on commit dada388

Please sign in to comment.