From 5e5e8213bbd7a0167e61f1138247e7111b6ef031 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Wed, 4 May 2016 12:27:58 +0200 Subject: dediprog: Reimplement target chip option Change-Id: I594e2a6ee144260f8424d25b304f6ab41a9d3fad Signed-off-by: Nico Huber Acked-by: David Hendricks Reviewed-on: https://review.coreboot.org/19350 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- dediprog.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/dediprog.c b/dediprog.c index 019de467..b7276e53 100644 --- a/dediprog.c +++ b/dediprog.c @@ -942,7 +942,7 @@ int dediprog_init(void) int spispeed_idx = 1; int millivolt = 3500; long usedevice = 0; - long target = 1; + long target = FLASH_TYPE_APPLICATION_FLASH_1; int i, ret; spispeed = extract_programmer_param("spispeed"); @@ -1014,7 +1014,18 @@ int dediprog_init(void) free(target_str); return 1; } - msg_pinfo("Using target %li.\n", target); + switch (target) { + case 1: + msg_pinfo("Using target %s.\n", "FLASH_TYPE_APPLICATION_FLASH_1"); + target = FLASH_TYPE_APPLICATION_FLASH_1; + break; + case 2: + msg_pinfo("Using target %s.\n", "FLASH_TYPE_APPLICATION_FLASH_2"); + target = FLASH_TYPE_APPLICATION_FLASH_2; + break; + default: + break; + } } free(target_str); @@ -1073,7 +1084,7 @@ int dediprog_init(void) dediprog_set_leds(LED_ALL); /* Select target/socket, frequency and VCC. */ - if (set_target_flash(FLASH_TYPE_APPLICATION_FLASH_1) || + if (set_target_flash(target) || dediprog_set_spi_speed(spispeed_idx) || dediprog_set_spi_voltage(millivolt)) { dediprog_set_leds(LED_ERROR); -- cgit v1.2.3