[Skiboot] [PATCH skiboot 2/2] core/flash: Add fwts olog annotations

Jeremy Kerr jk at ozlabs.org
Wed Apr 27 21:28:03 AEST 2016


This change adds a few fwts patterns to the flash code, mostly as an
example of the annotations we have.

Signed-off-by: Jeremy Kerr <jk at ozlabs.org>
---
 core/flash.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/core/flash.c b/core/flash.c
index 746db6f..734e0fa 100644
--- a/core/flash.c
+++ b/core/flash.c
@@ -161,6 +161,13 @@ static int flash_nvram_probe(struct flash *flash, struct ffs_handle *ffs)
 	rc = ffs_part_info(ffs, part, NULL,
 			   &start, &size, NULL, NULL);
 	if (rc) {
+		/**
+		 * @fwts-label NVRAMNoPartition
+		 * @fwts-advice OPAL could not find an NVRAM partition
+		 *     on the system flash. Check that the system flash
+		 *     has a valid partition table, and that the firmware
+		 *     build process has added a NVRAM partition.
+		 */
 		prlog(PR_ERR, "FLASH: Can't parse ffs info for NVRAM\n");
 		return OPAL_HARDWARE;
 	}
@@ -202,12 +209,25 @@ static void setup_system_flash(struct flash *flash, struct dt_node *node,
 	char *path;
 
 	if (system_flash) {
+		/**
+		 * @fwts-label SystemFlashDuplicate
+		 * @fwts-advice More than one flash device was registered
+		 *  as the system flash device. Check for duplicate calls
+		 *  to flash_register(..., true).
+		 */
 		prlog(PR_WARNING, "FLASH: attempted to register a second "
 				"system flash device %s\n", name);
 		return;
 	}
 
 	if (!ffs) {
+		/**
+		 * @fwts-label SystemFlashNoPartitionTable
+		 * @fwts-advice OPAL Could not read a partition table on
+		 *    system flash. Since we've still booted the machine (which
+		 *    requires flash), check that we're registering the proper
+		 *    system flash device.
+		 */
 		prlog(PR_WARNING, "FLASH: attempted to register system flash "
 				"%s, wwhich has no partition info\n", name);
 		return;
-- 
2.5.0



More information about the Skiboot mailing list