Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200018
b: refs/heads/master
c: 5566cb7
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed May 10, 2010
1 parent 5c6b50f commit 3ffc528
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 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: 854d3349973a7c47bd989794037f526b74af20c4
refs/heads/master: 5566cb7c91ba4ff4447278bb27896b4a2bb7d18a
28 changes: 19 additions & 9 deletions trunk/drivers/edac/i7core_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
#define MC_DOD_NUMBANK(x) (((x) & MC_DOD_NUMBANK_MASK) >> 7)
#define MC_DOD_NUMRANK_MASK ((1 << 6) | (1 << 5))
#define MC_DOD_NUMRANK(x) (((x) & MC_DOD_NUMRANK_MASK) >> 5)
#define MC_DOD_NUMROW_MASK ((1 << 4) | (1 << 3))
#define MC_DOD_NUMROW(x) (((x) & MC_DOD_NUMROW_MASK) >> 3)
#define MC_DOD_NUMROW_MASK ((1 << 4) | (1 << 3)| (1 << 2))
#define MC_DOD_NUMROW(x) (((x) & MC_DOD_NUMROW_MASK) >> 2)
#define MC_DOD_NUMCOL_MASK 3
#define MC_DOD_NUMCOL(x) ((x) & MC_DOD_NUMCOL_MASK)

Expand Down Expand Up @@ -361,6 +361,7 @@ static int get_dimm_config(struct mem_ctl_info *mci)
struct csrow_info *csr;
struct pci_dev *pdev;
int i, j, csrow = 0;
unsigned long last_page = 0;
enum edac_type mode;
enum mem_type mtype;

Expand All @@ -380,7 +381,7 @@ static int get_dimm_config(struct mem_ctl_info *mci)
pvt->info.max_dod, pvt->info.ch_map);

if (ECC_ENABLED(pvt)) {
debugf0("ECC enabled with x%d SDCC\n", ECCx8(pvt)?8:4);
debugf0("ECC enabled with x%d SDCC\n", ECCx8(pvt) ?8:4);
if (ECCx8(pvt))
mode = EDAC_S8ECD8ED;
else
Expand Down Expand Up @@ -450,6 +451,7 @@ static int get_dimm_config(struct mem_ctl_info *mci)

for (j = 0; j < 3; j++) {
u32 banks, ranks, rows, cols;
u32 size, npages;

if (!DIMM_PRESENT(dimm_dod[j]))
continue;
Expand All @@ -459,19 +461,27 @@ static int get_dimm_config(struct mem_ctl_info *mci)
rows = numrow(MC_DOD_NUMROW(dimm_dod[j]));
cols = numcol(MC_DOD_NUMCOL(dimm_dod[j]));

/* DDR3 has 8 I/O banks */
size = (rows * cols * banks * ranks) >> (20 - 3);

pvt->channel[i].dimms++;

debugf0("\tdimm %d offset: %x, numbank: %#x, "
"numrank: %#x, numrow: %#x, numcol: %#x\n",
j,
debugf0("\tdimm %d (0x%08x) %d Mb offset: %x, "
"numbank: %d,\n\t\t"
"numrank: %d, numrow: %#x, numcol: %#x\n",
j, dimm_dod[j], size,
RANKOFFSET(dimm_dod[j]),
banks, ranks, rows, cols);

npages = cols * rows; /* FIXME */

csr = &mci->csrows[csrow];
csr->first_page = 0;
csr->last_page = 0;
csr->first_page = last_page + 1;
last_page += npages;
csr->last_page = last_page;
csr->nr_pages = npages;

csr->page_mask = 0;
csr->nr_pages = 0;
csr->grain = 0;
csr->csrow_idx = csrow;

Expand Down

0 comments on commit 3ffc528

Please sign in to comment.