From ef059c5a092f898f9cecd3f2d94acc263b30b48e Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Wed, 13 Sep 2017 19:06:28 +0530 Subject: soc/intel/common: Add intel common EBDA support This patch provides EBDA library for soc usage. Change-Id: I8355a1dd528b111f1391e6d28a9b174edddc9ca0 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/21538 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/soc/intel/common/block/ebda/ebda.c | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/soc/intel/common/block/ebda/ebda.c (limited to 'src/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 0000000000..87c18d9bc5 --- /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 +#include + +/* + * 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)); +} -- cgit v1.2.3