aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/intel/fsp2_0/mma_core.c
diff options
context:
space:
mode:
authorPratik Prajapati <pratikkumar.v.prajapati@intel.com>2016-11-18 14:36:34 -0800
committerMartin Roth <martinroth@google.com>2016-12-13 18:00:43 +0100
commitffc934d9440b5a8dabcedb4da0fa88d9a1e65e18 (patch)
tree2fd448d09b9a9c87ffbc6700f8ea25112f024e73 /src/drivers/intel/fsp2_0/mma_core.c
parentfa97cefbb3fad90573459e57845b658c9d3351a2 (diff)
intel MMA: Enable MMA with FSP2.0
- Separate mma code for fsp1.1 and fsp2.0 and restructuring the code - common code is placed in mma.c and mma.h - mma_fsp<ver>.h and fsp<ver>/mma_core.c contains fsp version specific code. - whole MMA feature is guarded by CONFIG_MMA flag. Change-Id: I12c9a1122ea7a52f050b852738fb95d03ce44800 Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati@intel.com> Reviewed-on: https://review.coreboot.org/17496 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/drivers/intel/fsp2_0/mma_core.c')
-rw-r--r--src/drivers/intel/fsp2_0/mma_core.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/drivers/intel/fsp2_0/mma_core.c b/src/drivers/intel/fsp2_0/mma_core.c
new file mode 100644
index 0000000000..2e48e07fbb
--- /dev/null
+++ b/src/drivers/intel/fsp2_0/mma_core.c
@@ -0,0 +1,46 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <console/console.h>
+#include <fsp/util.h>
+#include <fsp/soc_binding.h>
+
+static const uint8_t mma_results_uuid[16] = { 0x28, 0xe9, 0xf4, 0x08,
+ 0x5f, 0x0f, 0xd4, 0x46,
+ 0x84, 0x10, 0x47, 0x9f, 0xda, 0x27, 0x9d, 0xb6 };
+
+int fsp_locate_mma_results(const void **mma_hob, size_t *mma_hob_size)
+{
+ *mma_hob_size = 0;
+ *mma_hob = fsp_find_extension_hob_by_guid(mma_results_uuid,
+ mma_hob_size);
+
+ if (!(*mma_hob_size) || !(*mma_hob))
+ return -1;
+ return 0;
+}
+
+void setup_mma(FSP_M_CONFIG *memory_cfg)
+{
+ struct mma_config_param mma_cfg;
+
+ if (mma_locate_param(&mma_cfg)) {
+ printk(BIOS_DEBUG, "MMA: set up failed\n");
+ return;
+ }
+
+ soc_update_memory_params_for_mma(memory_cfg, &mma_cfg);
+ printk(BIOS_DEBUG, "MMA: set up completed successfully\n");
+}