patch for allowing the use of the SOCKET target of the SF600

Message ID 7573032.zDFEjKL1Lq@varadin
State New
Headers show
Series
  • patch for allowing the use of the SOCKET target of the SF600
Related show

Commit Message

Florian Kaiser Dec. 10, 2018, 10:05 a.m.
Hello,

I am using this patch for a while now and I did not encounter any problems. I 
am not sure if this was/is not supported. Is there any reason why this is not 
supported?

Thank you very much,
Florian Kaiser

Comments

Nico Huber Dec. 23, 2018, 1:34 p.m. | #1
Hello Florian,

thanks for your patch, I've commented on it inline.

On 10.12.18 11:05, Florian Kaiser wrote:
> I am using this patch for a while now and I did not encounter any problems. I 
> am not sure if this was/is not supported. Is there any reason why this is not 
> supported?

No reason beside that nobody cared about it yet, I guess.

Nico

> From 5df0b1ff7bb95f4384c98727a56a03660dde6aaa Mon Sep 17 00:00:00 2001
> From: Florian Kaiser <fkaiser@genua.de>
> Date: Tue, 31 Jul 2018 13:42:22 +0200
> Subject: [PATCH] dediprog: allow the use of the programming target "socket".
> 
> Change-Id: I8c5120ce2151138093be0f27951916ec7f725574
> Signed-off-by: Florian Kaiser <fkaiser@genua.de>
> ---
>  dediprog.c      | 6 +++++-
>  flashrom.8.tmpl | 5 +++--
>  2 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/dediprog.c b/dediprog.c
> index 72818ea..0eb84ec 100644
> --- a/dediprog.c
> +++ b/dediprog.c
> @@ -1028,7 +1028,7 @@ int dediprog_init(void)
>  			free(target_str);
>  			return 1;
>  		}
> -		if (target < 1 || target > 2) {
> +		if (target < 1 || target > 3) {
>  			msg_perr("Error: Value for 'target' is out of range.\n");
>  			free(target_str);
>  			return 1;
> @@ -1047,6 +1047,10 @@ int dediprog_init(void)
>  			msg_pinfo("Using target %s.\n", "FLASH_TYPE_APPLICATION_FLASH_2");
>  			target = FLASH_TYPE_APPLICATION_FLASH_2;
>  			break;
> +		case 3:
> +			msg_pinfo("Using target %s.\n", "FLASH_TYPE_SOCKET");
> +			target = FLASH_TYPE_SOCKET;
> +			break;

This makes a flaw in set_target_flash() obvious now. Not all programmers
have a socket. I just checked set_target_flash() silently fails with an
SF 100. So we should check for compatibility there or at the calling
site.

>  		default:
>  			break;
>  		}
> diff --git a/flashrom.8.tmpl b/flashrom.8.tmpl
> index c557af7..04fd1c8 100644
> --- a/flashrom.8.tmpl
> +++ b/flashrom.8.tmpl
> @@ -946,8 +946,9 @@ parameter specifies which target chip should be used. Syntax is
>  where
>  .B value
>  can be
> -.BR 1 " or " 2
> -to select target chip 1 or 2 respectively. The default is target chip 1.
> +.BR 1 ", " 2 " or " 3
> +to select target chip 1 or 2 respectively. The default is target chip 1. To use the programming socket

This reads confusing now (set 1, 2 or 3 to choose between 1 and 2?).

> +of the SF600 you need to select target 3.
>  .SS

Patch

From 5df0b1ff7bb95f4384c98727a56a03660dde6aaa Mon Sep 17 00:00:00 2001
From: Florian Kaiser <fkaiser@genua.de>
Date: Tue, 31 Jul 2018 13:42:22 +0200
Subject: [PATCH] dediprog: allow the use of the programming target "socket".

Change-Id: I8c5120ce2151138093be0f27951916ec7f725574
Signed-off-by: Florian Kaiser <fkaiser@genua.de>
---
 dediprog.c      | 6 +++++-
 flashrom.8.tmpl | 5 +++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/dediprog.c b/dediprog.c
index 72818ea..0eb84ec 100644
--- a/dediprog.c
+++ b/dediprog.c
@@ -1028,7 +1028,7 @@  int dediprog_init(void)
 			free(target_str);
 			return 1;
 		}
-		if (target < 1 || target > 2) {
+		if (target < 1 || target > 3) {
 			msg_perr("Error: Value for 'target' is out of range.\n");
 			free(target_str);
 			return 1;
@@ -1047,6 +1047,10 @@  int dediprog_init(void)
 			msg_pinfo("Using target %s.\n", "FLASH_TYPE_APPLICATION_FLASH_2");
 			target = FLASH_TYPE_APPLICATION_FLASH_2;
 			break;
+		case 3:
+			msg_pinfo("Using target %s.\n", "FLASH_TYPE_SOCKET");
+			target = FLASH_TYPE_SOCKET;
+			break;
 		default:
 			break;
 		}
diff --git a/flashrom.8.tmpl b/flashrom.8.tmpl
index c557af7..04fd1c8 100644
--- a/flashrom.8.tmpl
+++ b/flashrom.8.tmpl
@@ -946,8 +946,9 @@  parameter specifies which target chip should be used. Syntax is
 where
 .B value
 can be
-.BR 1 " or " 2
-to select target chip 1 or 2 respectively. The default is target chip 1.
+.BR 1 ", " 2 " or " 3
+to select target chip 1 or 2 respectively. The default is target chip 1. To use the programming socket
+of the SF600 you need to select target 3.
 .SS
 .BR "rayer_spi " programmer
 .IP
-- 
2.19.2