Re: [coreboot] [PATCH][superiotool] Quit probe_idregs_* early if chip_found is set

2010-08-10 Thread Stefan Reinauer
 On 8/9/10 11:41 PM, David Hendricks wrote:
> Some chips do not require enter/exit sequences. This causes them to be
> detected and printed multiple times in probe_idregs_* functions where
> a simple series of enter --> probe/print --> exit calls are made.
>
> This patch adds a simple check after each set of those calls to make
> the functions quit after a chip is found.
Great catch.

> Signed-off by: David Hendricks (dhend...@google.com
> )
Acked-by: Stefan Reinauer 


-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] [PATCH][superiotool] Quit probe_idregs_* early if chip_found is set

2010-08-09 Thread Uwe Hermann
On Mon, Aug 09, 2010 at 02:41:28PM -0700, David Hendricks wrote:
> Some chips do not require enter/exit sequences. This causes them to be
> detected and printed multiple times in probe_idregs_* functions where a
> simple series of enter --> probe/print --> exit calls are made.
> 
> This patch adds a simple check after each set of those calls to make the
> functions quit after a chip is found.
> 
> Signed-off by: David Hendricks (dhend...@google.com)

Thanks, looks good. r5689.


Uwe.
-- 
http://hermann-uwe.de | http://sigrok.org
http://randomprojects.org | http://unmaintained-free-software.org

-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot


[coreboot] [PATCH][superiotool] Quit probe_idregs_* early if chip_found is set

2010-08-09 Thread David Hendricks
Some chips do not require enter/exit sequences. This causes them to be
detected and printed multiple times in probe_idregs_* functions where a
simple series of enter --> probe/print --> exit calls are made.

This patch adds a simple check after each set of those calls to make the
functions quit after a chip is found.

Signed-off by: David Hendricks (dhend...@google.com)

-- 
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.
Index: superiotool-head/ite.c
===
--- superiotool-head.orig/ite.c
+++ superiotool-head/ite.c
@@ -781,30 +781,37 @@ void probe_idregs_ite(uint16_t port)
 		enter_conf_mode_ite_legacy(port, initkey_it8661f);
 		probe_idregs_ite_helper("(init=legacy/it8661f) ", port);
 		exit_conf_mode_ite(port);
+		if (chip_found) return;
 
 		enter_conf_mode_ite_legacy(port, initkey_it8671f);
 		probe_idregs_ite_helper("(init=legacy/it8671f) ", port);
 		exit_conf_mode_ite(port);
+		if (chip_found) return;
 	} else {
 		enter_conf_mode_ite(port);
 		probe_idregs_ite_helper("(init=standard) ", port);
 		exit_conf_mode_ite(port);
+		if (chip_found) return;
 
 		enter_conf_mode_ite_it8502e(port);
 		probe_idregs_ite_helper("(init=it8502e) ", port);
 		exit_conf_mode_ite(port);
+		if (chip_found) return;
 
 		enter_conf_mode_ite_it8761e(port);
 		probe_idregs_ite_helper("(init=it8761e) ", port);
 		exit_conf_mode_ite(port);
+		if (chip_found) return;
 
 		enter_conf_mode_ite_it8228e(port);
 		probe_idregs_ite_helper("(init=it8228e) ", port);
 		exit_conf_mode_ite(port);
+		if (chip_found) return;
 
 		enter_conf_mode_winbond_fintek_ite_8787(port);
 		probe_idregs_ite_helper("(init=0x87,0x87) ", port);
 		exit_conf_mode_winbond_fintek_ite_8787(port);
+		if (chip_found) return;
 	}
 }
 
Index: superiotool-head/winbond.c
===
--- superiotool-head.orig/winbond.c
+++ superiotool-head/winbond.c
@@ -614,18 +614,22 @@ void probe_idregs_winbond(uint16_t port)
 	enter_conf_mode_winbond_88(port);
 	probe_idregs_winbond_helper("(init=0x88) ", port);
 	exit_conf_mode_winbond_fintek_ite_8787(port);
+	if (chip_found) return;
 
 	enter_conf_mode_winbond_89(port);
 	probe_idregs_winbond_helper("(init=0x89) ", port);
 	exit_conf_mode_winbond_fintek_ite_8787(port);
+	if (chip_found) return;
 
 	enter_conf_mode_winbond_86(port);
 	probe_idregs_winbond_helper("(init=0x86,0x86) ", port);
 	exit_conf_mode_winbond_fintek_ite_8787(port);
+	if (chip_found) return;
 
 	enter_conf_mode_winbond_fintek_ite_8787(port);
 	probe_idregs_winbond_helper("(init=0x87,0x87) ", port);
 	exit_conf_mode_winbond_fintek_ite_8787(port);
+	if (chip_found) return;
 }
 
 void print_winbond_chips(void)
-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot