coreboot/src
Julius Werner 1a64495817 rk3288: sdram: Fix operator precedence error in LPDDR init
Upstream coreboot regularly runs Coverity over the code base. Turns out
that's a good idea since it's really easy to screw yourself over with a
missing parenthesis and some unfortunately deceptive line breaking.

This patch fixes a bug in LPDDR3 initialization due to an incorrect
operator precedence assumption ( ?: does not bind stronger than | ). In
effect, instead of setting MR11[1:0] to 0b11 or 0b00 based on ODT, we're
unconditionally setting MR0[1:0] to 0b11. Thankfully, MR0[1:0] seems to
contain read-only bits so this might have not been a problem when ODT is
off (which is currently true for all LPDDR boards).

Also adding a redundant LPDDR_OP() around the 0 to make the intent
clearer and changing 3 and 0 to 0x3 and 0x0 to make it more obvious that
these are bit masks (right?).

BRANCH=veyron
BUG=None
TEST=Running reboot loop on a Minnie, looks good so far...

Change-Id: I701ce059472078b5de09a45dd31f54b65a51e641
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/264135
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Jinkun Hong <jinkun.hong@rock-chips.com>
Tested-by: Jinkun Hong <jinkun.hong@rock-chips.com>
(cherry picked from commit 5bd9eba39fb7b0f940fead963bbc1878b031b2cb)
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/264308
2015-04-07 18:12:50 +00:00
..
arch rk3288: Handle framebuffer through memlayout, not the resource system 2015-01-24 02:13:31 +00:00
console Avoid 64bit math on MIPS platforms 2014-12-02 01:57:08 +00:00
cpu cbmem: Unify random on-CBMEM-init tasks under common CBMEM_INIT_HOOK() API 2014-12-04 04:01:59 +00:00
device Broadwell FSP: Add new finalize functions for devices and chips 2014-11-20 20:49:36 +00:00
drivers arm, arm64, mips: Add rough static stack size checks with -Wstack-usage 2015-01-21 01:16:47 +00:00
ec cros_ec: Retry failed VBNV transactions 2015-02-21 01:10:32 +00:00
include chromeos: vboot2: Add TPM PCR extension support 2015-02-02 22:21:25 +00:00
lib chromeos: vboot2: Add TPM PCR extension support 2015-02-02 22:21:25 +00:00
mainboard RW: veyron_(gus|jaq|jerry|mighty): Increase SPI frequency in RW 2015-03-30 22:40:26 +00:00
northbridge cbmem: Unify random on-CBMEM-init tasks under common CBMEM_INIT_HOOK() API 2014-12-04 04:01:59 +00:00
soc rk3288: sdram: Fix operator precedence error in LPDDR init 2015-04-07 18:12:50 +00:00
southbridge timestamp: remove conditional #if CONFIG_COLLECT_TIMESTAMPS 2014-11-07 01:24:01 +00:00
superio superio: ite8772f: Exit extemp busy state 2014-09-27 07:09:25 +00:00
vendorcode chromeos: vboot2: Add TPM PCR extension support 2015-02-02 22:21:25 +00:00
Kconfig Kconfig: Fix incorrect CONFIG_STACK_SIZE values for X86 and ARM64 2014-12-20 06:35:28 +00:00