Jean Lucas (jean(a)4ray.co) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13520
-gerrit
commit 57541f5cc6d0b36950f05b6cd6759a3c79e81ca6
Author: Jean Lucas <jean(a)4ray.co>
Date: Sat Jan 30 01:20:54 2016 -0500
lib/gcov-glue.c: Remove trailing number from COVERAGE_MAGIC macro
The COVERAGE_MAGIC macro has a trailing `4' on it, which makes it a
64-bit large integer, as opposed to a 32-bit unsigned integer, as
originally designated in `util/cbmem/cbmem.c'. Remove this number so
building with CODE_COVERAGE will succeed.
Change-Id: Ib5d7f2704a4c092c3eca6f62e219edb30950d793
Signed-off-by: Jean Lucas <jean(a)4ray.co>
---
src/lib/gcov-glue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/gcov-glue.c b/src/lib/gcov-glue.c
index 4e5a9e1..0e45247 100644
--- a/src/lib/gcov-glue.c
+++ b/src/lib/gcov-glue.c
@@ -34,7 +34,7 @@ typedef struct file {
#define COVERAGE_SIZE (32*1024)
-#define COVERAGE_MAGIC 0x584d41534
+#define COVERAGE_MAGIC 0x584d4153
static FILE *current_file = NULL;
static FILE *previous_file = NULL;
Jean Lucas (jean(a)4ray.co) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13520
-gerrit
commit 56314c1e71c0775eb6d89ccb57f856f06f182305
Author: Jean Lucas <jean(a)4ray.co>
Date: Sat Jan 30 01:20:54 2016 -0500
lib/gcov-glue.c: Remove trailing number from COVERAGE_MAGIC macro
The COVERAGE_MAGIC macro has a trailing `4' on it, which makes it a
64-bit large integer, as opposed to a 32-bit unsigned integer, a
originally designated in `util/cbmem/cbmem.c'. Remove this number so
building with CODE_COVERAGE will succeed.
Change-Id: Ib5d7f2704a4c092c3eca6f62e219edb30950d793
Signed-off-by: Jean Lucas <jean(a)4ray.co>
---
src/lib/gcov-glue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/gcov-glue.c b/src/lib/gcov-glue.c
index 4e5a9e1..0e45247 100644
--- a/src/lib/gcov-glue.c
+++ b/src/lib/gcov-glue.c
@@ -34,7 +34,7 @@ typedef struct file {
#define COVERAGE_SIZE (32*1024)
-#define COVERAGE_MAGIC 0x584d41534
+#define COVERAGE_MAGIC 0x584d4153
static FILE *current_file = NULL;
static FILE *previous_file = NULL;
Jean Lucas (jean(a)4ray.co) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13520
-gerrit
commit 5121d744b9880967ebbc8bb72751c026ac381699
Author: Jean Lucas <jean(a)4ray.co>
Date: Sat Jan 30 01:20:54 2016 -0500
lib/gcov-glue.c: Remove trailing number from COVERAGE_MAGIC macro
The COVERAGE_MAGIC macro has a trailing `4' on it, which makes it a
64-bit large integer, as opposed to a 32-bit unsigned integer, a
originally designated in `util/cbmem/cbmem.c'. Remove this number so
so building with CODE_COVERAGE will succeed.
Change-Id: Ib5d7f2704a4c092c3eca6f62e219edb30950d793
Signed-off-by: Jean Lucas <jean(a)4ray.co>
---
src/lib/gcov-glue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/gcov-glue.c b/src/lib/gcov-glue.c
index 4e5a9e1..0e45247 100644
--- a/src/lib/gcov-glue.c
+++ b/src/lib/gcov-glue.c
@@ -34,7 +34,7 @@ typedef struct file {
#define COVERAGE_SIZE (32*1024)
-#define COVERAGE_MAGIC 0x584d41534
+#define COVERAGE_MAGIC 0x584d4153
static FILE *current_file = NULL;
static FILE *previous_file = NULL;
Jean Lucas (jean(a)4ray.co) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13520
-gerrit
commit 3854a9cd0d71b647e05700ce941f01f570edd2ed
Author: Jean Lucas <jean(a)4ray.co>
Date: Sat Jan 30 01:20:54 2016 -0500
lib/gcov-glue.c: Remove trailing number from COVERAGE_MAGIC macro
The COVERAGE_MAGIC macro has a trailing `4' on it, which makes it a
64-bit large integer, as opposed to a 32-bit unsigned integer, as
originally designated in `util/cbmem/cbmem.c'. Remove this number
so building with CODE_COVERAGE will succeed.
Change-Id: Ib5d7f2704a4c092c3eca6f62e219edb30950d793
Signed-off-by: Jean Lucas <jean(a)4ray.co>
---
src/lib/gcov-glue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/gcov-glue.c b/src/lib/gcov-glue.c
index 4e5a9e1..0e45247 100644
--- a/src/lib/gcov-glue.c
+++ b/src/lib/gcov-glue.c
@@ -34,7 +34,7 @@ typedef struct file {
#define COVERAGE_SIZE (32*1024)
-#define COVERAGE_MAGIC 0x584d41534
+#define COVERAGE_MAGIC 0x584d4153
static FILE *current_file = NULL;
static FILE *previous_file = NULL;
Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13302
-gerrit
commit 50d70eca7fa7ebb5862cf0635c159b2a963db171
Author: Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com>
Date: Wed Oct 7 11:06:14 2015 -0700
cpu/x86/tsc: Compile delay_tsc.c for the bootblock as well
This is needed in a follow-on patch to enable udelay() handling on
apollolake, which is a dependency for the console code.
Change-Id: I7da6a060a91b83f3b32c5c5d269c102ce7ae3b8a
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com>
---
src/cpu/x86/tsc/Makefile.inc | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/cpu/x86/tsc/Makefile.inc b/src/cpu/x86/tsc/Makefile.inc
index bbebda9..7e2eab2 100644
--- a/src/cpu/x86/tsc/Makefile.inc
+++ b/src/cpu/x86/tsc/Makefile.inc
@@ -1,3 +1,4 @@
+bootblock-$(CONFIG_UDELAY_TSC) += delay_tsc.c
ramstage-$(CONFIG_UDELAY_TSC) += delay_tsc.c
romstage-$(CONFIG_TSC_CONSTANT_RATE) += delay_tsc.c
verstage-$(CONFIG_TSC_CONSTANT_RATE) += delay_tsc.c
Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13303
-gerrit
commit 1c13fbf97ee429bb19cc70b728b455bfdeedc8c4
Author: Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com>
Date: Tue Oct 6 16:31:34 2015 -0700
soc/apollolake: Add tsc_freq_mhz() functionality for udelay()
Change-Id: I2f1147cefe2438992bff45fc0a1e91064217915d
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com>
---
src/soc/intel/apollolake/Kconfig | 1 +
src/soc/intel/apollolake/Makefile.inc | 5 +++++
src/soc/intel/apollolake/include/soc/cpu.h | 20 ++++++++++++++++++++
src/soc/intel/apollolake/tsc_freq.c | 21 +++++++++++++++++++++
4 files changed, 47 insertions(+)
diff --git a/src/soc/intel/apollolake/Kconfig b/src/soc/intel/apollolake/Kconfig
index f7ae68e..825a40f 100644
--- a/src/soc/intel/apollolake/Kconfig
+++ b/src/soc/intel/apollolake/Kconfig
@@ -32,6 +32,7 @@ config CPU_SPECIFIC_OPTIONS
select RELOCATABLE_RAMSTAGE # Build fails if this is not selected
select SOC_INTEL_COMMON
select UDELAY_TSC
+ select TSC_CONSTANT_RATE
config MMCONF_BASE_ADDRESS
hex "PCI MMIO Base Address"
diff --git a/src/soc/intel/apollolake/Makefile.inc b/src/soc/intel/apollolake/Makefile.inc
index cc3e013..17b4ae4 100644
--- a/src/soc/intel/apollolake/Makefile.inc
+++ b/src/soc/intel/apollolake/Makefile.inc
@@ -10,6 +10,11 @@ subdirs-y += ../../../cpu/x86/tsc
bootblock-y += bootblock/bootblock_car.c
bootblock-y += bootblock/cache_as_ram.S
bootblock-y += bootblock/early_chipset_config.S
+bootblock-y += tsc_freq.c
+
+romstage-y += tsc_freq.c
+
+ramstage-y += tsc_freq.c
romstage-y += placeholders.c
smm-y += placeholders.c
diff --git a/src/soc/intel/apollolake/include/soc/cpu.h b/src/soc/intel/apollolake/include/soc/cpu.h
new file mode 100644
index 0000000..d0d6afd
--- /dev/null
+++ b/src/soc/intel/apollolake/include/soc/cpu.h
@@ -0,0 +1,20 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Intel Corp.
+ * (Written by Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com> for Intel Corp.)
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef _SOC_APOLLOLAKE_CPU_H_
+#define _SOC_APOLLOLAKE_CPU_H_
+
+#define MSR_PLATFORM_INFO 0xce
+
+#define BASE_CLOCK_MHZ 100
+
+#endif /* _SOC_APOLLOLAKE_CPU_H_ */
diff --git a/src/soc/intel/apollolake/tsc_freq.c b/src/soc/intel/apollolake/tsc_freq.c
new file mode 100644
index 0000000..2e90ef2
--- /dev/null
+++ b/src/soc/intel/apollolake/tsc_freq.c
@@ -0,0 +1,21 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2015 Intel Corp.
+ * (Written by Alexandru Gagniuc <alexandrux.gagniuc(a)intel.com> for Intel Corp.)
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <cpu/x86/msr.h>
+#include <cpu/x86/tsc.h>
+#include <soc/cpu.h>
+
+unsigned long tsc_freq_mhz(void)
+{
+ msr_t msr = rdmsr(MSR_PLATFORM_INFO);
+ return (BASE_CLOCK_MHZ * ((msr.lo >> 8) & 0xff));
+}