stlink: use common layout

Even though the stlinkv1 and stlinkv2 use different usb classes they share
the same layout scheme.

Merge the two into a common layout, thus enabling us to support other
adapter layouts.

Change-Id: I7d02c44a7f94ebc7f2cb5428b02ee40294fb430d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/918
Tested-by: jenkins
This commit is contained in:
Spencer Oliver 2012-10-15 12:34:46 +01:00
parent b7ea4a6162
commit a047d87196
4 changed files with 3 additions and 17 deletions

View File

@ -32,10 +32,6 @@
#include <jtag/stlink/stlink_transport.h>
#include <jtag/stlink/stlink_interface.h>
#define STLINK_LAYOUT_UNKNOWN 0
#define STLINK_LAYOUT_SG 1
#define STLINK_LAYOUT_USB 2
static int stlink_layout_open(struct stlink_interface_s *stlink_if)
{
int res;
@ -61,15 +57,7 @@ static int stlink_layout_close(struct stlink_interface_s *stlink_if)
static const struct stlink_layout stlink_layouts[] = {
{
.name = "usb",
.type = STLINK_LAYOUT_USB,
.open = stlink_layout_open,
.close = stlink_layout_close,
.api = &stlink_usb_layout_api,
},
{
.name = "sg",
.type = STLINK_LAYOUT_SG,
.name = "stlink",
.open = stlink_layout_open,
.close = stlink_layout_close,
.api = &stlink_usb_layout_api,

View File

@ -75,8 +75,6 @@ struct stlink_layout {
/** */
char *name;
/** */
int type;
/** */
int (*open) (struct stlink_interface_s *stlink_if);
/** */
int (*close) (struct stlink_interface_s *stlink_if);

View File

@ -3,7 +3,7 @@
#
interface stlink
stlink_layout sg
stlink_layout stlink
stlink_device_desc "ST-LINK/V1"
stlink_vid_pid 0x0483 0x3744

View File

@ -3,7 +3,7 @@
#
interface stlink
stlink_layout usb
stlink_layout stlink
stlink_device_desc "ST-LINK/V2"
stlink_vid_pid 0x0483 0x3748