Patchwork protection-free boards

login
register
about
Submitter Stefan Reinauer
Date 2009-07-25 10:12:04
Message ID <4A6ADA74.2000107@coresystems.de>
Download mbox | patch
Permalink /patch/74/
State Superseded
Headers show

Comments

Stefan Reinauer - 2009-07-25 10:12:04
Hi,

this patch makes flashrom "protection-free boards" friendly when
coreboot is running by making the board->enable() function optional in
the board structure.

Stefan
Carl-Daniel Hailfinger - 2009-07-27 15:19:11
On 25.07.2009 12:12, Stefan Reinauer wrote:
> this patch makes flashrom "protection-free boards" friendly when
> coreboot is running by making the board->enable() function optional in
> the board structure.
>
> Index: board_enable.c
> ===================================================================
> --- board_enable.c	(revision 667)
> +++ board_enable.c	(working copy)
> @@ -1186,8 +1186,8 @@
>  	if (!board)
>  		board = board_match_pci_card_ids();
>  
> -	if (board) {
> -		printf("Found board \"%s %s\", enabling flash write... ",
> +	if (board && board->enable) {
> +		printf("Disabling flash write protection for board \"%s %s\"... ",
>  		       board->vendor_name, board->board_name);
>  
>  		ret = board->enable(board->vendor_name);

This means you have to add an empty board enable for every single board
supported by coreboot. It would be a lot better to check if we got the
board name from lbtable, then print a message "found board xy,
apparently no board specific write enable needed".
I'll send a patch.

Regards,
Carl-Daniel

Patch

This patch makes board->enable() optional, so we can add boards that need
no board enable function to board_pciid_enables to prevent warnings on 
coreboot.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>

Index: board_enable.c
===================================================================
--- board_enable.c	(revision 667)
+++ board_enable.c	(working copy)
@@ -1186,8 +1186,8 @@ 
 	if (!board)
 		board = board_match_pci_card_ids();
 
-	if (board) {
-		printf("Found board \"%s %s\", enabling flash write... ",
+	if (board && board->enable) {
+		printf("Disabling flash write protection for board \"%s %s\"... ",
 		       board->vendor_name, board->board_name);
 
 		ret = board->enable(board->vendor_name);