]> git.sur5r.net Git - openocd/commitdiff
stlink: rename stlink cmd names
authorSpencer Oliver <spen@spen-soft.co.uk>
Wed, 24 Oct 2012 08:52:00 +0000 (09:52 +0100)
committerSpencer Oliver <spen@spen-soft.co.uk>
Sun, 23 Dec 2012 21:45:42 +0000 (21:45 +0000)
As part of the switch to using the hla for the stlink interface we rename
the cmds to a more generic name.

Update scripts to match new names.

Also add handlers for deprecated names.

Change-Id: I6f00743da746e3aa13ce06acfdc93c8049545e07
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/921
Tested-by: jenkins
src/jtag/hla/hla_interface.c
src/jtag/hla/hla_transport.c
src/jtag/startup.tcl
src/target/hla_target.c
src/target/target.c
tcl/interface/stlink-v1.cfg
tcl/interface/stlink-v2.cfg
tcl/target/stm32_stlink.cfg

index 397eeeae3f259778184632f638f4be6762126b1b..eb9b43dc69c07a6da827972ec59e82f119d1e345 100644 (file)
@@ -218,7 +218,7 @@ COMMAND_HANDLER(hl_interface_handle_vid_pid_command)
        return ERROR_OK;
 }
 
-COMMAND_HANDLER(hl_interface_handle_api_command)
+COMMAND_HANDLER(stlink_interface_handle_api_command)
 {
        if (CMD_ARGC != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -235,28 +235,28 @@ COMMAND_HANDLER(hl_interface_handle_api_command)
 
 static const struct command_registration hl_interface_command_handlers[] = {
        {
-        .name = "stlink_device_desc",
+        .name = "hla_device_desc",
         .handler = &hl_interface_handle_device_desc_command,
         .mode = COMMAND_CONFIG,
         .help = "set the a device description of the adapter",
         .usage = "description_string",
         },
        {
-        .name = "stlink_serial",
+        .name = "hla_serial",
         .handler = &hl_interface_handle_serial_command,
         .mode = COMMAND_CONFIG,
         .help = "set the serial number of the adapter",
         .usage = "serial_string",
         },
        {
-        .name = "stlink_layout",
+        .name = "hla_layout",
         .handler = &hl_interface_handle_layout_command,
         .mode = COMMAND_CONFIG,
         .help = "set the layout of the adapter",
         .usage = "layout_name",
         },
        {
-        .name = "stlink_vid_pid",
+        .name = "hla_vid_pid",
         .handler = &hl_interface_handle_vid_pid_command,
         .mode = COMMAND_CONFIG,
         .help = "the vendor and product ID of the adapter",
@@ -264,7 +264,7 @@ static const struct command_registration hl_interface_command_handlers[] = {
         },
         {
         .name = "stlink_api",
-        .handler = &hl_interface_handle_api_command,
+        .handler = &stlink_interface_handle_api_command,
         .mode = COMMAND_CONFIG,
         .help = "set the desired stlink api level",
         .usage = "api version 1 or 2",
@@ -273,7 +273,7 @@ static const struct command_registration hl_interface_command_handlers[] = {
 };
 
 struct jtag_interface hl_interface = {
-       .name = "stlink",
+       .name = "hla",
        .supported = 0,
        .commands = hl_interface_command_handlers,
        .transports = hl_transports,
index 177459bd3e92ac776fdc7f010683cb85f7a6f357..7d626d10516c5d735816a7d576d7e078fce73329 100644 (file)
@@ -122,9 +122,9 @@ hl_transport_jtag_subcommand_handlers[] = {
 static const struct command_registration stlink_transport_command_handlers[] = {
 
        {
-        .name = "stlink",
+        .name = "hla",
         .mode = COMMAND_ANY,
-        .help = "perform stlink actions",
+        .help = "perform hl adapter actions",
         .usage = "",
         .chain = hl_transport_stlink_subcommand_handlers,
         },
@@ -167,9 +167,9 @@ static int hl_transport_init(struct command_context *cmd_ctx)
        /* get selected transport as enum */
        tr = HL_TRANSPORT_UNKNOWN;
 
-       if (strcmp(transport->name, "stlink_swd") == 0)
+       if (strcmp(transport->name, "hla_swd") == 0)
                tr = HL_TRANSPORT_SWD;
-       else if (strcmp(transport->name, "stlink_jtag") == 0)
+       else if (strcmp(transport->name, "hla_jtag") == 0)
                tr = HL_TRANSPORT_JTAG;
        else if (strcmp(transport->name, "stlink_swim") == 0)
                tr = HL_TRANSPORT_SWIM;
@@ -201,29 +201,29 @@ static int hl_transport_select(struct command_context *ctx)
 }
 
 static struct transport hl_swd_transport = {
-       .name = "stlink_swd",
+       .name = "hla_swd",
        .select = hl_transport_select,
        .init = hl_transport_init,
 };
 
 static struct transport hl_jtag_transport = {
-       .name = "stlink_jtag",
+       .name = "hla_jtag",
        .select = hl_transport_select,
        .init = hl_transport_init,
 };
 
-static struct transport hl_swim_transport = {
+static struct transport stlink_swim_transport = {
        .name = "stlink_swim",
        .select = hl_transport_select,
        .init = hl_transport_init,
 };
 
-const char *hl_transports[] = { "stlink_swd", "stlink_jtag", "stlink_swim", NULL };
+const char *hl_transports[] = { "hla_swd", "hla_jtag", "stlink_swim", NULL };
 
 static void hl_constructor(void) __attribute__ ((constructor));
 static void hl_constructor(void)
 {
        transport_register(&hl_swd_transport);
        transport_register(&hl_jtag_transport);
-       transport_register(&hl_swim_transport);
+       transport_register(&stlink_swim_transport);
 }
index 11a79779341488001978d030fbfc0379221642eb..4153118c3a68ad2b8c0ecbce4ead0bfc485d8aff 100644 (file)
@@ -106,4 +106,30 @@ proc jtag_nsrst_assert_width args {
        eval adapter_nsrst_assert_width $args
 }
 
+# stlink migration helpers
+proc stlink_device_desc args {
+       echo "DEPRECATED! use 'hla_device_desc' not 'stlink_device_desc'"
+       eval hla_device_desc $args
+}
+
+proc stlink_serial args {
+       echo "DEPRECATED! use 'hla_serial' not 'stlink_serial'"
+       eval hla_serial $args
+}
+
+proc stlink_layout args {
+       echo "DEPRECATED! use 'hla_layout' not 'stlink_layout'"
+       eval hla_layout $args
+}
+
+proc stlink_vid_pid args {
+       echo "DEPRECATED! use 'hla_vid_pid' not 'stlink_vid_pid'"
+       eval hla_vid_pid $args
+}
+
+proc stlink args {
+       echo "DEPRECATED! use 'hla' not 'stlink'"
+       eval hla $args
+}
+
 # END MIGRATION AIDS
index 1791997a5d1171d43cd82766b6285c2d0b36651f..272c25e0526302a29ee322f91363f01d347da384 100644 (file)
@@ -771,8 +771,9 @@ static const struct command_registration adapter_command_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
-struct target_type stm32_stlink_target = {
-       .name = "stm32_stlink",
+struct target_type hla_target = {
+       .name = "hla_target",
+       .deprecated_name = "stm32_stlink",
 
        .init_target = adapter_init_target,
        .target_create = adapter_target_create,
index 026880c67f9ddfd9e7bff00808859ace8c894316..41fab1e623962eeab5dc44cb2c0328db44c4604f 100644 (file)
@@ -87,7 +87,7 @@ extern struct target_type dsp563xx_target;
 extern struct target_type dsp5680xx_target;
 extern struct target_type testee_target;
 extern struct target_type avr32_ap7k_target;
-extern struct target_type stm32_stlink_target;
+extern struct target_type hla_target;
 
 static struct target_type *target_types[] = {
        &arm7tdmi_target,
@@ -110,7 +110,7 @@ static struct target_type *target_types[] = {
        &dsp5680xx_target,
        &testee_target,
        &avr32_ap7k_target,
-       &stm32_stlink_target,
+       &hla_target,
        NULL,
 };
 
index 00031837159a882f03b1ced22462a6d6b2128e50..7f4a6720b20289f47afe39fbb8cf7450509c10fd 100644 (file)
@@ -2,10 +2,10 @@
 # STMicroelectronics ST-LINK/V1 in-circuit debugger/programmer
 #
 
-interface stlink
-stlink_layout stlink
-stlink_device_desc "ST-LINK/V1"
-stlink_vid_pid 0x0483 0x3744
+interface hla
+hla_layout stlink
+hla_device_desc "ST-LINK/V1"
+hla_vid_pid 0x0483 0x3744
 
 # unused but set to disable warnings
 adapter_khz 1000
index 25e696c6a926fc9d8085a0a0c543f4111645382f..da0a2002f9080082b6406f95b359f5be1ea5b18a 100644 (file)
@@ -2,10 +2,10 @@
 # STMicroelectronics ST-LINK/V2 in-circuit debugger/programmer
 #
 
-interface stlink
-stlink_layout stlink
-stlink_device_desc "ST-LINK/V2"
-stlink_vid_pid 0x0483 0x3748
+interface hla
+hla_layout stlink
+hla_device_desc "ST-LINK/V2"
+hla_vid_pid 0x0483 0x3748
 
 # unused but set to disable warnings
 adapter_khz 1000
index 4b8abebe07c815dc04c6b63ba82a9d635e51e38e..7dccd47302fb22e5caed13da2e052e2f48843d92 100644 (file)
@@ -25,24 +25,36 @@ if { [info exists CPUTAPID] } {
 
 if { [info exists TRANSPORT] } {
    set _TRANSPORT $TRANSPORT
-   if { $TRANSPORT == "stlink_jtag" } {
+   if { $TRANSPORT == "hla_jtag" } {
       if { [info exists CPUTAPID] == 0 } {
          # jtag requires us to use the jtag tap id
          set _CPUTAPID 0x3ba00477
       }
    }
 } else {
-   set _TRANSPORT stlink_swd
+   set _TRANSPORT hla_swd
 }
 
+# add deprecated transport name check
+if { $_TRANSPORT == "stlink_swd" } {
+       set _TRANSPORT "hla_swd"
+       echo "DEPRECATED! use 'hla_swd' transport not 'stlink_swd'"
+}
+
+if { $_TRANSPORT == "stlink_jtag" } {
+       set _TRANSPORT "hla_jtag"
+       echo "DEPRECATED! use 'hla_jtag' transport not 'stlink_jtag'"
+}
+# end deprecated checks
+
 #
-# possibles value are stlink_swd or stlink_jtag
+# possibles value are hla_swd or hla_jtag
 #
 transport select $_TRANSPORT
 
-stlink newtap $_CHIPNAME cpu -expected-id $_CPUTAPID
+hla newtap $_CHIPNAME cpu -expected-id $_CPUTAPID
 
 set _TARGETNAME $_CHIPNAME.cpu
-target create $_TARGETNAME stm32_stlink -chain-position $_TARGETNAME
+target create $_TARGETNAME hla_target -chain-position $_TARGETNAME
 
 $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0