device/dram: Add method for converting MHz to MT/s

Add method for converting DDR4 speed in MHz to MT/s. Checks that MHz is
within a speed grade range.

BUG=b:167155849
TEST=ddr4-test unit test
BRANCH=Zork

Change-Id: I1433f028afb794fe3e397b03f5bd0565494c8130
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/45343
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Rob Barnes
2020-09-14 07:46:19 -06:00
committed by Aaron Durbin
parent fcd7d0518c
commit a01ee36288
5 changed files with 131 additions and 0 deletions

View File

@@ -1,7 +1,12 @@
# SPDX-License-Identifier: GPL-2.0-only
tests-y += i2c-test
tests-y += ddr4-test
i2c-test-srcs += tests/device/i2c-test.c
i2c-test-srcs += src/device/i2c.c
i2c-test-mocks += platform_i2c_transfer
ddr4-test-srcs += tests/device/ddr4-test.c
ddr4-test-srcs += tests/stubs/console.c
ddr4-test-srcs += src/device/dram/ddr4.c