)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"045de07d2516b379320942240505cc04aa2ed178","unresolved":true,"context_lines":[{"line_number":18,"context_line":"\u0027hla\u0027, and the native \u0027jtag\u0027 or \u0027swd\u0027 is a superset of the"},{"line_number":19,"context_line":"\u0027dapdirect\u0027 one."},{"line_number":20,"context_line":"While the adapter could support more than one similar transports,"},{"line_number":21,"context_line":"its adapter diver should only support the most complete transport."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Modify the \u0027transport select\u0027 code to accept \u0027jtag\u0027 or \u0027swd\u0027 for"},{"line_number":24,"context_line":"the \u0027dapdirect\u0027 and the \u0027hla\u0027 adapters too."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"bea6dbbc_57bc1448","line":21,"range":{"start_line":21,"start_character":12,"end_line":21,"end_character":17},"updated":"2024-12-30 20:56:22.000000000","message":"Typo","commit_id":"a512086784a18e060a09333468c00aea6beb0e2d"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"7ca2d744f2d7315f091bcbb3d2bdb3cf84726284","unresolved":false,"context_lines":[{"line_number":18,"context_line":"\u0027hla\u0027, and the native \u0027jtag\u0027 or \u0027swd\u0027 is a superset of the"},{"line_number":19,"context_line":"\u0027dapdirect\u0027 one."},{"line_number":20,"context_line":"While the adapter could support more than one similar transports,"},{"line_number":21,"context_line":"its adapter diver should only support the most complete transport."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Modify the \u0027transport select\u0027 code to accept \u0027jtag\u0027 or \u0027swd\u0027 for"},{"line_number":24,"context_line":"the \u0027dapdirect\u0027 and the \u0027hla\u0027 adapters too."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ffad992f_b8716845","line":21,"range":{"start_line":21,"start_character":12,"end_line":21,"end_character":17},"in_reply_to":"bea6dbbc_57bc1448","updated":"2024-12-31 16:38:10.000000000","message":"Done","commit_id":"a512086784a18e060a09333468c00aea6beb0e2d"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"045de07d2516b379320942240505cc04aa2ed178","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"9b5f1af1_6b98782d","updated":"2024-12-30 20:56:22.000000000","message":"Thanks, Antonio, this series is definitively a step forward.","commit_id":"a512086784a18e060a09333468c00aea6beb0e2d"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"7ca2d744f2d7315f091bcbb3d2bdb3cf84726284","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"f1f2fd2c_09b2bc64","updated":"2024-12-31 16:38:10.000000000","message":"Thanks for the review, Tomas.","commit_id":"5dfcc878fbc5bb7424acf8d22b95ac70b064b029"}],"src/transport/transport.c":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"045de07d2516b379320942240505cc04aa2ed178","unresolved":true,"context_lines":[{"line_number":56,"context_line":"\t[TRANSPORT_DAPDIRECT_JTAG] \u003d { \"jtag\", \"jtag (dapdirect)\", \"dapdirect_jtag\", },"},{"line_number":57,"context_line":"\t[TRANSPORT_DAPDIRECT_SWD]  \u003d { \"swd\",  \"swd (dapdirect)\",  \"dapdirect_swd\",  },"},{"line_number":58,"context_line":"\t[TRANSPORT_SWIM]           \u003d { \"swim\", \"swim\",             NULL,             },"},{"line_number":59,"context_line":"};"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"/** List of transports registered in OpenOCD. */"},{"line_number":62,"context_line":"static struct transport *transport_list;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"bf35f430_44b04579","line":59,"updated":"2024-12-30 20:56:22.000000000","message":"Before this change `transport list` displayed names which can be used as a parameter in `transport select`.\n\nNow `transport list` displays full names, without any clue which one of multiple jtag or swd variants will be selected and doesn\u0027t help if user wants to select the other variant than the default one.\n\nAlso the `transport list` output of a STLink adapter\n```\nThe following transports are available:\n        swd\n        swd (dapdirect)\n        jtag (dapdirect)\n        swim\n        jtag (hla)\n        swd (hla)\n        jtag\n```\ncould be easily misinterpreted as there were a pure swd variant besides swd (dapdirect) and swd (hla), not giving any clue that swd is only an alias for swd (dapdirect) or swd (hla) if hla adapter selected.\n\nCould we make the `transport list` more reasonable?","commit_id":"a512086784a18e060a09333468c00aea6beb0e2d"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"ae753974f2a3ff144f315b4c1d049556380c9377","unresolved":true,"context_lines":[{"line_number":56,"context_line":"\t[TRANSPORT_DAPDIRECT_JTAG] \u003d { \"jtag\", \"jtag (dapdirect)\", \"dapdirect_jtag\", },"},{"line_number":57,"context_line":"\t[TRANSPORT_DAPDIRECT_SWD]  \u003d { \"swd\",  \"swd (dapdirect)\",  \"dapdirect_swd\",  },"},{"line_number":58,"context_line":"\t[TRANSPORT_SWIM]           \u003d { \"swim\", \"swim\",             NULL,             },"},{"line_number":59,"context_line":"};"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"/** List of transports registered in OpenOCD. */"},{"line_number":62,"context_line":"static struct transport *transport_list;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"875fa6be_18d56521","line":59,"in_reply_to":"037dfdb5_c3101712","updated":"2025-01-02 16:17:32.000000000","message":"\u003e That\u0027s true. Extended `adapter list` seems me to be a good idea.\n\u003e Unfortunately it cannot verify in the adapter hw if all transports are really supported. Probably too complicated as OpenOCD cannot open adapter connection without a selected transport.\n\nMy idea is to have `adapter list` to print the transport listed in the bit-field, something like:\n```\n1: parport {jtag}\n2: dummy   {jtag}\n3: ftdi    {jtag swd}\n...\n30: st-link  {jtag swd swim}\n```\n\nwithout running a real check if the transport is functional.\n\n\u003e Maybe it would be better to return back to patchset 1 and leave `transport list` unsorted.\n\nI think `transport list` should still list the transports supported by OpenOCD, independently from the adapter. Then the output values can be feed to `transport select` and eventually refused by the adapter driver.\nThe sorted list is just to help skipping the duplications like `jtag` and `jtag (hla)`.","commit_id":"a512086784a18e060a09333468c00aea6beb0e2d"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"e87f610f79a6144100c321ff00f8d46624cb32d6","unresolved":true,"context_lines":[{"line_number":56,"context_line":"\t[TRANSPORT_DAPDIRECT_JTAG] \u003d { \"jtag\", \"jtag (dapdirect)\", \"dapdirect_jtag\", },"},{"line_number":57,"context_line":"\t[TRANSPORT_DAPDIRECT_SWD]  \u003d { \"swd\",  \"swd (dapdirect)\",  \"dapdirect_swd\",  },"},{"line_number":58,"context_line":"\t[TRANSPORT_SWIM]           \u003d { \"swim\", \"swim\",             NULL,             },"},{"line_number":59,"context_line":"};"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"/** List of transports registered in OpenOCD. */"},{"line_number":62,"context_line":"static struct transport *transport_list;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"c479abb8_5af56cec","line":59,"in_reply_to":"7d88e248_21440137","updated":"2025-01-02 15:11:44.000000000","message":"I don\u0027t like this transport code either, and some of the functionalities should go in the adapter framework.\nAny proposal for improvement is welcome.\n\nThe bit-field for the transports was in my very first implementation of this series, until I met the issue of the first transport used for auto-select.\n\nI agree on using `preferred_transport` and marking the auto-select as obsoleted.\n\nWhile we could keep auto-select for adapters that only support one transport, this will become an issue if the same adapter driver gets updated for a second transport. E.g. the new SPIDEV driver that today is SWD only, can easily be extended to cJTAG once cJTAG gets ready.\n\nPlease notice that there have never been an easy way to dump the transports allowed by an adapter. Only through the error message for transport not selected:\n`openocd -c \u0027adapter driver jlink; transport init\u0027`\nThe command `transport list` prints all transport supported by OpenOCD, independently on the adapter in use.\n\nI think we could extend the command `adapter list` to print, beside each adapter name, the list of transport the adapter supports.","commit_id":"a512086784a18e060a09333468c00aea6beb0e2d"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"7ca2d744f2d7315f091bcbb3d2bdb3cf84726284","unresolved":false,"context_lines":[{"line_number":56,"context_line":"\t[TRANSPORT_DAPDIRECT_JTAG] \u003d { \"jtag\", \"jtag (dapdirect)\", \"dapdirect_jtag\", },"},{"line_number":57,"context_line":"\t[TRANSPORT_DAPDIRECT_SWD]  \u003d { \"swd\",  \"swd (dapdirect)\",  \"dapdirect_swd\",  },"},{"line_number":58,"context_line":"\t[TRANSPORT_SWIM]           \u003d { \"swim\", \"swim\",             NULL,             },"},{"line_number":59,"context_line":"};"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"/** List of transports registered in OpenOCD. */"},{"line_number":62,"context_line":"static struct transport *transport_list;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"d60dd9af_9f3e6e00","line":59,"in_reply_to":"bf35f430_44b04579","updated":"2024-12-31 16:38:10.000000000","message":"I have added some patch to this series to register the transports in alphabetic order, so now `transport list` easily drops duplicated names.\nBut the command `transport select` still has to return the `full_name`, e.g. `swd (hla)`. This is required by the `proc using_hla` and similar to properly detect the HLA transport. I think this could be reworked, later, by adding dedicated TCL commands in place of the TCL procs `using_hla`, `using_swd` and `using_jtag`.","commit_id":"a512086784a18e060a09333468c00aea6beb0e2d"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"b8a8aedb334e3a9e88c7fe999034488ebc480779","unresolved":true,"context_lines":[{"line_number":56,"context_line":"\t[TRANSPORT_DAPDIRECT_JTAG] \u003d { \"jtag\", \"jtag (dapdirect)\", \"dapdirect_jtag\", },"},{"line_number":57,"context_line":"\t[TRANSPORT_DAPDIRECT_SWD]  \u003d { \"swd\",  \"swd (dapdirect)\",  \"dapdirect_swd\",  },"},{"line_number":58,"context_line":"\t[TRANSPORT_SWIM]           \u003d { \"swim\", \"swim\",             NULL,             },"},{"line_number":59,"context_line":"};"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"/** List of transports registered in OpenOCD. */"},{"line_number":62,"context_line":"static struct transport *transport_list;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"037dfdb5_c3101712","line":59,"in_reply_to":"c479abb8_5af56cec","updated":"2025-01-02 16:01:29.000000000","message":"\u003e While we could keep auto-select for adapters that only support one transport, this will become an issue if the same adapter driver gets updated for a second transport. E.g. the new SPIDEV driver that today is SWD only, can easily be extended to cJTAG once cJTAG gets ready.\n\u003e \nOh yes, the order of transports mostly reflects the history of driver development.\n\n\u003e Please notice that there have never been an easy way to dump the transports allowed by an adapter. Only through the error message for transport not selected:\n\u003e `openocd -c \u0027adapter driver jlink; transport init\u0027`\n\u003e The command `transport list` prints all transport supported by OpenOCD, independently on the adapter in use.\n\u003e \n\u003e I think we could extend the command `adapter list` to print, beside each adapter name, the list of transport the adapter supports.\n\nThat\u0027s true. Extended `adapter list` seems me to be a good idea.\nUnfortunately it cannot verify in the adapter hw if all transports are really supported. Probably too complicated as OpenOCD cannot open adapter connection without a selected transport.\n\nMaybe it would be better to return back to patchset 1 and leave `transport list` unsorted.","commit_id":"a512086784a18e060a09333468c00aea6beb0e2d"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"783ff77f011ed54e152a56b48bfdd8c902b74fdf","unresolved":true,"context_lines":[{"line_number":56,"context_line":"\t[TRANSPORT_DAPDIRECT_JTAG] \u003d { \"jtag\", \"jtag (dapdirect)\", \"dapdirect_jtag\", },"},{"line_number":57,"context_line":"\t[TRANSPORT_DAPDIRECT_SWD]  \u003d { \"swd\",  \"swd (dapdirect)\",  \"dapdirect_swd\",  },"},{"line_number":58,"context_line":"\t[TRANSPORT_SWIM]           \u003d { \"swim\", \"swim\",             NULL,             },"},{"line_number":59,"context_line":"};"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"/** List of transports registered in OpenOCD. */"},{"line_number":62,"context_line":"static struct transport *transport_list;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"7d88e248_21440137","line":59,"in_reply_to":"d60dd9af_9f3e6e00","updated":"2025-01-02 12:08:37.000000000","message":"Antonio,\nthe transport related code seems me somewhat overcomplicated.\n\nThe drivers store supported transports in a vector to keep particular order.\nTo validate transport we have to convert the vector to a bit-field.\nFinally `transport list` outputs sorted transports so the original order is lost.\nHowever if no transport is selected, OpenOCD informs\n```\nauto-selecting first available session transport xxx\n```\nHow could an user know which transport is the first available until he tries? By reading the adapter driver code?\n\nAnd moreover this series eliminates `transport select` dependency on used adapter.\nShouldn\u0027t we also eliminate the dependency of auto-selected transport on used adapter? E.g. without `transport select` and with JLink adapter OpenOCD prefers JTAG, however if you switch to CMSIS-DAP it changes preference to SWD. I admit it has some logic based on prevailing adapter use, but if you just change the adapter, the changed transport is an unexpected surprise.\n\nWhat if we store supported transports in the driver code as a bit-field? It would simplify most of operation with transports. To keep auto-selected transport compatible let\u0027s introduce a transport id `preferred_transport` (or another bitfield?) to `struct adapter_driver`. Also mark the transport auto-select as deprecated and encourage users to select transport on all but single transport adapters.","commit_id":"a512086784a18e060a09333468c00aea6beb0e2d"}]}
