timestamps: Rename timestamps to make names more consistent

This patch aims to make timestamps more consistent in naming,
to follow one pattern. Until now there were many naming patterns:
- TS_START_*/TS_END_*
- TS_BEFORE_*/TS_AFTER_*
- TS_*_START/TS_*_END
This change also aims to indicate, that these timestamps can be used
to create time-ranges, e.g. from TS_BOOTBLOCK_START to TS_BOOTBLOCK_END.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I533e32392224d9b67c37e6a67987b09bf1cf51c6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62019
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
diff --git a/src/lib/bootblock.c b/src/lib/bootblock.c
index 5989964..5c202ba 100644
--- a/src/lib/bootblock.c
+++ b/src/lib/bootblock.c
@@ -39,7 +39,7 @@
 				      timestamps[i].entry_stamp);
 	}
 
-	timestamp_add_now(TS_START_BOOTBLOCK);
+	timestamp_add_now(TS_BOOTBLOCK_START);
 
 	bootblock_soc_early_init();
 	bootblock_mainboard_early_init();
@@ -63,7 +63,7 @@
 		tpm_setup(s3resume);
 	}
 
-	timestamp_add_now(TS_END_BOOTBLOCK);
+	timestamp_add_now(TS_BOOTBLOCK_END);
 
 	run_romstage();
 }
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 2d98c44..0f07a32 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -215,9 +215,9 @@
 			return 0;
 
 		if (!cbfs_file_hash_mismatch(map, in_size, mdata, skip_verification)) {
-			timestamp_add_now(TS_START_ULZ4F);
+			timestamp_add_now(TS_ULZ4F_START);
 			out_size = ulz4fn(map, in_size, buffer, buffer_size);
-			timestamp_add_now(TS_END_ULZ4F);
+			timestamp_add_now(TS_ULZ4F_END);
 		}
 
 		rdev_munmap(rdev, map);
@@ -233,9 +233,9 @@
 
 		if (!cbfs_file_hash_mismatch(map, in_size, mdata, skip_verification)) {
 			/* Note: timestamp not useful for memory-mapped media (x86) */
-			timestamp_add_now(TS_START_ULZMA);
+			timestamp_add_now(TS_ULZMA_START);
 			out_size = ulzman(map, in_size, buffer, buffer_size);
-			timestamp_add_now(TS_END_ULZMA);
+			timestamp_add_now(TS_ULZMA_END);
 		}
 
 		rdev_munmap(rdev, map);
diff --git a/src/lib/decompressor.c b/src/lib/decompressor.c
index 1d160e0..22d31df 100644
--- a/src/lib/decompressor.c
+++ b/src/lib/decompressor.c
@@ -23,8 +23,8 @@
 	.base_timestamp = 0,
 	.num_timestamps = 2,
 	.timestamps = {
-		{ .entry_id = TS_START_ULZ4F },
-		{ .entry_id = TS_END_ULZ4F },
+		{ .entry_id = TS_ULZ4F_START },
+		{ .entry_id = TS_ULZ4F_END },
 	},
 };
 
diff --git a/src/lib/fit_payload.c b/src/lib/fit_payload.c
index d61bfd5..21bc4e8 100644
--- a/src/lib/fit_payload.c
+++ b/src/lib/fit_payload.c
@@ -62,14 +62,14 @@
 		true_size = node->size;
 		break;
 	case CBFS_COMPRESS_LZMA:
-		timestamp_add_now(TS_START_ULZMA);
+		timestamp_add_now(TS_ULZMA_START);
 		true_size = ulzman(node->data, node->size, dst, region->size);
-		timestamp_add_now(TS_END_ULZMA);
+		timestamp_add_now(TS_ULZMA_END);
 		break;
 	case CBFS_COMPRESS_LZ4:
-		timestamp_add_now(TS_START_ULZ4F);
+		timestamp_add_now(TS_ULZ4F_START);
 		true_size = ulz4fn(node->data, node->size, dst, region->size);
-		timestamp_add_now(TS_END_ULZ4F);
+		timestamp_add_now(TS_ULZ4F_END);
 		break;
 	default:
 		return true;
@@ -240,5 +240,5 @@
 		return;
 	}
 
-	timestamp_add_now(TS_START_KERNEL);
+	timestamp_add_now(TS_KERNEL_START);
 }
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index b646e0c..b5ed6e0 100644
--- a/src/lib/hardwaremain.c
+++ b/src/lib/hardwaremain.c
@@ -457,7 +457,7 @@
 	 */
 	cbmem_initialize();
 
-	timestamp_add_now(TS_START_RAMSTAGE);
+	timestamp_add_now(TS_RAMSTAGE_START);
 	post_code(POST_ENTRY_HARDWAREMAIN);
 
 	/* Handoff sleep type from romstage. */
diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c
index 25a8836..a296bd6 100644
--- a/src/lib/prog_loaders.c
+++ b/src/lib/prog_loaders.c
@@ -24,7 +24,7 @@
 
 	vboot_run_logic();
 
-	timestamp_add_now(TS_START_COPYROM);
+	timestamp_add_now(TS_COPYROM_START);
 
 	if (ENV_X86 && CONFIG(BOOTBLOCK_NORMAL)) {
 		if (legacy_romstage_select_and_load(&romstage))
@@ -34,7 +34,7 @@
 			goto fail;
 	}
 
-	timestamp_add_now(TS_END_COPYROM);
+	timestamp_add_now(TS_COPYROM_END);
 
 	console_time_report();
 
@@ -90,11 +90,11 @@
 		PROG_INIT(PROG_RAMSTAGE, CONFIG_CBFS_PREFIX "/ramstage");
 
 	if (ENV_POSTCAR)
-		timestamp_add_now(TS_END_POSTCAR);
+		timestamp_add_now(TS_POSTCAR_END);
 
 	/* Call "end of romstage" here if postcar stage doesn't exist */
 	if (ENV_ROMSTAGE)
-		timestamp_add_now(TS_END_ROMSTAGE);
+		timestamp_add_now(TS_ROMSTAGE_END);
 
 	/*
 	 * Only x86 systems using ramstage stage cache currently take the same
@@ -105,7 +105,7 @@
 
 	vboot_run_logic();
 
-	timestamp_add_now(TS_START_COPYRAM);
+	timestamp_add_now(TS_COPYRAM_START);
 
 	if (ENV_X86) {
 		if (load_relocatable_ramstage(&ramstage))
@@ -117,7 +117,7 @@
 
 	stage_cache_add(STAGE_RAMSTAGE, &ramstage);
 
-	timestamp_add_now(TS_END_COPYRAM);
+	timestamp_add_now(TS_COPYRAM_END);
 
 	console_time_report();
 
diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c
index f1c0b97..70ab719 100644
--- a/src/lib/selfboot.c
+++ b/src/lib/selfboot.c
@@ -72,18 +72,18 @@
 	switch (compression) {
 	case CBFS_COMPRESS_LZMA: {
 		printk(BIOS_DEBUG, "using LZMA\n");
-		timestamp_add_now(TS_START_ULZMA);
+		timestamp_add_now(TS_ULZMA_START);
 		len = ulzman(src, len, dest, memsz);
-		timestamp_add_now(TS_END_ULZMA);
+		timestamp_add_now(TS_ULZMA_END);
 		if (!len) /* Decompression Error. */
 			return 0;
 		break;
 	}
 	case CBFS_COMPRESS_LZ4: {
 		printk(BIOS_DEBUG, "using LZ4\n");
-		timestamp_add_now(TS_START_ULZ4F);
+		timestamp_add_now(TS_ULZ4F_START);
 		len = ulz4fn(src, len, dest, memsz);
-		timestamp_add_now(TS_END_ULZ4F);
+		timestamp_add_now(TS_ULZ4F_END);
 		if (!len) /* Decompression Error. */
 			return 0;
 		break;