aboutsummaryrefslogtreecommitdiff
path: root/src/include/device
diff options
context:
space:
mode:
authorRob Barnes <robbarnes@google.com>2021-06-07 08:55:14 -0600
committerFelix Held <felix-coreboot@felixheld.de>2021-06-09 15:10:34 +0000
commitf892b85e18bfead6ed1f135e50ed4e9544553278 (patch)
tree4da60b66b8b32b2f226744ba675cedb0e816b742 /src/include/device
parenteca3e6278abd37da60cd68bb3705ce1cc01d4f47 (diff)
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 <robbarnes@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/52745 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/include/device')
-rw-r--r--src/include/device/dram/lpddr4.h20
1 files changed, 20 insertions, 0 deletions
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 <device/dram/common.h>
+#include <types.h>
+
+/**
+ * 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 */