Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/21538
Change subject: soc/intel/common: Add intel common EBDA support
......................................................................
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(a)intel.com>
---
A src/soc/intel/common/block/ebda/Kconfig
A src/soc/intel/common/block/ebda/Makefile.inc
A src/soc/intel/common/block/ebda/ebda.c
A src/soc/intel/common/block/include/intelblocks/ebda.h
4 files changed, 147 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/21538/1
diff --git a/src/soc/intel/common/block/ebda/Kconfig b/src/soc/intel/common/block/ebda/Kconfig
new file mode 100644
index 0000000..67c7b48
--- /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 0000000..beeba51
--- /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 0000000..f8058b8
--- /dev/null
+++ b/src/soc/intel/common/block/ebda/ebda.c
@@ -0,0 +1,70 @@
+/*
+ * 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 <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(ebda_config *cfg)
+{
+ /* no-op */
+}
+
+/*
+ * SoC overrides
+ *
+ * All new SoC must implement below functionality for romstage.
+ */
+__attribute__((weak)) void fill_soc_memmap_ebda(ebda_config *cfg)
+{
+ /* no-op */
+}
+
+bool is_ebda_initialized(ebda_config *cfg)
+{
+ cfg = (ebda_config *)read_ebda_data(sizeof(ebda_config));
+
+ if (cfg->signature == EBDA_SIGNATURE)
+ return true;
+
+ return false;
+}
+
+static void create_soc_ebda(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)
+{
+ ebda_config *cfg = NULL;
+
+ /* If EBDA area is already initialized then return */
+ if (is_ebda_initialized(cfg))
+ return;
+
+ /* Initialize EBDA area early during romstage. */
+ setup_default_ebda();
+ create_soc_ebda(cfg);
+ create_mainboard_ebda(cfg);
+ write_ebda_data(cfg, sizeof(ebda_config));
+}
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 0000000..ccb968a
--- /dev/null
+++ b/src/soc/intel/common/block/include/intelblocks/ebda.h
@@ -0,0 +1,69 @@
+/*
+ * 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 <arch/ebda.h>
+#include <compiler.h>
+#include <soc/ebda.h>
+
+#define EBDA_SIGNATURE 0xebda
+
+/* API to check if EBDA area already initialized */
+bool is_ebda_initialized(ebda_config *cfg);
+
+/*
+ * Mainboard Override function
+ *
+ * Mainboard directory may implement below functionality for romstage.
+ */
+
+/* Fill up EBDA structure inside Mainboard directory */
+void create_mainboard_ebda(ebda_config *cfg);
+
+/*
+ * SoC overrides
+ *
+ * All new SoC must implement below functionality for romstage.
+ */
+void fill_soc_memmap_ebda(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
+ *
+ * typedef struct {
+ * uint32_t signature;
+ * <Required variables..>
+ * }__packed ebda_config;
+ *
+ */
+
+#endif
--
To view, visit https://review.coreboot.org/21538
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8355a1dd528b111f1391e6d28a9b174edddc9ca0
Gerrit-Change-Number: 21538
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/21536
Change subject: arch/x86: Add ebda read/write functions into EBDA library
......................................................................
arch/x86: Add ebda read/write functions into EBDA library
This patch provides new APIs to write into EBDA area
and read from EBDA area based on user input structure.
Change-Id: I26d5c0ba82c842f0b734a8e0f03abf148737c5c4
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
---
M src/arch/x86/ebda.c
M src/arch/x86/include/arch/ebda.h
2 files changed, 67 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/21536/1
diff --git a/src/arch/x86/ebda.c b/src/arch/x86/ebda.c
index c828aa4..61db30e 100644
--- a/src/arch/x86/ebda.c
+++ b/src/arch/x86/ebda.c
@@ -20,6 +20,58 @@
#include <arch/ebda.h>
#include <arch/acpi.h>
#include <commonlib/endian.h>
+#include <console/console.h>
+
+static void *get_ebda_start(void)
+{
+ return (void *)((uintptr_t)DEFAULT_EBDA_SEGMENT << 4);
+}
+
+/*
+ * EBDA area is representing a 1KB memory area just below
+ * the top of conventional memory (below 1MB)
+ */
+
+/*
+ * write_ebda_data is a wrapper function to write into EBDA area
+ * in DWORD mode.
+ *
+ * data = data to be written into EBDA area
+ * length = input data size in bytes
+ */
+void write_ebda_data(void *data, size_t length)
+{
+ void *ebda;
+ int count = 0;
+
+ if (length > DEFAULT_EBDA_SIZE)
+ die("Input data width is more than EBDA size!");
+
+ ebda = get_ebda_start();
+
+ while (count < length) {
+ write_le32(ebda, *((uint32_t *)(data + count)));
+ count += sizeof(uint32_t);
+ ebda += sizeof(uint32_t);
+ }
+}
+
+/*
+ * read_ebda_data is a wrapper function to read from EBDA area
+ *
+ * return data read from EBDA area
+ */
+void *read_ebda_data(size_t length)
+{
+ void *ebda;
+ static void *data;
+
+ ebda = get_ebda_start();
+
+ memcpy(data, ebda, length);
+
+ return data;
+}
void setup_ebda(u32 low_memory_size, u16 ebda_segment, u16 ebda_size)
{
@@ -36,7 +88,7 @@
low_memory_kb = low_memory_size >> 10;
ebda_kb = ebda_size >> 10;
- ebda = (void *)((uintptr_t)ebda_segment << 4);
+ ebda = get_ebda_start();
/* clear BIOS DATA AREA */
zero_n(X86_BDA_BASE, X86_BDA_SIZE);
diff --git a/src/arch/x86/include/arch/ebda.h b/src/arch/x86/include/arch/ebda.h
index 428bc92..7e2e4fa 100644
--- a/src/arch/x86/include/arch/ebda.h
+++ b/src/arch/x86/include/arch/ebda.h
@@ -31,5 +31,19 @@
void setup_ebda(u32 low_memory_size, u16 ebda_segment, u16 ebda_size);
void setup_default_ebda(void);
+/*
+ * write_ebda_data is a wrapper function to write into EBDA area
+ * in DWORD mode.
+ *
+ * data = data to be written into EBDA area
+ * length = input data size in bytes
+ */
+void write_ebda_data(void *data, size_t length);
+/*
+ * read_ebda_data is a wrapper function to read from EBDA area
+ *
+ * return data read from EBDA area
+ */
+void *read_ebda_data(size_t length);
#endif
--
To view, visit https://review.coreboot.org/21536
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I26d5c0ba82c842f0b734a8e0f03abf148737c5c4
Gerrit-Change-Number: 21536
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
V Sowmya has uploaded this change for review. ( https://review.coreboot.org/21535
Change subject: mb/google/poppy: Modify the HID for VCM device
......................................................................
mb/google/poppy: Modify the HID for VCM device
Modify the HID to align with ACPI specification.
BUG=b:65423422
BRANCH=none
CQ-DEPEND=CL:654383
TEST=Build and boot soraka. Verified that the VCM device
probe is successful.
Change-Id: I9802e54838b74ba3c580fb68ad6843db974b348c
Signed-off-by: V Sowmya <v.sowmya(a)intel.com>
---
M src/mainboard/google/poppy/acpi/mipi_camera.asl
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/21535/1
diff --git a/src/mainboard/google/poppy/acpi/mipi_camera.asl b/src/mainboard/google/poppy/acpi/mipi_camera.asl
index 135b4e6..f6a9ea3 100644
--- a/src/mainboard/google/poppy/acpi/mipi_camera.asl
+++ b/src/mainboard/google/poppy/acpi/mipi_camera.asl
@@ -703,7 +703,7 @@
Device (VCM0)
{
- Name (_HID, "DWDWD000") /* _HID: Hardware ID */
+ Name (_HID, "PRP0001") /* _HID: Hardware ID */
Name (_UID, Zero) /* _UID: Unique ID */
Name (_DDN, "Dongwoon AF DAC") /* _DDN: DOS Device Name */
Name (CAMD, 0x03)
--
To view, visit https://review.coreboot.org/21535
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9802e54838b74ba3c580fb68ad6843db974b348c
Gerrit-Change-Number: 21535
Gerrit-PatchSet: 1
Gerrit-Owner: V Sowmya <v.sowmya(a)intel.com>