summaryrefslogtreecommitdiff
path: root/src/northbridge/intel/ironlake
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2022-02-14 14:12:52 +0100
committerFelix Held <felix-coreboot@felixheld.de>2022-02-24 01:20:41 +0000
commit4cee77bce3d7a7426ccc24b2d7d92f4d87955f38 (patch)
tree872fd72efc0488040c62e3c561a7b4a730224c08 /src/northbridge/intel/ironlake
parentfa5ed059eb6fef1aa1681fbc7b38052b2028c1ac (diff)
nb/intel/ironlake: Clean up `jedec_read()` function
Deduplicate a condition and reflow some lines. Tested on HP ProBook 6550b, still reaches TianoCore payload. Change-Id: If5786f34585e15100385d452b5b03a36da4c7c87 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/61939 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Diffstat (limited to 'src/northbridge/intel/ironlake')
-rw-r--r--src/northbridge/intel/ironlake/raminit.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/northbridge/intel/ironlake/raminit.c b/src/northbridge/intel/ironlake/raminit.c
index fe67f0d0a3..1f550835b0 100644
--- a/src/northbridge/intel/ironlake/raminit.c
+++ b/src/northbridge/intel/ironlake/raminit.c
@@ -915,19 +915,14 @@ static void jedec_read(struct raminfo *info,
int total_rank, u8 addr3, unsigned int value)
{
/* Handle mirrored mapping. */
- if ((rank & 1) && (info->spd[channel][slot][RANK1_ADDRESS_MAPPING] & 1))
- addr3 = (addr3 & 0xCF) | ((addr3 & 0x10) << 1) |
- ((addr3 >> 1) & 0x10);
+ if ((rank & 1) && (info->spd[channel][slot][RANK1_ADDRESS_MAPPING] & 1)) {
+ addr3 = (addr3 & 0xCF) | ((addr3 & 0x10) << 1) | ((addr3 >> 1) & 0x10);
+ value = (value & ~0x1f8) | ((value >> 1) & 0xa8) | ((value & 0xa8) << 1);
+ }
mchbar_clrsetbits8(0x271, 0x1f << 1, addr3);
mchbar_clrsetbits8(0x671, 0x1f << 1, addr3);
- /* Handle mirrored mapping. */
- if ((rank & 1) && (info->spd[channel][slot][RANK1_ADDRESS_MAPPING] & 1))
- value =
- (value & ~0x1f8) | ((value >> 1) & 0xa8) | ((value & 0xa8)
- << 1);
-
read32p((value << 3) | (total_rank << 28));
mchbar_clrsetbits8(0x271, 0x1f << 1, 1 << 1);