summaryrefslogtreecommitdiffstats
path: root/src/import/generic
diff options
context:
space:
mode:
authorMark Pizzutillo <Mark.Pizzutillo@ibm.com>2019-04-10 17:25:23 -0400
committerChristian R. Geddes <crgeddes@us.ibm.com>2019-05-29 15:21:13 -0500
commitee52194d04b1a2449e49cb759ea0e7e82bb1b75a (patch)
treea972edd0ab2bc746a6f92f6abd150af07988988d /src/import/generic
parent678ca9786f8a7425db0b7d43331d074220d96794 (diff)
downloadtalos-hostboot-ee52194d04b1a2449e49cb759ea0e7e82bb1b75a.tar.gz
talos-hostboot-ee52194d04b1a2449e49cb759ea0e7e82bb1b75a.zip
Add code for PMIC bias procedure & UTs
Change-Id: I351c74f73624f46b195d37efbf407e1ff95006bf Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/77317 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/77775 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/generic')
-rw-r--r--src/import/generic/memory/lib/utils/mss_math.H11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/import/generic/memory/lib/utils/mss_math.H b/src/import/generic/memory/lib/utils/mss_math.H
index 65fc0f898..b3ff26fde 100644
--- a/src/import/generic/memory/lib/utils/mss_math.H
+++ b/src/import/generic/memory/lib/utils/mss_math.H
@@ -107,6 +107,17 @@ fapi_try_exit:
return fapi2::current_err;
}
+///
+/// @brief Round value to a multiple of another number
+///
+/// @param[in] i_value value to round
+/// @param[in] i_multiple multiple to round to
+/// @return uint64_t rounded value
+///
+inline uint32_t round_to_nearest_multiple(const uint32_t i_value, const uint32_t i_multiple)
+{
+ return ((i_value + i_multiple / 2) / i_multiple) * i_multiple;
+}
///
/// @brief Determines if the double has decimal digits and adds 1 and rounds if true
OpenPOWER on IntegriCloud