Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17648
-gerrit
commit 69f0909c159e74bbe7046bdb1b699e7342bc63fb
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Tue Nov 29 21:37:42 2016 -0600
lib: put romstage_handoff implementation in own compilation unit
Instead of putting all the functions inline just put the
current implementation into a C file. That way all the implementation
innards are not exposed.
Change-Id: I01fd25d158c0d5016405b73a4d4df3721c281b04
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/include/romstage_handoff.h | 89 +--------------------------------------
src/lib/Makefile.inc | 3 ++
src/lib/romstage_handoff.c | 95 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 100 insertions(+), 87 deletions(-)
diff --git a/src/include/romstage_handoff.h b/src/include/romstage_handoff.h
index b36ff9f..1a6bbf7 100644
--- a/src/include/romstage_handoff.h
+++ b/src/include/romstage_handoff.h
@@ -15,95 +15,10 @@
#ifndef ROMSTAGE_HANDOFF_H
#define ROMSTAGE_HANDOFF_H
-#include <stdint.h>
-#include <string.h>
-#include <cbmem.h>
-#include <console/console.h>
-#include <rules.h>
-
-/* It is the chipset's responsibility for maintaining the integrity of this
- * structure in CBMEM. For instance, if chipset code adds this structure
- * using the CBMEM_ID_ROMSTAGE_INFO id it needs to ensure it doesn't clobber
- * fields it doesn't own. */
-struct romstage_handoff {
- /* Indicate if the current boot is an S3 resume. If
- * CONFIG_RELOCTABLE_RAMSTAGE is enabled the chipset code is
- * responsible for initializing this variable. Otherwise, ramstage
- * will be re-loaded from cbfs (which can be slower since it lives
- * in flash). */
- uint8_t s3_resume;
- uint8_t reboot_required;
- uint8_t reserved[2];
-};
-
-static inline int cbmem_available(void)
-{
- /* No cbmem available prior to ramstage on non-early cbmem platforms. */
- if (!ENV_RAMSTAGE && !IS_ENABLED(CONFIG_EARLY_CBMEM_INIT))
- return 0;
-
- return 1;
-}
-
-/* The romstage_handoff_find_or_add() function provides the necessary logic
- * for initializing the romstage_handoff structure in cbmem. Different components
- * of the romstage may be responsible for setting up different fields. Therefore
- * that same logic flow should be used for allocating and initializing the
- * structure. A newly allocated structure will be memset to 0. */
-static inline struct romstage_handoff *romstage_handoff_find_or_add(void)
-{
- struct romstage_handoff *handoff;
-
- if (!cbmem_available())
- return NULL;
-
- /* cbmem_add() first does a find and uses the old location before the
- * real add. However, it is important to know when the structure is not
- * found so it can be initialized to 0. */
- handoff = cbmem_find(CBMEM_ID_ROMSTAGE_INFO);
-
- if (handoff)
- return handoff;
-
- handoff = cbmem_add(CBMEM_ID_ROMSTAGE_INFO, sizeof(*handoff));
-
- if (handoff != NULL)
- memset(handoff, 0, sizeof(*handoff));
- else
- printk(BIOS_DEBUG, "Romstage handoff structure not added!\n");
-
- return handoff;
-}
-
/* Returns 0 if initialized. Else < 0 if handoff structure not added. */
-static inline int romstage_handoff_init(int is_s3_resume)
-{
- struct romstage_handoff *handoff;
-
- handoff = romstage_handoff_find_or_add();
-
- if (handoff == NULL)
- return -1;
-
- handoff->s3_resume = is_s3_resume;
-
- return 0;
-}
+int romstage_handoff_init(int is_s3_resume);
/* Return 1 if resuming or 0 if not. */
-static inline int romstage_handoff_is_resume(void)
-{
- struct romstage_handoff *handoff;
-
- if (!cbmem_available())
- return 0;
-
- handoff = cbmem_find(CBMEM_ID_ROMSTAGE_INFO);
-
- if (handoff == NULL)
- return 0;
-
- return handoff->s3_resume;
-}
+int romstage_handoff_is_resume(void);
#endif /* ROMSTAGE_HANDOFF_H */
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index ddade2b..4157091 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -87,6 +87,8 @@ romstage-$(CONFIG_PRIMITIVE_MEMTEST) += primitive_memtest.c
ramstage-$(CONFIG_PRIMITIVE_MEMTEST) += primitive_memtest.c
romstage-$(CONFIG_CACHE_AS_RAM) += ramtest.c
romstage-$(CONFIG_GENERIC_GPIO_LIB) += gpio.c
+ramstage-y += romstage_handoff.c
+romstage-y += romstage_handoff.c
romstage-y += romstage_stack.c
ramstage-y += romstage_stack.c
romstage-y += stack.c
@@ -153,6 +155,7 @@ postcar-y += cbmem_common.c
postcar-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c
postcar-y += imd_cbmem.c
postcar-y += imd.c
+postcar-y += romstage_handoff.c
bootblock-y += hexdump.c
ramstage-y += hexdump.c
diff --git a/src/lib/romstage_handoff.c b/src/lib/romstage_handoff.c
new file mode 100644
index 0000000..ccabd8a
--- /dev/null
+++ b/src/lib/romstage_handoff.c
@@ -0,0 +1,95 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2016 Google Inc.
+ *
+ * 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 <stdint.h>
+#include <string.h>
+#include <cbmem.h>
+#include <console/console.h>
+#include <romstage_handoff.h>
+#include <rules.h>
+
+struct romstage_handoff {
+ /* Indicate if the current boot is an S3 resume. If
+ * CONFIG_RELOCTABLE_RAMSTAGE is enabled the chipset code is
+ * responsible for initializing this variable. Otherwise, ramstage
+ * will be re-loaded from cbfs (which can be slower since it lives
+ * in flash). */
+ uint8_t s3_resume;
+ uint8_t reboot_required;
+ uint8_t reserved[2];
+};
+
+static inline int cbmem_available(void)
+{
+ /* No cbmem available prior to ramstage on non-early cbmem platforms. */
+ if (!ENV_RAMSTAGE && !IS_ENABLED(CONFIG_EARLY_CBMEM_INIT))
+ return 0;
+
+ return 1;
+}
+
+static struct romstage_handoff *romstage_handoff_find_or_add(void)
+{
+ struct romstage_handoff *handoff;
+
+ if (!cbmem_available())
+ return NULL;
+
+ /* cbmem_add() first does a find and uses the old location before the
+ * real add. However, it is important to know when the structure is not
+ * found so it can be initialized to 0. */
+ handoff = cbmem_find(CBMEM_ID_ROMSTAGE_INFO);
+
+ if (handoff)
+ return handoff;
+
+ handoff = cbmem_add(CBMEM_ID_ROMSTAGE_INFO, sizeof(*handoff));
+
+ if (handoff != NULL)
+ memset(handoff, 0, sizeof(*handoff));
+ else
+ printk(BIOS_DEBUG, "Romstage handoff structure not added!\n");
+
+ return handoff;
+}
+
+int romstage_handoff_init(int is_s3_resume)
+{
+ struct romstage_handoff *handoff;
+
+ handoff = romstage_handoff_find_or_add();
+
+ if (handoff == NULL)
+ return -1;
+
+ handoff->s3_resume = is_s3_resume;
+
+ return 0;
+}
+
+int romstage_handoff_is_resume(void)
+{
+ struct romstage_handoff *handoff;
+
+ if (!cbmem_available())
+ return 0;
+
+ handoff = cbmem_find(CBMEM_ID_ROMSTAGE_INFO);
+
+ if (handoff == NULL)
+ return 0;
+
+ return handoff->s3_resume;
+}
Damien Zammit (damien(a)zamaudio.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17645
-gerrit
commit 8684bf8685a58fcc13792d1d6cf3a6c706677d14
Author: Damien Zammit <damien(a)zamaudio.com>
Date: Wed Nov 30 14:32:20 2016 +1100
nb/intel/gm45: Clear GTT correctly for IOMMU (igd)
Bit 11 of BDF(0,0,0), GGC(0x52) is actually the correct bit
for detecting VT mode on IGD, not bit 10, according to
GM45 Intel chipset datasheet.
Now we use the correct bit for detecting VT mode on IGD.
UNTESTED ON HW.
Change-Id: I60268072619253443a04e61c9617f2260d5a750c
Signed-off-by: Damien Zammit <damien(a)zamaudio.com>
---
src/northbridge/intel/gm45/iommu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/northbridge/intel/gm45/iommu.c b/src/northbridge/intel/gm45/iommu.c
index 77aba94..76432fb 100644
--- a/src/northbridge/intel/gm45/iommu.c
+++ b/src/northbridge/intel/gm45/iommu.c
@@ -46,8 +46,8 @@ void init_iommu()
MCHBAR32(0x20) = IOMMU_BASE4 | 1; /* all other DMA sources */
/* clear GTT */
- u32 gtt = pci_read_config16(PCI_DEV(0, 0, 0), 0x52);
- if (gtt & 0x400) { /* VT mode */
+ u16 ggc = pci_read_config16(PCI_DEV(0, 0, 0), D0F0_GGC);
+ if (ggc & 0x800) { /* VT mode */
pci_devfn_t igd = PCI_DEV(0, 2, 0);
/* setup somewhere */
the following patch was just integrated into master:
commit adcba9438d54481a71f2e90c8fa1014c7ee273ed
Author: Martin Roth <martinroth(a)google.com>
Date: Mon Nov 28 13:16:24 2016 -0700
util/lint: Add check for symbolic links in the coreboot tree
Because of the varied environments that coreboot is built under, we
don't want to have symbolic links in the tree.
Change-Id: I4cf9d95a437626cb52e3032a5e6cba83320a334b
Signed-off-by: Martin Roth <martinroth(a)google.com>
Reviewed-on: https://review.coreboot.org/17633
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi(a)google.com>
See https://review.coreboot.org/17633 for details.
-gerrit
the following patch was just integrated into master:
commit 19424a157df596b814a7c95bac219b1f95fe04ff
Author: Martin Roth <martinroth(a)google.com>
Date: Mon Nov 28 14:30:38 2016 -0700
mb/google/oak: replace symbolic links
These three files were added as symbolic links to the other files in
the same directory. Delete the links, and copy the real files
into their places.
Because of the varied environments that coreboot is built in, we don't
want to have symbolic links in the tree.
These three files were the only cases of symbolic links.
Change-Id: If69f40c2c4cdcabc4fdfc1d6026a91c0791756da
Signed-off-by: Martin Roth <martinroth(a)google.com>
Reviewed-on: https://review.coreboot.org/17632
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi(a)google.com>
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
See https://review.coreboot.org/17632 for details.
-gerrit