summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSubrata Banik <subrata.banik@intel.com>2017-09-13 19:06:28 +0530
committerAaron Durbin <adurbin@chromium.org>2017-09-22 15:31:14 +0000
commitef059c5a092f898f9cecd3f2d94acc263b30b48e (patch)
tree194d1ea8c85241e0f52c8f54fc559a563e406d64 /src
parent82ef364f9a6eb1f6f175d52f12f7efc17185f9d7 (diff)
downloadcoreboot-ef059c5a092f898f9cecd3f2d94acc263b30b48e.tar.gz
coreboot-ef059c5a092f898f9cecd3f2d94acc263b30b48e.tar.bz2
coreboot-ef059c5a092f898f9cecd3f2d94acc263b30b48e.zip
soc/intel/common: Add intel common EBDA support
This patch provides EBDA library for soc usage. Change-Id: I8355a1dd528b111f1391e6d28a9b174edddc9ca0 Signed-off-by: Subrata Banik <subrata.banik@intel.com> Reviewed-on: https://review.coreboot.org/21538 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/soc/intel/common/block/ebda/Kconfig5
-rw-r--r--src/soc/intel/common/block/ebda/Makefile.inc3
-rw-r--r--src/soc/intel/common/block/ebda/ebda.c49
-rw-r--r--src/soc/intel/common/block/include/intelblocks/ebda.h63
4 files changed, 120 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/ebda/Kconfig b/src/soc/intel/common/block/ebda/Kconfig
new file mode 100644
index 000000000000..67c7b480338c
--- /dev/null
+++ b/src/soc/intel/common/block/ebda/Kconfig
@@ -0,0 +1,5 @@
+config SOC_INTEL_COMMON_BLOCK_EBDA
+ bool
+ select EARLY_EBDA_INIT
+ help
+ Intel Processor common EBDA library support
diff --git a/src/soc/intel/common/block/ebda/Makefile.inc b/src/soc/intel/common/block/ebda/Makefile.inc
new file mode 100644
index 000000000000..beeba5176a0b
--- /dev/null
+++ b/src/soc/intel/common/block/ebda/Makefile.inc
@@ -0,0 +1,3 @@
+romstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_EBDA) += ebda.c
+ramstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_EBDA) += ebda.c
+postcar-$(CONFIG_SOC_INTEL_COMMON_BLOCK_EBDA) += ebda.c
diff --git a/src/soc/intel/common/block/ebda/ebda.c b/src/soc/intel/common/block/ebda/ebda.c
new file mode 100644
index 000000000000..87c18d9bc546
--- /dev/null
+++ b/src/soc/intel/common/block/ebda/ebda.c
@@ -0,0 +1,49 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2017 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 <arch/ebda.h>
+#include <intelblocks/ebda.h>
+
+/*
+ * Mainboard Override function
+ *
+ * Mainboard directory may implement below functionality for romstage.
+ */
+
+/* Fill up EBDA structure inside Mainboard directory */
+__attribute__((weak)) void create_mainboard_ebda(struct ebda_config *cfg)
+{
+ /* no-op */
+}
+
+static void create_soc_ebda(struct ebda_config *cfg)
+{
+ /* Create EBDA header */
+ cfg->signature = EBDA_SIGNATURE;
+ /* Fill up memory layout information */
+ fill_soc_memmap_ebda(cfg);
+}
+
+void fill_ebda_area(void)
+{
+ struct ebda_config ebda_cfg;
+ struct ebda_config *cfg = &ebda_cfg;
+
+ /* Initialize EBDA area early during romstage. */
+ setup_default_ebda();
+ create_soc_ebda(cfg);
+ create_mainboard_ebda(cfg);
+ write_ebda_data(cfg, sizeof(*cfg));
+}
diff --git a/src/soc/intel/common/block/include/intelblocks/ebda.h b/src/soc/intel/common/block/include/intelblocks/ebda.h
new file mode 100644
index 000000000000..031cf1973d90
--- /dev/null
+++ b/src/soc/intel/common/block/include/intelblocks/ebda.h
@@ -0,0 +1,63 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2017 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.
+ */
+
+#ifndef SOC_INTEL_COMMON_BLOCK_EBDA_H
+#define SOC_INTEL_COMMON_BLOCK_EBDA_H
+
+#include <soc/ebda.h>
+
+#define EBDA_SIGNATURE 0xebda
+
+/*
+ * Mainboard Override function
+ *
+ * Mainboard directory may implement below functionality for romstage.
+ */
+
+/* Fill up EBDA structure inside Mainboard directory */
+void create_mainboard_ebda(struct ebda_config *cfg);
+
+/*
+ * SoC overrides
+ *
+ * All new SoC must implement below functionality for romstage.
+ */
+void fill_soc_memmap_ebda(struct ebda_config *cfg);
+
+/*
+ * API to perform below operation
+ * 1. Initialize EBDA area
+ * 2. Fill up EBDA structure inside SOC directory
+ * 3. Fill up EBDA structure inside Mainboard directory
+ * 4. Store EBDA structure into EBDA area
+ */
+void fill_ebda_area(void);
+
+/*
+ * EBDA structure
+ *
+ * SOC should implement EBDA structure as per need
+ * as below.
+ *
+ * Note: First 4 bytes should be reserved for signature as
+ * 0xEBDA
+ *
+ * struct ebda_config {
+ * uint32_t signature;
+ * <Required variables..>
+ * };
+ */
+
+#endif