i have added printing of the voltage ranges.
sample output below, patch attached.

steven: do you plan to add the missing values in the future?
and what are the plans for the form factors/chip packages?
aaaand do we want the voltage ranges in the wiki (output) too?


Vendor                Device                                 Tested   Known    
Size [kB]  Type      Voltage range [V]
                                                             OK       Broken

(P = PROBE, R = READ, E = ERASE, W = WRITE)

AMD                   Am29F010A/B                            P R E             
128        Parallel  4.500, 5.500
AMD                   Am29F002(N)BB                                            
256        Parallel  4.750, 5.250
AMD                   Am29F002(N)BT                                            
256        Parallel  not specified
AMD                   Am29F016D                                                
2048       Parallel  4.500, 5.500
AMD                   Am29F040B                                                
512        Parallel  4.500, 5.500
AMD                   Am29F080B                                                
1024       Parallel  4.500, 5.500
AMD                   Am29LV001BB                            P R E W           
128        Parallel  not specified
AMD                   Am29LV001BT                                              
128        Parallel  not specified
AMD                   Am29LV002BB                                              
256        Parallel  not specified

-- 
Kind regards/Mit freundlichen Grüßen, Stefan Tauner
>From 23e93b4be05079b1f725f8fdadc70be17b6c23a5 Mon Sep 17 00:00:00 2001
From: Stefan Tauner <[email protected]>
Date: Fri, 3 Jun 2011 09:15:51 +0200
Subject: [PATCH] add printing of voltage ranges to print_supported_chips


Signed-off-by: Stefan Tauner <[email protected]>
---
 print.c |   33 ++++++++++++++++++++++++++++-----
 1 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/print.c b/print.c
index ac49e03..d374c0b 100644
--- a/print.c
+++ b/print.c
@@ -79,6 +79,7 @@ static void print_supported_chips(void)
 	int okcol = 0, pos = 0, i, chipcount = 0;
 	int maxvendorlen = strlen("Vendor") + 1;
 	int maxchiplen = strlen("Device") + 1;
+	int maxtypelen = strlen("Type") + 1;
 	const struct flashchip *f;
 
 	for (f = flashchips; f->name != NULL; f++) {
@@ -88,9 +89,12 @@ static void print_supported_chips(void)
 		chipcount++;
 		maxvendorlen = max(maxvendorlen, strlen(f->vendor));
 		maxchiplen = max(maxchiplen, strlen(f->name));
+		maxtypelen = max(maxtypelen,
+				 strlen(flashbuses_to_text(f->bustype)));
 	}
-	maxvendorlen++;
-	maxchiplen++;
+	maxvendorlen += 2;
+	maxchiplen += 2;
+	maxtypelen += 2;
 	okcol = maxvendorlen + maxchiplen;
 
 	printf("Supported flash chips (total: %d):\n\n", chipcount);
@@ -101,7 +105,13 @@ static void print_supported_chips(void)
 	for (i = strlen("Device"); i < maxchiplen; i++)
 		printf(" ");
 
-	printf("Tested   Known    Size/kB:  Type:\n");
+	printf("Tested   Known    Size [kB]  ");
+
+	printf("Type");
+	for (i = strlen("Type"); i < maxtypelen; i++)
+		printf(" ");
+	printf("Voltage range [V]\n");
+
 	for (i = 0; i < okcol; i++)
 		printf(" ");
 	printf("OK       Broken\n\n");
@@ -150,9 +160,22 @@ static void print_supported_chips(void)
 			pos++;
 		}
 		printf("%d", f->total_size);
-		for (i = 0; i < 10 - digits(f->total_size); i++)
+		for (i = 0; i < 11 - digits(f->total_size); i++)
 			printf(" ");
-		printf("%s\n", flashbuses_to_text(f->bustype));
+		printf("%s", flashbuses_to_text(f->bustype));
+
+		for (i = strlen(flashbuses_to_text(f->bustype));
+		     i < maxtypelen;
+		     i++)
+			printf(" ");
+
+		if (f->voltage.min == 0 && f->voltage.max == 0)
+			printf("not specified");
+		else
+			printf("%0.03f, %0.03f",
+			       f->voltage.min/(double)1000,
+			       f->voltage.max/(double)1000);
+		printf("\n");
 	}
 }
 
-- 
1.7.1

_______________________________________________
flashrom mailing list
[email protected]
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to