summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2022-12-05 18:49:40 +0100
committerFelix Singer <felixsinger@posteo.net>2023-02-17 16:01:33 +0000
commit3a54f4a7f15dc14a0f70ba781b488d63f5b6238e (patch)
tree55322c7087fbdb487a1eedb63aaf7aefc2138971 /src
parente03d312a2cd4ea890c7640c6fa44d8890c6cf2be (diff)
nb/intel/pineview/raminit.c: Get rid of duplicated branches
Duplicated branches found using 'Wduplicated-branches' GCC flag. Change-Id: I252ea6aefb6d6c85135e640ba8deaa118be38f5e Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70374 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Felix Singer <felixsinger@posteo.net>
Diffstat (limited to 'src')
-rw-r--r--src/northbridge/intel/pineview/raminit.c48
1 files changed, 8 insertions, 40 deletions
diff --git a/src/northbridge/intel/pineview/raminit.c b/src/northbridge/intel/pineview/raminit.c
index 3699173ea0..dbc373d1fb 100644
--- a/src/northbridge/intel/pineview/raminit.c
+++ b/src/northbridge/intel/pineview/raminit.c
@@ -149,14 +149,8 @@ static void find_ramconfig(struct sysinfo *s, u32 chan)
// NC/NC
s->dimm_config[chan] = 0;
} else if (s->dimms[(chan>>1) + 1].sides == 1) {
- // NC/SS
- if (s->dimms[(chan>>1) + 1].width == 0) {
- // NC/8SS
- s->dimm_config[chan] = 1;
- } else {
- // NC/16SS
- s->dimm_config[chan] = 1;
- }
+ // NC/{8,16}SS
+ s->dimm_config[chan] = 1;
} else {
// NC/DS
if (s->dimms[(chan>>1) + 1].width == 0) {
@@ -170,14 +164,8 @@ static void find_ramconfig(struct sysinfo *s, u32 chan)
} else if (s->dimms[chan>>1].sides == 1) {
// SS
if (s->dimms[(chan>>1) + 1].sides == 0) {
- // SS/NC
- if (s->dimms[chan>>1].width == 0) {
- // 8SS/NC
- s->dimm_config[chan] = 1;
- } else {
- // 16SS/NC
- s->dimm_config[chan] = 1;
- }
+ // {8,16}SS/NC
+ s->dimm_config[chan] = 1;
} else if (s->dimms[(chan>>1) + 1].sides == 1) {
// SS/SS
if (s->dimms[chan>>1].width == 0) {
@@ -198,22 +186,8 @@ static void find_ramconfig(struct sysinfo *s, u32 chan)
}
}
} else {
- // SS/DS
- if (s->dimms[chan>>1].width == 0) {
- if (s->dimms[(chan>>1) + 1].width == 0) {
- // 8SS/8DS
- die("Mixed Not supported\n");
- } else {
- die("Mixed Not supported\n");
- }
- } else {
- if (s->dimms[(chan>>1) + 1].width == 0) {
- // 16SS/8DS
- die("Mixed Not supported\n");
- } else {
- die("Mixed Not supported\n");
- }
- }
+ // {8,16}SS/8DS
+ die("Mixed Not supported\n");
}
} else {
// DS
@@ -226,15 +200,9 @@ static void find_ramconfig(struct sysinfo *s, u32 chan)
s->dimm_config[chan] = 4;
}
} else if (s->dimms[(chan>>1) + 1].sides == 1) {
- // DS/SS
+ // 8DS/{8,16}SS
if (s->dimms[chan>>1].width == 0) {
- if (s->dimms[(chan>>1) + 1].width == 0) {
- // 8DS/8SS
- die("Mixed Not supported\n");
- } else {
- // 8DS/16SS
- die("Mixed Not supported\n");
- }
+ die("Mixed Not supported\n");
} else {
if (s->dimms[(chan>>1) + 1].width == 0) {
die("Mixed Not supported\n");