Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31203
Change subject: cpu/intel/common: Compute the TSC tick freq based on FSB
......................................................................
cpu/intel/common: Compute the TSC tick freq based on FSB
This allows the cbmem utility to compute timestamps based on coreboot
tables without relying on other userspace components.
Change-Id: Ie87adec950dc51f4f873c0d852a325b3ff9b18bf
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/cpu/intel/common/fsb.c
1 file changed, 26 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/31203/1
diff --git a/src/cpu/intel/common/fsb.c b/src/cpu/intel/common/fsb.c
index 1f7c391..cf258bd 100644
--- a/src/cpu/intel/common/fsb.c
+++ b/src/cpu/intel/common/fsb.c
@@ -11,7 +11,9 @@
* GNU General Public License for more details.
*/
+#include <console/console.h>
#include <cpu/cpu.h>
+#include <cpu/x86/tsc.h>
#include <cpu/x86/msr.h>
#include <cpu/intel/speedstep.h>
#include <cpu/intel/fsb.h>
@@ -83,3 +85,27 @@
printk(BIOS_ERR, "FSB not supported or not found\n");
return -1;
}
+
+unsigned long tsc_freq_mhz(void)
+{
+ msr_t msr;
+ unsigned long multiplier;
+ struct cpuinfo_x86 c;
+
+ get_fms(&c, cpuid_eax(1));
+
+ msr = rdmsr(IA32_PLATFORM_ID);
+ multiplier = (msr.lo & SPEEDSTEP_RATIO_VALUE_MASK)
+ >> SPEEDSTEP_RATIO_SHIFT;
+ if ((c.x86 == 6 && c.x86_model == 0xe) || (c.x86 == 0xf)) {
+ /* Looks like Yonah CPUs don't have the frequency ratio in
+ IA32_PLATFORM_ID. Use IA32_PERF_STATUS instead, the reading
+ should be reliable as those CPUs don't have turbo mode. */
+ msr = rdmsr(IA32_PERF_STATUS);
+ multiplier = (msr.hi & SPEEDSTEP_RATIO_VALUE_MASK)
+ >> SPEEDSTEP_RATIO_SHIFT;
+ }
+
+ printk(BIOS_DEBUG, "CPU freq %ld\n", multiplier * get_ia32_fsb());
+ return multiplier * get_ia32_fsb();
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/31203
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie87adec950dc51f4f873c0d852a325b3ff9b18bf
Gerrit-Change-Number: 31203
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31202
Change subject: arch/x86/timestamp.c: Don't depend on CONFIG_TSC_CONSTANT_RATE
......................................................................
arch/x86/timestamp.c: Don't depend on CONFIG_TSC_CONSTANT_RATE
timestamp_tick_freq_mhz() is used to populate the coreboot tables
which cbmem can use to determine timestamps without needing userspace
tools to get the TSC frequency rate. CONFIG_TSC_CONSTANT_RATE depends
on CONFIG_UDELAY_TSC which is not the case on all targets that could
still make use of this functionality.
Change-Id: I8c34eb811e27d2a91ccf1ca6f48a638da5f6cfd9
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/arch/x86/timestamp.c
1 file changed, 13 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/31202/1
diff --git a/src/arch/x86/timestamp.c b/src/arch/x86/timestamp.c
index b5257c4..f7b5541 100644
--- a/src/arch/x86/timestamp.c
+++ b/src/arch/x86/timestamp.c
@@ -21,14 +21,20 @@
return rdtscll();
}
+/* We want build to fail on targets with CONFIG_TSC_CONSTANT_RATE
+ if an implementation is lacking since it used to compute udelays.
+ FIXME: provide an implementation on every target to get rid of this.*/
+#if !IS_ENABLED(CONFIG_TSC_CONSTANT_RATE)
+unsigned long __weak tsc_freq_mhz(void)
+{
+ /* Default to not knowing TSC frequency. cbmem will have to fallback
+ * on trying to determine it in userspace. */
+ return 0;
+}
+#endif
+
int timestamp_tick_freq_mhz(void)
{
/* Chipsets that have a constant TSC provide this value correctly. */
- if (IS_ENABLED(CONFIG_TSC_CONSTANT_RATE))
- return tsc_freq_mhz();
-
- /* Filling tick_freq_mhz = 0 in timestamps-table will trigger
- * userspace utility to try deduce it from the running system.
- */
- return 0;
+ return tsc_freq_mhz();
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/31202
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I8c34eb811e27d2a91ccf1ca6f48a638da5f6cfd9
Gerrit-Change-Number: 31202
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Arthur Heymans has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/30020 )
Change subject: [WIP]cpu/x86/lapic: Link apic_timer.c into SMM
......................................................................
Abandoned
--
To view, visit https://review.coreboot.org/c/coreboot/+/30020
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic14919f89b226b4d5185e49ae857e7dd61bbccce
Gerrit-Change-Number: 30020
Gerrit-PatchSet: 7
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: HAOUAS Elyes <ehaouas(a)noos.fr>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: abandon
Arthur Heymans has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/30013 )
Change subject: sb/intel/common/smihandler: Compile test CONFIG_ELOG_GSMI
......................................................................
Abandoned
--
To view, visit https://review.coreboot.org/c/coreboot/+/30013
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2491c14c4fd45c74dbf584a07d6d3bf5ede7f69c
Gerrit-Change-Number: 30013
Gerrit-PatchSet: 2
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: abandon
Arthur Heymans has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/27361 )
Change subject: [WIP]util/autoport: Change the order in which chips and PCI devices are added
......................................................................
Abandoned
--
To view, visit https://review.coreboot.org/c/coreboot/+/27361
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib4c7c43dd209678aa3d37fe75a8d010192ae2803
Gerrit-Change-Number: 27361
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: abandon
Arthur Heymans has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/27985 )
Change subject: [TESTONLY]nb/intel/i945: Only disable VGA decode on IGD
......................................................................
Abandoned
No PEG and IGD are mutually exclusive on i945 it seems.
--
To view, visit https://review.coreboot.org/c/coreboot/+/27985
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4f1e1ab349b3e4bcb4d49da4b6d091e57243ee8f
Gerrit-Change-Number: 27985
Gerrit-PatchSet: 3
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: HAOUAS Elyes <ehaouas(a)noos.fr>
Gerrit-MessageType: abandon
Arthur Heymans has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/25552 )
Change subject: drivers/mrc_cache: Allow non ChromeOS targets to write protect MRC_CACHE
......................................................................
Abandoned
Might resume this later, but abandoning for now.
--
To view, visit https://review.coreboot.org/c/coreboot/+/25552
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7536e323c87d63deab59ed90115f2d83f74858e0
Gerrit-Change-Number: 25552
Gerrit-PatchSet: 2
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Furquan Shaikh <furquan(a)google.com>
Gerrit-CC: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: abandon
Arthur Heymans has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/23676 )
Change subject: util/abuild: Allow use of payloads when not providing a configfile
......................................................................
Abandoned
Too old patch...
--
To view, visit https://review.coreboot.org/c/coreboot/+/23676
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4368d9609bceb4cf7edb76c10bc0af0cdeb76958
Gerrit-Change-Number: 23676
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: abandon