Hey,

I'm trying to add some basic support for the newer DSL models so
here's a patch adding support for loading the FX2 and FPGA fimware for
the DSLogic Pro and DSCope. 

--Daniel
From 0b4a0fc0c321bae5aeb7d6c1cef8b450e4b116fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= <d...@darkboxed.org>
Date: Sun, 3 May 2015 00:31:49 +0200
Subject: [PATCH] fx2lafw: Add DSLogic Pro and DSCope firmware loading support

---
 src/hardware/fx2lafw/api.c      | 55 ++++++++++++++++++++++++++++++-----------
 src/hardware/fx2lafw/protocol.h |  2 ++
 2 files changed, 42 insertions(+), 15 deletions(-)

diff --git a/src/hardware/fx2lafw/api.c b/src/hardware/fx2lafw/api.c
index ab3345f..1c03edd 100644
--- a/src/hardware/fx2lafw/api.c
+++ b/src/hardware/fx2lafw/api.c
@@ -45,20 +45,33 @@ static const struct fx2lafw_profile supported_fx2[] = {
 		FIRMWARE_DIR "/fx2lafw-cwav-usbeesx.fw",
 		0, NULL, NULL},
 
-	/*
-	 * DreamSourceLab DSLogic (before FW upload)
-	 */
+	/* DreamSourceLab DSLogic (before FW upload) */
 	{ 0x2a0e, 0x0001, "DreamSourceLab", "DSLogic", NULL,
 		FIRMWARE_DIR "/dreamsourcelab-dslogic-fx2.fw",
 		DEV_CAPS_16BIT, NULL, NULL},
-
-	/*
-	 * DreamSourceLab DSLogic (after FW upload)
-	 */
+	/* DreamSourceLab DSLogic (after FW upload) */
 	{ 0x2a0e, 0x0001, "DreamSourceLab", "DSLogic", NULL,
 		FIRMWARE_DIR "/dreamsourcelab-dslogic-fx2.fw",
 		DEV_CAPS_16BIT, "DreamSourceLab", "DSLogic"},
 
+	/* DreamSourceLab DSCope (before FW upload) */
+	{ 0x2a0e, 0x0002, "DreamSourceLab", "DSCope", NULL,
+		FIRMWARE_DIR "/dreamsourcelab-dscope-fx2.fw",
+		DEV_CAPS_16BIT, NULL, NULL},
+	/* DreamSourceLab DSCope (after FW upload) */
+	{ 0x2a0e, 0x0002, "DreamSourceLab", "DSCope", NULL,
+		FIRMWARE_DIR "/dreamsourcelab-dscope-fx2.fw",
+		DEV_CAPS_16BIT, "DreamSourceLab", "DSCope"},
+
+	/* DreamSourceLab DSLogic Pro (before FW upload) */
+	{ 0x2a0e, 0x0003, "DreamSourceLab", "DSLogic Pro", NULL,
+		FIRMWARE_DIR "/dreamsourcelab-dslogic-pro-fx2.fw",
+		DEV_CAPS_16BIT, NULL, NULL},
+	/* DreamSourceLab DSLogic Pro (after FW upload) */
+	{ 0x2a0e, 0x0003, "DreamSourceLab", "DSLogic Pro", NULL,
+		FIRMWARE_DIR "/dreamsourcelab-dslogic-pro-fx2.fw",
+		DEV_CAPS_16BIT, "DreamSourceLab", "DSLogic"},
+
 	/*
 	 * Saleae Logic
 	 * EE Electronics ESLA100
@@ -296,18 +309,21 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 		drvc->instances = g_slist_append(drvc->instances, sdi);
 		devices = g_slist_append(devices, sdi);
 
-		if (strcmp(prof->model, "DSLogic")) {
+		if (strcmp(prof->model, "DSLogic") == 0
+			|| strcmp(prof->model, "DSLogic Pro") == 0
+			|| strcmp(prof->model, "DSCope") == 0)
+		{
+			devc->dslogic = TRUE;
+			devc->samplerates = dslogic_samplerates;
+			devc->num_samplerates = ARRAY_SIZE(dslogic_samplerates);
+			has_firmware = match_manuf_prod(devlist[i],"DreamSourceLab", "DSLogic")
+					|| match_manuf_prod(devlist[i],"DreamSourceLab", "DSCope");
+		} else {
 			devc->dslogic = FALSE;
 			devc->samplerates = samplerates;
 			devc->num_samplerates = ARRAY_SIZE(samplerates);
 			has_firmware = match_manuf_prod(devlist[i],
 					"sigrok", "fx2lafw");
-		} else {
-			devc->dslogic = TRUE;
-			devc->samplerates = dslogic_samplerates;
-			devc->num_samplerates = ARRAY_SIZE(dslogic_samplerates);
-			has_firmware = match_manuf_prod(devlist[i],
-					"DreamSourceLab", "DSLogic");
 		}
 
 		if (has_firmware) {
@@ -348,6 +364,7 @@ static int dev_open(struct sr_dev_inst *sdi)
 	struct sr_dev_driver *di = sdi->driver;
 	struct sr_usb_dev_inst *usb;
 	struct dev_context *devc;
+	char *fpga_firmware = NULL;
 	int ret;
 	int64_t timediff_us, timediff_ms;
 
@@ -408,8 +425,16 @@ static int dev_open(struct sr_dev_inst *sdi)
 	}
 
 	if (devc->dslogic) {
+		if (strcmp(devc->profile->model, "DSLogic") == 0) {
+			fpga_firmware = DSLOGIC_FPGA_FIRMWARE;
+		} else if(strcmp(devc->profile->model, "DSLogic Pro") == 0) {
+			fpga_firmware = DSLOGIC_PRO_FPGA_FIRMWARE;
+		} else if(strcmp(devc->profile->model, "DSCope") == 0) {
+			fpga_firmware = DSLOGIC_PRO_FPGA_FIRMWARE;
+		}
+
 		if ((ret = dslogic_fpga_firmware_upload(sdi,
-				DSLOGIC_FPGA_FIRMWARE)) != SR_OK)
+				fpga_firmware)) != SR_OK)
 			return ret;
 	}
 
diff --git a/src/hardware/fx2lafw/protocol.h b/src/hardware/fx2lafw/protocol.h
index c245a7a..6d72311 100644
--- a/src/hardware/fx2lafw/protocol.h
+++ b/src/hardware/fx2lafw/protocol.h
@@ -52,6 +52,8 @@
 #define DEV_CAPS_16BIT		(1 << DEV_CAPS_16BIT_POS)
 
 #define DSLOGIC_FPGA_FIRMWARE FIRMWARE_DIR "/dreamsourcelab-dslogic-fpga.fw"
+#define DSCOPE_FPGA_FIRMWARE FIRMWARE_DIR "/dreamsourcelab-dscope-fpga.fw"
+#define DSLOGIC_PRO_FPGA_FIRMWARE FIRMWARE_DIR "/dreamsourcelab-dslogic-pro-fpga.fw"
 
 /* Protocol commands */
 #define CMD_GET_FW_VERSION		0xb0
-- 
2.1.4

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to