Commit 1aa4a7b6 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB: i7300_edac: better initialize page counts

It is still somewhat fake, as the pages may not be on this exact order,
and may even be used in mirror mode, but this is a best guess than the
other random fake values.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 3c9c92b6
...@@ -616,7 +616,8 @@ static void i7300_enable_error_reporting(struct mem_ctl_info *mci) ...@@ -616,7 +616,8 @@ static void i7300_enable_error_reporting(struct mem_ctl_info *mci)
static int decode_mtr(struct i7300_pvt *pvt, static int decode_mtr(struct i7300_pvt *pvt,
int slot, int ch, int branch, int slot, int ch, int branch,
struct i7300_dimm_info *dinfo, struct i7300_dimm_info *dinfo,
struct csrow_info *p_csrow) struct csrow_info *p_csrow,
u32 *last_page)
{ {
int mtr, ans, addrBits, channel; int mtr, ans, addrBits, channel;
...@@ -663,6 +664,11 @@ static int decode_mtr(struct i7300_pvt *pvt, ...@@ -663,6 +664,11 @@ static int decode_mtr(struct i7300_pvt *pvt,
p_csrow->grain = 8; p_csrow->grain = 8;
p_csrow->nr_pages = dinfo->megabytes << 8; p_csrow->nr_pages = dinfo->megabytes << 8;
p_csrow->mtype = MEM_FB_DDR2; p_csrow->mtype = MEM_FB_DDR2;
p_csrow->csrow_idx = slot;
p_csrow->first_page = *last_page;
*last_page += p_csrow->nr_pages;
p_csrow->last_page = *last_page;
p_csrow->page_mask = 0;
/* /*
* The type of error detection actually depends of the * The type of error detection actually depends of the
...@@ -774,6 +780,7 @@ static int i7300_init_csrows(struct mem_ctl_info *mci) ...@@ -774,6 +780,7 @@ static int i7300_init_csrows(struct mem_ctl_info *mci)
int rc = -ENODEV; int rc = -ENODEV;
int mtr; int mtr;
int ch, branch, slot, channel; int ch, branch, slot, channel;
u32 last_page = 0;
pvt = mci->pvt_info; pvt = mci->pvt_info;
...@@ -811,18 +818,11 @@ static int i7300_init_csrows(struct mem_ctl_info *mci) ...@@ -811,18 +818,11 @@ static int i7300_init_csrows(struct mem_ctl_info *mci)
p_csrow = &mci->csrows[slot]; p_csrow = &mci->csrows[slot];
mtr = decode_mtr(pvt, slot, ch, branch, mtr = decode_mtr(pvt, slot, ch, branch,
dinfo, p_csrow); dinfo, p_csrow, &last_page);
/* if no DIMMS on this row, continue */ /* if no DIMMS on this row, continue */
if (!MTR_DIMMS_PRESENT(mtr)) if (!MTR_DIMMS_PRESENT(mtr))
continue; continue;
p_csrow->csrow_idx = slot;
/* FAKE OUT VALUES, FIXME */
p_csrow->first_page = 0 + slot * 20;
p_csrow->last_page = 9 + slot * 20;
p_csrow->page_mask = 0xfff;
rc = 0; rc = 0;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment