<p>Subrata Banik has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21538">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/intel/common: Add intel common EBDA support<br><br>This patch provides EBDA library for soc usage.<br><br>Change-Id: I8355a1dd528b111f1391e6d28a9b174edddc9ca0<br>Signed-off-by: Subrata Banik <subrata.banik@intel.com><br>---<br>A src/soc/intel/common/block/ebda/Kconfig<br>A src/soc/intel/common/block/ebda/Makefile.inc<br>A src/soc/intel/common/block/ebda/ebda.c<br>A src/soc/intel/common/block/include/intelblocks/ebda.h<br>4 files changed, 147 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/21538/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/soc/intel/common/block/ebda/Kconfig b/src/soc/intel/common/block/ebda/Kconfig<br>new file mode 100644<br>index 0000000..67c7b48<br>--- /dev/null<br>+++ b/src/soc/intel/common/block/ebda/Kconfig<br>@@ -0,0 +1,5 @@<br>+config SOC_INTEL_COMMON_BLOCK_EBDA<br>+ bool<br>+ select EARLY_EBDA_INIT<br>+       help<br>+   Intel Processor common EBDA library support<br>diff --git a/src/soc/intel/common/block/ebda/Makefile.inc b/src/soc/intel/common/block/ebda/Makefile.inc<br>new file mode 100644<br>index 0000000..beeba51<br>--- /dev/null<br>+++ b/src/soc/intel/common/block/ebda/Makefile.inc<br>@@ -0,0 +1,3 @@<br>+romstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_EBDA) += ebda.c<br>+ramstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_EBDA) += ebda.c<br>+postcar-$(CONFIG_SOC_INTEL_COMMON_BLOCK_EBDA) += ebda.c<br>diff --git a/src/soc/intel/common/block/ebda/ebda.c b/src/soc/intel/common/block/ebda/ebda.c<br>new file mode 100644<br>index 0000000..f8058b8<br>--- /dev/null<br>+++ b/src/soc/intel/common/block/ebda/ebda.c<br>@@ -0,0 +1,70 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ * Copyright (C) 2017 Intel Corporation.<br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; version 2 of the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#include <intelblocks/ebda.h><br>+<br>+/*<br>+ * Mainboard Override function<br>+ *<br>+ * Mainboard directory may implement below functionality for romstage.<br>+ */<br>+<br>+/* Fill up EBDA structure inside Mainboard directory */<br>+__attribute__((weak)) void create_mainboard_ebda(ebda_config *cfg)<br>+{<br>+      /* no-op */<br>+}<br>+<br>+/*<br>+ * SoC overrides<br>+ *<br>+ * All new SoC must implement below functionality for romstage.<br>+ */<br>+__attribute__((weak)) void fill_soc_memmap_ebda(ebda_config *cfg)<br>+{<br>+      /* no-op */<br>+}<br>+<br>+bool is_ebda_initialized(ebda_config *cfg)<br>+{<br>+  cfg = (ebda_config *)read_ebda_data(sizeof(ebda_config));<br>+<br>+ if (cfg->signature == EBDA_SIGNATURE)<br>+             return true;<br>+<br>+      return false;<br>+}<br>+<br>+static void create_soc_ebda(ebda_config *cfg)<br>+{<br>+     /* Create EBDA header */<br>+     cfg->signature = EBDA_SIGNATURE;<br>+  /* Fill up memory layout information */<br>+      fill_soc_memmap_ebda(cfg);<br>+}<br>+<br>+void fill_ebda_area(void)<br>+{<br>+    ebda_config *cfg = NULL;<br>+<br>+  /* If EBDA area is already initialized then return */<br>+        if (is_ebda_initialized(cfg))<br>+                return;<br>+<br>+   /* Initialize EBDA area early during romstage. */<br>+    setup_default_ebda();<br>+        create_soc_ebda(cfg);<br>+        create_mainboard_ebda(cfg);<br>+  write_ebda_data(cfg, sizeof(ebda_config));<br>+}<br>diff --git a/src/soc/intel/common/block/include/intelblocks/ebda.h b/src/soc/intel/common/block/include/intelblocks/ebda.h<br>new file mode 100644<br>index 0000000..ccb968a<br>--- /dev/null<br>+++ b/src/soc/intel/common/block/include/intelblocks/ebda.h<br>@@ -0,0 +1,69 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2017 Intel Corporation.<br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; version 2 of the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#ifndef SOC_INTEL_COMMON_BLOCK_EBDA_H<br>+#define SOC_INTEL_COMMON_BLOCK_EBDA_H<br>+<br>+#include <arch/ebda.h><br>+#include <compiler.h><br>+#include <soc/ebda.h><br>+<br>+#define EBDA_SIGNATURE 0xebda<br>+<br>+/* API to check if EBDA area already initialized */<br>+bool is_ebda_initialized(ebda_config *cfg);<br>+<br>+/*<br>+ * Mainboard Override function<br>+ *<br>+ * Mainboard directory may implement below functionality for romstage.<br>+ */<br>+<br>+/* Fill up EBDA structure inside Mainboard directory */<br>+void create_mainboard_ebda(ebda_config *cfg);<br>+<br>+/*<br>+ * SoC overrides<br>+ *<br>+ * All new SoC must implement below functionality for romstage.<br>+ */<br>+void fill_soc_memmap_ebda(ebda_config *cfg);<br>+<br>+/*<br>+ * API to perform below operation<br>+ * 1. Initialize EBDA area<br>+ * 2. Fill up EBDA structure inside SOC directory<br>+ * 3. Fill up EBDA structure inside Mainboard directory<br>+ * 4. Store EBDA structure into EBDA area<br>+ */<br>+void fill_ebda_area(void);<br>+<br>+/*<br>+ * EBDA structure<br>+ *<br>+ * SOC should implement EBDA structure as per need<br>+ * as below.<br>+ *<br>+ * Note: First 4 bytes should be reserved for signature as<br>+ * 0xEBDA<br>+ *<br>+ * typedef struct {<br>+ * uint32_t signature;<br>+ *        <Required variables..><br>+ * }__packed ebda_config;<br>+ *<br>+  */<br>+<br>+#endif<br></pre><p>To view, visit <a href="https://review.coreboot.org/21538">change 21538</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/21538"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I8355a1dd528b111f1391e6d28a9b174edddc9ca0 </div>
<div style="display:none"> Gerrit-Change-Number: 21538 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Subrata Banik <subrata.banik@intel.com> </div>