Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3913
-gerrit
commit 48820e75e2f9398c24ac847c88674e82d3b1aabd
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Sun Sep 8 13:48:36 2013 +0300
timestamps epia-m850: Cleanup without enabling timestamps
Remove the existing hack, platform needs a fix for EARLY_CBMEM_INIT.
Change-Id: I7ce373c9698878d9fa056983e4fb571a68239c52
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/mainboard/via/epia-m850/romstage.c | 43 +++++++---------------------------
src/northbridge/via/vx900/Makefile.inc | 1 -
2 files changed, 9 insertions(+), 35 deletions(-)
diff --git a/src/mainboard/via/epia-m850/romstage.c b/src/mainboard/via/epia-m850/romstage.c
index 364de48..23b5aea 100644
--- a/src/mainboard/via/epia-m850/romstage.c
+++ b/src/mainboard/via/epia-m850/romstage.c
@@ -20,8 +20,6 @@
/*
* Inspired from the EPIA-M700
*/
-#undef CONFIG_COLLECT_TIMESTAMPS
-#define CONFIG_COLLECT_TIMESTAMPS 1
#include <stdint.h>
#include <device/pci_def.h>
#include <device/pci_ids.h>
@@ -43,25 +41,13 @@
#define SERIAL_DEV PNP_DEV(0x4e, 0x10)
-static inline u64 tsc2u64(tsc_t tsc)
-{
- return ((u64) tsc.hi << 32) | tsc.lo;
-}
-
-/* FIXME: This board comes in two flavours. This is for the faster CPU, but
- * will probably not be correct for the other CPU */
-#define TSC_PER_USEC 1297
-static inline u32 tsc2ms(u64 end, u64 start)
-{
- return ((u32) (end - start) / TSC_PER_USEC) / 1000;
-}
-
/* cache_as_ram.inc jumps to here. */
void main(unsigned long bist)
{
u32 tolm;
- u64 start, end;
- tsc_t tsc_at_romstage_start = rdtsc();
+
+ timestamp_init(rdtsc());
+ timestamp_add_now(TS_START_ROMSTAGE);
/* First thing we need to do on the VX900, before anything else */
vx900_enable_pci_config_space();
@@ -83,13 +69,13 @@ void main(unsigned long bist)
/* Oh, almighty, give us the SMBUS */
enable_smbus();
- tsc_t tsc_before_raminit = rdtsc();
+ timestamp_add_now(TS_BEFORE_INITRAM);
/* Now we can worry about raminit.
* This board only has DDR3, so no need to worry about which DRAM type
* to use */
dimm_layout dimms = { {0x50, 0x51, SPD_END_LIST} };
vx900_init_dram_ddr3(&dimms);
- tsc_t tsc_after_raminit = rdtsc();
+ timestamp_add_now(TS_AFTER_INITRAM);
/* TODO: All these ram_checks are here to ensure we test most of the RAM
* below 4G. They should not be needed once VX900 raminit is stable */
@@ -106,25 +92,14 @@ void main(unsigned long bist)
ram_check(2048 << 20, 0x80);
print_debug("We passed RAM verify\n");
-#ifdef GONFIG_EARLY_CBMEM_INIT
+
/* We got RAM working, now we can write the timestamps to RAM */
+#if CONFIG_EARLY_CBMEM_INIT
cbmem_initialize();
- timestamp_init(tsc_at_romstage_start);
- timestamp_add(TS_START_ROMSTAGE, tsc_at_romstage_start);
- timestamp_add(TS_BEFORE_INITRAM, tsc_before_raminit);
- timestamp_add(TS_AFTER_INITRAM, tsc_after_raminit);
- timestamp_add_now(TS_END_ROMSTAGE);
#endif
+ timestamp_sync();
+ timestamp_add_now(TS_END_ROMSTAGE);
/* FIXME: See if this is needed or take this out please */
/* Disable Memcard and SDIO */
pci_mod_config8(LPC, 0x51, 0, (1 << 7) | (1 << 4));
-
- /* Informative character. Could be removed at a later time. */
- start = tsc2u64(tsc_at_romstage_start);
- end = tsc2u64(tsc_before_raminit);
- printk(BIOS_INFO, "Before raminit %ums\n", tsc2ms(end, start));
-
- start = end;
- end = tsc2u64(tsc_after_raminit);
- printk(BIOS_INFO, "Actual Raminit %ums\n", tsc2ms(end, start));
}
diff --git a/src/northbridge/via/vx900/Makefile.inc b/src/northbridge/via/vx900/Makefile.inc
index 13d7de6..15fd859 100644
--- a/src/northbridge/via/vx900/Makefile.inc
+++ b/src/northbridge/via/vx900/Makefile.inc
@@ -29,7 +29,6 @@ romstage-y += ./../../../southbridge/via/common/early_smbus_print_error.c
romstage-y += ./../../../southbridge/via/common/early_smbus_reset.c
romstage-y += ./../../../southbridge/via/common/early_smbus_wait_until_ready.c
romstage-y += ./../../../drivers/pc80/udelay_io.c
-romstage-$(CONFIG_COLLECT_TIMESTAMPS) += ./../../../lib/cbmem.c
ramstage-y += pci_util.c
ramstage-y += pcie.c
the following patch was just integrated into master:
commit 0fbbff48bfc4543ebf2b778d3ed557aae58676da
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Sun Jun 23 20:03:50 2013 +0300
CBMEM: Rename high_tables variables and make them static
Old name was too much x86.
All external references have been removed.
Change-Id: I982b9abfcee57a7ea421c245dadb84342949efae
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/3906
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin(a)google.com>
See http://review.coreboot.org/3906 for details.
-gerrit
the following patch was just integrated into master:
commit 625f103ae8c794c92e403f8749f0442d66966cab
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Wed Sep 4 14:36:31 2013 +0300
CBMEM: Drop parameters from cbmem_init()
The parameters can be dropped as initialisation always happens for
the region resolved with cbmem_locate_table().
This is no longer referenced externally, make it static.
Change-Id: Ia40350a5232dcbf30aca7b5998e7995114c44551
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/3565
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin(a)google.com>
See http://review.coreboot.org/3565 for details.
-gerrit
the following patch was just integrated into master:
commit d50cdf108f9d4b598aa8f6c3205d9a93c3e67131
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Sun Jun 23 17:01:29 2013 +0300
CBMEM: Drop parameter from cbmem_reinit()
Function is always called with get_top_of_ram() - HIGH_MEMORY_SIZE
which equals cbmem_base, thus no need to pass it as a parameter.
Change-Id: If026cb567ff534716cd9200cdffa08b21ac0c162
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/3564
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin(a)google.com>
See http://review.coreboot.org/3564 for details.
-gerrit