From f892b85e18bfead6ed1f135e50ed4e9544553278 Mon Sep 17 00:00:00 2001 From: Rob Barnes Date: Mon, 7 Jun 2021 08:55:14 -0600 Subject: device/dram: Add LPDDR4 utilities Add lpddr4.c utility file with lpddr4_speed_mhz_to_reported_mts. Fill in lpddr4_speeds using JDEC 209-4C table 210. LPDDR4 SPD decoding utilities are not included since there isn't a present need. BUG=b:184124605 TEST=Build and run on guybrush Change-Id: Id8ddfc98fff4255670c50e1ddd4d0a1326265772 Signed-off-by: Rob Barnes Reviewed-on: https://review.coreboot.org/c/coreboot/+/52745 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- src/include/device/dram/lpddr4.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/include/device/dram/lpddr4.h (limited to 'src/include/device/dram') diff --git a/src/include/device/dram/lpddr4.h b/src/include/device/dram/lpddr4.h new file mode 100644 index 0000000000..59ddc337e4 --- /dev/null +++ b/src/include/device/dram/lpddr4.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef DEVICE_DRAM_LPDDR4_H +#define DEVICE_DRAM_LPDDR4_H + +/** + * @file lpddr4.h + * + * \brief Utilities for decoding LPDDR4 info + */ + +#include +#include + +/** + * Converts LPDDR4 clock speed in MHz to the standard reported speed in MT/s + */ +uint16_t lpddr4_speed_mhz_to_reported_mts(uint16_t speed_mhz); + +#endif /* DEVICE_DRAM_LPDDR4_H */ -- cgit v1.2.3