Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83818
b: refs/heads/master
c: 4d2b165
h: refs/heads/master
v: v3
  • Loading branch information
Jason Uhlenkott authored and Linus Torvalds committed Feb 7, 2008
1 parent 139ad27 commit 265d4bf
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 16 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: ce783d70b95416725e262866f5b11436f35f68a9
refs/heads/master: 4d2b165eca960ae12767a6334c51416dca45756c
50 changes: 35 additions & 15 deletions trunk/drivers/edac/i3000_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,23 @@
* 0 Error channel 0/1
*/
#define I3000_DEAP_GRAIN (1 << 7)
#define I3000_DEAP_PFN(edeap, deap) ((((edeap) & 1) << (32 - PAGE_SHIFT)) \
| ((deap) >> PAGE_SHIFT))
#define I3000_DEAP_OFFSET(deap) ((deap) & ~(I3000_DEAP_GRAIN-1) & \
~PAGE_MASK)
#define I3000_DEAP_CHANNEL(deap) ((deap) & 1)

static inline unsigned long deap_pfn(u8 edeap, u32 deap)
{
deap >>= PAGE_SHIFT;
deap |= (edeap & 1) << (32 - PAGE_SHIFT);
return deap;
}

static inline unsigned long deap_offset(u32 deap)
{
return deap & ~(I3000_DEAP_GRAIN - 1) & ~PAGE_MASK;
}

static inline int deap_channel(u32 deap)
{
return deap & 1;
}

#define I3000_DERRSYN 0x5c /* DRAM Error Syndrome (8b)
*
Expand Down Expand Up @@ -116,8 +128,16 @@
* Others: reserved
*/
#define I3000_C1DRA 0x188 /* Channel 1 DRAM Rank Attribute (8b x 2) */
#define ODD_RANK_ATTRIB(dra) (((dra) & 0x70) >> 4)
#define EVEN_RANK_ATTRIB(dra) ((dra) & 0x07)

static inline unsigned char odd_rank_attrib(unsigned char dra)
{
return (dra & 0x70) >> 4;
}

static inline unsigned char even_rank_attrib(unsigned char dra)
{
return dra & 0x07;
}

#define I3000_C0DRC0 0x120 /* DRAM Controller Mode 0 (32b)
*
Expand Down Expand Up @@ -206,8 +226,8 @@ static int i3000_process_error_info(struct mem_ctl_info *mci,
struct i3000_error_info *info,
int handle_errors)
{
int row, multi_chan;
int pfn, offset, channel;
int row, multi_chan, channel;
unsigned long pfn, offset;

multi_chan = mci->csrows[0].nr_channels - 1;

Expand All @@ -222,9 +242,9 @@ static int i3000_process_error_info(struct mem_ctl_info *mci,
info->errsts = info->errsts2;
}

pfn = I3000_DEAP_PFN(info->edeap, info->deap);
offset = I3000_DEAP_OFFSET(info->deap);
channel = I3000_DEAP_CHANNEL(info->deap);
pfn = deap_pfn(info->edeap, info->deap);
offset = deap_offset(info->deap);
channel = deap_channel(info->deap);

row = edac_mc_find_csrow_by_page(mci, pfn);

Expand Down Expand Up @@ -258,9 +278,9 @@ static int i3000_is_interleaved(const unsigned char *c0dra,
* we're not interleaved.
*/
for (i = 0; i < I3000_RANKS_PER_CHANNEL / 2; i++)
if (ODD_RANK_ATTRIB(c0dra[i]) != ODD_RANK_ATTRIB(c1dra[i]) ||
EVEN_RANK_ATTRIB(c0dra[i]) !=
EVEN_RANK_ATTRIB(c1dra[i]))
if (odd_rank_attrib(c0dra[i]) != odd_rank_attrib(c1dra[i]) ||
even_rank_attrib(c0dra[i]) !=
even_rank_attrib(c1dra[i]))
return 0;

/*
Expand Down

0 comments on commit 265d4bf

Please sign in to comment.