From bb9d106eab6212229fb1d6d4645f93bb883850ac Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Mon, 22 Aug 2022 17:27:11 -0500 Subject: device/dram: Add function to convert freq to MT/s for (LP)DDR5 As the frequency field in the SMBIOS type 17 table is deprecated, we need to provide the maximum and configured speed in MT/s. Add a method to convert from frequency to MT/s using a lookup table. BUG=b:239000826 TEST=Build and verify with other patches in train Change-Id: I0402b33a667f7d72918365a6a79b13c5b1719c0d Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/66953 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel Reviewed-by: Fred Reitberger Reviewed-by: Marshall Dawson --- src/include/device/dram/ddr5.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/include/device/dram/ddr5.h (limited to 'src/include') diff --git a/src/include/device/dram/ddr5.h b/src/include/device/dram/ddr5.h new file mode 100644 index 0000000000..a509126371 --- /dev/null +++ b/src/include/device/dram/ddr5.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef DEVICE_DRAM_DDR5_H +#define DEVICE_DRAM_DDR5_H + +/** + * @file ddr5.h + * + * \brief Utilities for decoding (LP)DDR5 info + */ + +#include +#include + +/** + * Converts DDR5 clock speed in MHz to the standard reported speed in MT/s + */ +uint16_t ddr5_speed_mhz_to_reported_mts(uint16_t speed_mhz); + +#endif /* DEVICE_DRAM_DDR5_H */ -- cgit v1.2.3