)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b8f005c6eb3e09c0f525dafe5e8dad56917445ed","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Steve Marple \u003cstevemarple@googlemail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2022-05-04 23:13:49 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"jtag/adapter: add command \u0027adapter gpio\u0027"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Most adapters define their own commands to obtain the GPIO number and"},{"line_number":10,"context_line":"other GPIO configuration information such as chip number, output drive"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"44597eae_cd76f322","line":7,"updated":"2022-05-05 08:26:41.000000000","message":"temporarily, add a \"WIP:\" or \"RFC:\" in front of the title, so people knows this is not ready for merge","commit_id":"cff4398e51b1bfa469ada7f7c0f48dfba447277b"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"960e308a3802e4bd7cb587285d4a2ca40c44b014","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Steve Marple \u003cstevemarple@googlemail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2022-05-04 23:13:49 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"jtag/adapter: add command \u0027adapter gpio\u0027"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Most adapters define their own commands to obtain the GPIO number and"},{"line_number":10,"context_line":"other GPIO configuration information such as chip number, output drive"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"8609f1b3_6aafd4fa","line":7,"in_reply_to":"44597eae_cd76f322","updated":"2022-05-05 22:11:31.000000000","message":"Done","commit_id":"cff4398e51b1bfa469ada7f7c0f48dfba447277b"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b8f005c6eb3e09c0f525dafe5e8dad56917445ed","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"6f85d54f_817796f4","updated":"2022-05-05 08:26:41.000000000","message":"Not bad, thanks\nFew remarks that probably could help supporting multiple gpios without making the code size \u0026 complexity to explode.\nDocumentation can wait ... let\u0027s first have a stable command syntax","commit_id":"cff4398e51b1bfa469ada7f7c0f48dfba447277b"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"711b8bf588998137ab2b265e6927e47c786fb730","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"e4e08ef4_f6424df7","updated":"2022-05-04 22:23:14.000000000","message":"Setting sane initial values for the GPIO configuration is still to be done. Specifically so that gpio_num and chip_num are set to -1, but active-high should be set by default too. Suggestions are sought for the cleanest approach to doing this.\n\nThis patch covers most of the suggestions in https://review.openocd.org/c/openocd/+/6962. I think defining high-impedance (aka input mode) for an output GPIO might cause issues later with initialization so I omitted that (also struggling to think of use cases for it). For initial state I have stuck with logical values (active | inactive) as I think defining with 0 or 1 will lead to confusion when GPIOs are defined as active low.","commit_id":"cff4398e51b1bfa469ada7f7c0f48dfba447277b"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"960e308a3802e4bd7cb587285d4a2ca40c44b014","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"88aa7bdb_28f30f9c","updated":"2022-05-05 22:11:31.000000000","message":"Changes as requested. gpio and chip numbers initialized to -1 to indicate unset.","commit_id":"4d1e479b283a86cb1b838f0b395ddc67d6a9fbf7"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"2175e1a9d21b7fbfb3d2bfb0c24547ae87a35a6a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"fe2bc2e8_27373878","updated":"2022-05-06 22:22:39.000000000","message":"Thank you for your comprehensive comments.","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"140db460be28fe9f591ebcae15dd78374cdb4779","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"2fb3f4ed_1630cd34","updated":"2022-05-07 13:45:54.000000000","message":"Nice result.\nWhat do you think, is it time to try to use them for one of the drivers?","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"502e9a7b987a1e180354abf397c7645dcf90dc77","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"74732a90_e7d00cac","updated":"2022-05-07 19:49:13.000000000","message":"Thank you for you kind comments. ","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"502e9a7b987a1e180354abf397c7645dcf90dc77","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"bd359369_fcf59aed","in_reply_to":"2fb3f4ed_1630cd34","updated":"2022-05-07 19:49:13.000000000","message":"Perhaps. I should probably eat my own dogfood and start with am335xgpio. Breaking changes in that probably only affect me.\n\nHow do you suggest those changes are included? gerrit seems to favour the approach of waiting for changes to make it to master before submitting a patch that otherwise conflicts with or depends upon another change. In this case some validation of the ideas in this patch would be helpful before it ends up on master.","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"9084a046b62afbee2e1b33b77ac8c4da3e4df7cc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"aba8497f_a4fc2c1d","in_reply_to":"bd359369_fcf59aed","updated":"2022-05-17 11:51:40.000000000","message":"In your local git you should make two consecutive patches, this one as first followed by a patch that changes for example am335xgpio. Then push to gerrit the two patches in one shot with the usual\n git push origin HEAD:refs/for/master\nIn gerrit there will be the two patches collected in a series that keeps the order and the dependency.","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"6086327e03fd5079dd2b511f41d995430f3c0686","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"5407a86f_da07754a","updated":"2022-05-21 20:13:01.000000000","message":"Some thoughts about bit-banging drivers that use strings rather than numbers to identify GPIO (as raised in https://review.openocd.org/c/openocd/+/6978); the \"ft232r\" and \"ftdi\" are the obvious examples. I guess there are several possibilities.\n\n1. No change. Let those drivers carry on using their own defined commands. The ftdi driver has many additional commands anyway.\n2. Force those drivers to use a numerical scheme. That is pretty much what happens anyway inside the driver since the pins map to bits in shared registers.\n3. Store the string that was passed as the command option to gpio_num and chip_num. Allow drivers to fetch either the string value or a numerical value and conversion status.\n\nWhat are your thoughts here? How would this fit into the roadmap to implementing the \"adapter gpio\" command? The list of drivers that reference struct bitbang_interface is\n\n* am335xgpio\n* at91rm9200\n* bcm2835gpio\n* dummy (does not use GPIO so can be ignored)\n* eo93xx\n* imx_gpio\n* linuxgpiod\n* parport\n* remote_bitbang\n* sysfsgpio\n\nThen of course there is\n* ft232r\n* ftdi\n\nThat\u0027s a fair number of drivers to update and test. Worse if it has to happen twice. Do you plan that all drivers are migrated to this new \"adapter gpio\" command? Or only when significant changes to a driver are made? How does progress here fit into the roadmap for the next release?\n\nMaybe that is more questions than thoughts :-)","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"0adf9b9a53c903c7272d3c50355f7fb35e694157","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"74c2d5fe_303b8578","updated":"2022-06-11 15:03:37.000000000","message":"Sorry for taking so long time before getting back on this series.\nMinor comments below.\n\nTime to add doc and remove the rfc?","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1001987,"name":"Mike Hough","display_name":"Michael Hough","email":"dejitarujin@gmail.com","username":"dejitarujin"},"change_message_id":"c5d46fed66e4639f100cb62330918429692b2d9c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"6934bd71_1a061afe","in_reply_to":"5407a86f_da07754a","updated":"2022-05-26 17:28:52.000000000","message":"The FT232R driver will actually happily accept GPIO numbers, with strings as a more \"accessible\" backup for people who are just looking at the board. (Though its documentation does show the correlation.)\n\nThe FTDI driver seems to be... something else entirely. Relying on the MPSSE mode of those chips, it actually does not seem to be a GPIO driver at all, that\u0027s just a thing the chip can do inherently, along with SPI and I2C on those same dedicated pins.","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"0adf9b9a53c903c7272d3c50355f7fb35e694157","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"47ec706d_9d048406","in_reply_to":"6934bd71_1a061afe","updated":"2022-06-11 15:03:37.000000000","message":"Yep, let\u0027s take ftdi and ft232r out of this, for the moment.","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"dd6e9880e34b1881155f631e4fb2c3fa13745018","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"d2a03d73_a0fe9c95","in_reply_to":"74c2d5fe_303b8578","updated":"2022-06-12 22:27:52.000000000","message":"Yes, done. Also remove \"proposed\" from commit message.","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"dd6e9880e34b1881155f631e4fb2c3fa13745018","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"618fb0f7_bdcd04ee","updated":"2022-06-12 22:27:52.000000000","message":"Thank you for your review. Changes as requested except for a query on user0. Documentation adds definition of active state, as raised in https://review.openocd.org/c/openocd/+/6984","commit_id":"00bbf637ee4b35d9808e1db7d8d9fd6c4af6f2e8"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"61c2d2265ee5062870f8c6c6f018c333c7be2dcb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"c5fb0d46_915fbe80","updated":"2022-06-15 21:40:12.000000000","message":"Thanks for your review, changes made as requested.","commit_id":"072b1bf89888c94dbaa0dddbffc36e923d659d3c"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"cd1a0c17e83d62411aefbcf8a2218bdd84838ce8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"f1fabf1d_034393c5","updated":"2022-06-16 20:20:31.000000000","message":"I\u0027ve made the requested changes, thanks for reviewing.","commit_id":"c74a4ee9a5da8f7296f391f75c0b021071a521b9"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"912a2cdf53ce3b8f1cbd57ee88f1fe7ef82fdfca","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"e07feeec_d4d95783","updated":"2022-06-16 07:52:11.000000000","message":"ok. minor issue, otherwise I would have already added +1.\n\nI don\u0027t know if we will have common code in each driver that could be centralized here.\nLet\u0027s go with this, common code could be moved in this file later.","commit_id":"c74a4ee9a5da8f7296f391f75c0b021071a521b9"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"af79f38cf4d0f7869adf519f57d556c41c7dbda3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"f150e85a_aa4ea2df","updated":"2022-06-16 20:55:46.000000000","message":"For me, it\u0027s good! Thanks!\nLet\u0027s have one working driver using this, then both patches would be committed.\nThe other gpio drivers would be kind of copy/paste so, can arrive later.\nAlso the get/set command is not mandatory now.","commit_id":"d3137d1b25fab43fa478760d650b4fe6de3c4c22"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"8a81f7a8f0a43a48eeff592be4f9711f5193059b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"4122e7dc_1fd6a320","in_reply_to":"f150e85a_aa4ea2df","updated":"2022-06-17 10:09:18.000000000","message":"I found a minor problem where the init state for srst was not shown when the current GPIO configuration was printed. I\u0027ll push a new version that fixes this problem.","commit_id":"d3137d1b25fab43fa478760d650b4fe6de3c4c22"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"8a81f7a8f0a43a48eeff592be4f9711f5193059b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"20a522a7_c6247a4b","updated":"2022-06-17 10:09:18.000000000","message":"Oops. Sorry a new version was needed.","commit_id":"c32d3fc15c654220404c173838eeb9a43621da5f"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a9ac31f15edab377884019332b7fdc619ec390e9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"670a8e1b_50ceac67","updated":"2022-06-18 20:26:56.000000000","message":"thanks!","commit_id":"c32d3fc15c654220404c173838eeb9a43621da5f"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"a558279a940167564e4e57d3061dce3ce19d1b11","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":16,"id":"fb3733d8_46b6908c","updated":"2022-06-25 17:33:59.000000000","message":"Thanks for your review. Change as requested.","commit_id":"aaddc277f3ecbe4d96683740122ca2f601cda2c9"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"0988446ad318f13a7508cc9a66d4830ba976bcde","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"425a6f4a_e3caf5fb","updated":"2022-06-25 21:52:29.000000000","message":"I think we\u0027re done. Thank you for your patience.\n\nSteve","commit_id":"dad19d0359bb5bdbdb9395371933dd9501b0595a"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"4e68214b10d526b5150d521c3353d7f54bb7aa8c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"83005e6d_0b53f699","updated":"2022-06-25 20:52:35.000000000","message":"what\u0027s your ideas, now?\nTo proceed merging the series so far, or you plan some further experiment?\nEither ways are fine, for me","commit_id":"dad19d0359bb5bdbdb9395371933dd9501b0595a"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"0988446ad318f13a7508cc9a66d4830ba976bcde","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"e17a8feb_ab987b9c","in_reply_to":"83005e6d_0b53f699","updated":"2022-06-25 21:52:29.000000000","message":"I don\u0027t think there is anything obvious missing. Implementing linuxgpiod showed that pull direction should be included, which it now is. There are two working drivers so I think it is ready to merge once other developers have had opportunity to test/review the changes.\n\nI have started to migrate bcm2835gpio to use the adapter commands. There is some other remedial work to do along the way:\n  * deallocating resources;\n  * handling open-drain srst and trst drive modes which are currently ignored;\n  * restoring outputs to the state they were set to when OpenOCD started.\nI\u0027ll keep these fixes as separate commits/patchsets but to make my life easy they will be chained together. It may be a little while before those change are ready.\n\nI wrote a couple of Jim TCL test scripts to check the deprecated driver commands gave the expected results. Are they appropriate to commit somewhere, and if so, where?","commit_id":"dad19d0359bb5bdbdb9395371933dd9501b0595a"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"6d4ce2b3ca66307f1d73dccfb97a1da3dd4e7941","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":19,"id":"8961ab02_cab9329d","updated":"2022-07-04 17:42:24.000000000","message":"Unfortunately another revision was needed to fix a minor bug with GPIO initialization, and another in the TCL deprecated commands helper.\n\nAlso simplifies a few of the TCL deprecated helper commands now that I understand how to protect eval arguments which contain spaces.","commit_id":"43c684aa9b0db6475a920db12a5ca62a22000834"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"f16f2ebb17f89c9552fc625fe6146bc59738cdd0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":19,"id":"4ee36f5a_c898ea3d","updated":"2022-07-05 08:31:54.000000000","message":"Yes, I confirm the problem; thank you for the fix.\nMaybe it would have been easier to initialize the struct adapter_gpio_config gpio[] and drop adapter_driver_gpios_init(), but let\u0027s stick with this version, for the moment. It can be changed later if needed.\n\n\n","commit_id":"43c684aa9b0db6475a920db12a5ca62a22000834"}],"doc/openocd.texi":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"3e5f6e936a65fc248a99e269e73176fc594877eb","unresolved":true,"context_lines":[{"line_number":2424,"context_line":"the GPIO chip number is set in addition to the GPIO number. The configuration"},{"line_number":2425,"context_line":"options enable signals to be defined as active-high or active-low. The output"},{"line_number":2426,"context_line":"drive mode can be set to push-pull, open-drain or open-source. The initial state"},{"line_number":2427,"context_line":"for outputs may also be set. For push-pull outputs \"active\"  state means 1 for"},{"line_number":2428,"context_line":"active-high outputs and 0 for active-low outputs. For open-drain and open-source"},{"line_number":2429,"context_line":"outputs \"active\" means the driven state, so that is 0 for open-drain and 1 for"},{"line_number":2430,"context_line":"open-source. Bidirectinal signals may be initialized as an input. If the swdio"},{"line_number":2431,"context_line":"signal is buffered the buffer direction can be controlled with the swdio_dir"},{"line_number":2432,"context_line":"signal; the active state means that the buffer should be set as an output with"},{"line_number":2433,"context_line":"repect to the adapter. The command options are cumulative with later commands"}],"source_content_type":"text/x-texinfo","patch_set":9,"id":"9fb7b412_a1244bef","line":2430,"range":{"start_line":2427,"start_character":29,"end_line":2430,"end_character":12},"updated":"2022-06-13 17:08:42.000000000","message":"Understand now what you mean for active ... and it differs from what I mean. :-)\n\nConsider you have a GPIO out, you use it as push-pull, active-high, init-active. At init it is \u00271\u0027.\nSuddenly you decide to use it open-drain because you see a pull-up on the schematic. But to change it to open-drain you need to change also to init-inactive, otherwise the init state is \u00270\u0027.\nQuite tricky and unexpected.\n\nMaybe we should change some flag names and the description, but let\u0027s rationalize.\n\nWe have three values for each signal:\n- internal OpenOCD value, e.g. tck, srst, ... These follows the standard (JTAG) or some internal convention (reset asserted/deasserted);\n- end-side physical signal on the board, e.g. TCK, nSRST. This should match the internal OpenOCD value, otherwise nothing works (tck\u003d0 \u003d\u003d\u003e TCK\u003dlow, reset asserted \u003d\u003d\u003e nSRST\u003dlow);\n- value sent to the GPIO. If there is an inverter between GPIO and physical signal then OpenOCD has to invert the gpio value either in input and output. We need a flag to specify this inversion.\n\nFlag -push-pull I think it\u0027s clear/trivial.\nFlags -open-drain/-open-source do not describe the HW property of the GPIO, but say that OpenOCD has to \"emulate\" such output type on a \"true\" push-pull HW gpio that can work either in input or output.\nIn fact, in case of flag -open-drain we have to put the GPIO either \"low\" or in \"input\" (to emulate the \"floating\" state).\nIf the HW gpio is a \"true\" only output and only open-drain, we can not put it in input and we would probably get an error if we try; OpenOCD should use it with flag -push-pull, set it 0/1 and will be the HW to put it either \"low\" or \"floating\".\nShould be renamed as something like -emulate-open-source/-emulate-open-drain/-use-as-is ?\n\nFlags -active-high/-active-low should only means polarity-normal/polarity-inverted, where the inversion is for OpenOCD to compensate an external inverter.\n\nFlags -init-input/-init-internal-1/-init-internal-0 (renamed only for the discussion) should set the initial \"internal\" value for OpenOCD. This value is fixed for some signal (TDO is input, if I remember correctly TCK is -init-internal-0).","commit_id":"072b1bf89888c94dbaa0dddbffc36e923d659d3c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"3e5f6e936a65fc248a99e269e73176fc594877eb","unresolved":true,"context_lines":[{"line_number":2427,"context_line":"for outputs may also be set. For push-pull outputs \"active\"  state means 1 for"},{"line_number":2428,"context_line":"active-high outputs and 0 for active-low outputs. For open-drain and open-source"},{"line_number":2429,"context_line":"outputs \"active\" means the driven state, so that is 0 for open-drain and 1 for"},{"line_number":2430,"context_line":"open-source. Bidirectinal signals may be initialized as an input. If the swdio"},{"line_number":2431,"context_line":"signal is buffered the buffer direction can be controlled with the swdio_dir"},{"line_number":2432,"context_line":"signal; the active state means that the buffer should be set as an output with"},{"line_number":2433,"context_line":"repect to the adapter. The command options are cumulative with later commands"}],"source_content_type":"text/x-texinfo","patch_set":9,"id":"50083a94_a84c8590","line":2430,"updated":"2022-06-13 17:08:42.000000000","message":"typo s/Bidirectinal/Bidirectional/","commit_id":"072b1bf89888c94dbaa0dddbffc36e923d659d3c"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"61c2d2265ee5062870f8c6c6f018c333c7be2dcb","unresolved":false,"context_lines":[{"line_number":2427,"context_line":"for outputs may also be set. For push-pull outputs \"active\"  state means 1 for"},{"line_number":2428,"context_line":"active-high outputs and 0 for active-low outputs. For open-drain and open-source"},{"line_number":2429,"context_line":"outputs \"active\" means the driven state, so that is 0 for open-drain and 1 for"},{"line_number":2430,"context_line":"open-source. Bidirectinal signals may be initialized as an input. If the swdio"},{"line_number":2431,"context_line":"signal is buffered the buffer direction can be controlled with the swdio_dir"},{"line_number":2432,"context_line":"signal; the active state means that the buffer should be set as an output with"},{"line_number":2433,"context_line":"repect to the adapter. The command options are cumulative with later commands"}],"source_content_type":"text/x-texinfo","patch_set":9,"id":"98fefc3b_46f0d820","line":2430,"in_reply_to":"50083a94_a84c8590","updated":"2022-06-15 21:40:12.000000000","message":"Done","commit_id":"072b1bf89888c94dbaa0dddbffc36e923d659d3c"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"61c2d2265ee5062870f8c6c6f018c333c7be2dcb","unresolved":false,"context_lines":[{"line_number":2424,"context_line":"the GPIO chip number is set in addition to the GPIO number. The configuration"},{"line_number":2425,"context_line":"options enable signals to be defined as active-high or active-low. The output"},{"line_number":2426,"context_line":"drive mode can be set to push-pull, open-drain or open-source. The initial state"},{"line_number":2427,"context_line":"for outputs may also be set. For push-pull outputs \"active\"  state means 1 for"},{"line_number":2428,"context_line":"active-high outputs and 0 for active-low outputs. For open-drain and open-source"},{"line_number":2429,"context_line":"outputs \"active\" means the driven state, so that is 0 for open-drain and 1 for"},{"line_number":2430,"context_line":"open-source. Bidirectinal signals may be initialized as an input. If the swdio"},{"line_number":2431,"context_line":"signal is buffered the buffer direction can be controlled with the swdio_dir"},{"line_number":2432,"context_line":"signal; the active state means that the buffer should be set as an output with"},{"line_number":2433,"context_line":"repect to the adapter. The command options are cumulative with later commands"}],"source_content_type":"text/x-texinfo","patch_set":9,"id":"b114dc9e_0e1f8f08","line":2430,"range":{"start_line":2427,"start_character":29,"end_line":2430,"end_character":12},"in_reply_to":"9fb7b412_a1244bef","updated":"2022-06-15 21:40:12.000000000","message":"On reflection I think it is probably clearer that \"active\" means the same logic level as the polarity (\"active-high\"/active-low\"). I\u0027ll update the am335xgpio adapter implementation to use this meaning.\n\nI\u0027ll add a comment to the documentation about emulating open-drain/open-source modes. OpenOCD doesn\u0027t use the term \"emulate\" in other cases where that emulation occurs (eg \"srst_open_drain\") so I don\u0027t think it makes sense to use it here. The actual implementation  will depend on the adapter, including \"emulation\" in the option name would be confusing for architectures that do support real open-drain/source drive modes.","commit_id":"072b1bf89888c94dbaa0dddbffc36e923d659d3c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a0f18ff8de31fb65a95110be987e841a5a2150cd","unresolved":false,"context_lines":[{"line_number":2424,"context_line":"the GPIO chip number is set in addition to the GPIO number. The configuration"},{"line_number":2425,"context_line":"options enable signals to be defined as active-high or active-low. The output"},{"line_number":2426,"context_line":"drive mode can be set to push-pull, open-drain or open-source. The initial state"},{"line_number":2427,"context_line":"for outputs may also be set. For push-pull outputs \"active\"  state means 1 for"},{"line_number":2428,"context_line":"active-high outputs and 0 for active-low outputs. For open-drain and open-source"},{"line_number":2429,"context_line":"outputs \"active\" means the driven state, so that is 0 for open-drain and 1 for"},{"line_number":2430,"context_line":"open-source. Bidirectinal signals may be initialized as an input. If the swdio"},{"line_number":2431,"context_line":"signal is buffered the buffer direction can be controlled with the swdio_dir"},{"line_number":2432,"context_line":"signal; the active state means that the buffer should be set as an output with"},{"line_number":2433,"context_line":"repect to the adapter. The command options are cumulative with later commands"}],"source_content_type":"text/x-texinfo","patch_set":9,"id":"b46ed51b_8b618bb5","line":2430,"range":{"start_line":2427,"start_character":29,"end_line":2430,"end_character":12},"in_reply_to":"b114dc9e_0e1f8f08","updated":"2022-06-15 22:24:40.000000000","message":"Yes, probably \"emulation\" is not even accurate but I cannot find another term.\nAgree, should not be in the name of the option, it should be explained in the documentation.","commit_id":"072b1bf89888c94dbaa0dddbffc36e923d659d3c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"3e5f6e936a65fc248a99e269e73176fc594877eb","unresolved":true,"context_lines":[{"line_number":2431,"context_line":"signal is buffered the buffer direction can be controlled with the swdio_dir"},{"line_number":2432,"context_line":"signal; the active state means that the buffer should be set as an output with"},{"line_number":2433,"context_line":"repect to the adapter. The command options are cumulative with later commands"},{"line_number":2434,"context_line":"able to override settings defined by earlier ones. The commands two"},{"line_number":2435,"context_line":"@command{gpio led 7 -active-high} and @command{gpio led -chip 1 -active-low} are"},{"line_number":2436,"context_line":"equivalent to issuing the single command @command{gpio led 7 -chip 1"},{"line_number":2437,"context_line":"-active-low}. It is not permissible to set the drive mode or initial state for"}],"source_content_type":"text/x-texinfo","patch_set":9,"id":"665dddfa_5d754e61","line":2434,"updated":"2022-06-13 17:08:42.000000000","message":"s/The commands two/The commands sequence/ ???","commit_id":"072b1bf89888c94dbaa0dddbffc36e923d659d3c"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"61c2d2265ee5062870f8c6c6f018c333c7be2dcb","unresolved":false,"context_lines":[{"line_number":2431,"context_line":"signal is buffered the buffer direction can be controlled with the swdio_dir"},{"line_number":2432,"context_line":"signal; the active state means that the buffer should be set as an output with"},{"line_number":2433,"context_line":"repect to the adapter. The command options are cumulative with later commands"},{"line_number":2434,"context_line":"able to override settings defined by earlier ones. The commands two"},{"line_number":2435,"context_line":"@command{gpio led 7 -active-high} and @command{gpio led -chip 1 -active-low} are"},{"line_number":2436,"context_line":"equivalent to issuing the single command @command{gpio led 7 -chip 1"},{"line_number":2437,"context_line":"-active-low}. It is not permissible to set the drive mode or initial state for"}],"source_content_type":"text/x-texinfo","patch_set":9,"id":"e909b0ad_bb738131","line":2434,"in_reply_to":"665dddfa_5d754e61","updated":"2022-06-15 21:40:12.000000000","message":"How about \"The two commands ... and ... sent sequentially are equivalent ...\" ?","commit_id":"072b1bf89888c94dbaa0dddbffc36e923d659d3c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a0f18ff8de31fb65a95110be987e841a5a2150cd","unresolved":false,"context_lines":[{"line_number":2431,"context_line":"signal is buffered the buffer direction can be controlled with the swdio_dir"},{"line_number":2432,"context_line":"signal; the active state means that the buffer should be set as an output with"},{"line_number":2433,"context_line":"repect to the adapter. The command options are cumulative with later commands"},{"line_number":2434,"context_line":"able to override settings defined by earlier ones. The commands two"},{"line_number":2435,"context_line":"@command{gpio led 7 -active-high} and @command{gpio led -chip 1 -active-low} are"},{"line_number":2436,"context_line":"equivalent to issuing the single command @command{gpio led 7 -chip 1"},{"line_number":2437,"context_line":"-active-low}. It is not permissible to set the drive mode or initial state for"}],"source_content_type":"text/x-texinfo","patch_set":9,"id":"5c9ea685_6299de53","line":2434,"in_reply_to":"e909b0ad_bb738131","updated":"2022-06-15 22:24:40.000000000","message":"ok","commit_id":"072b1bf89888c94dbaa0dddbffc36e923d659d3c"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"912a2cdf53ce3b8f1cbd57ee88f1fe7ef82fdfca","unresolved":false,"context_lines":[{"line_number":2436,"context_line":""},{"line_number":2437,"context_line":"Some adapters require that the GPIO chip number is set in addition to the GPIO"},{"line_number":2438,"context_line":"number. The configuration options enable signals to be defined as active-high or"},{"line_number":2439,"context_line":"active-low. The output drive mode can be set to push-pull, open-drain or"},{"line_number":2440,"context_line":"open-source. Most adapters will have to emulate open-drain or open-source drive"},{"line_number":2441,"context_line":"modes by switching between an input and output. The initial state of outputs may"},{"line_number":2442,"context_line":"also be set, \"active\" state means 1 for active-high outputs and 0 for active-low"},{"line_number":2443,"context_line":"outputs. Bidirectional signals may also be initialized as an input. If the swdio"},{"line_number":2444,"context_line":"signal is buffered the buffer direction can be controlled with the swdio_dir"}],"source_content_type":"text/x-texinfo","patch_set":10,"id":"a7248a68_ec0dd87d","line":2441,"range":{"start_line":2439,"start_character":12,"end_line":2441,"end_character":47},"updated":"2022-06-16 07:52:11.000000000","message":"Let\u0027s keep as this, it\u0027s correct, but probably later on a dedicated chapter about open-drain/open-source emulation would be required.\nI say dedicated chapter because it should be referenced both here and for command reset_config.","commit_id":"c74a4ee9a5da8f7296f391f75c0b021071a521b9"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"912a2cdf53ce3b8f1cbd57ee88f1fe7ef82fdfca","unresolved":true,"context_lines":[{"line_number":2443,"context_line":"outputs. Bidirectional signals may also be initialized as an input. If the swdio"},{"line_number":2444,"context_line":"signal is buffered the buffer direction can be controlled with the swdio_dir"},{"line_number":2445,"context_line":"signal; the active state means that the buffer should be set as an output with"},{"line_number":2446,"context_line":"repect to the adapter. The command options are cumulative with later commands"},{"line_number":2447,"context_line":"able to override settings defined by earlier ones. The two commands"},{"line_number":2448,"context_line":"@command{gpio led 7 -active-high} and @command{gpio led -chip 1 -active-low}"},{"line_number":2449,"context_line":"sent sequentially are equivalent to issuing the single command @command{gpio led"}],"source_content_type":"text/x-texinfo","patch_set":10,"id":"53c0bc38_6d2e42be","line":2446,"updated":"2022-06-16 07:52:11.000000000","message":"s/repect/respect/","commit_id":"c74a4ee9a5da8f7296f391f75c0b021071a521b9"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"cd1a0c17e83d62411aefbcf8a2218bdd84838ce8","unresolved":false,"context_lines":[{"line_number":2443,"context_line":"outputs. Bidirectional signals may also be initialized as an input. If the swdio"},{"line_number":2444,"context_line":"signal is buffered the buffer direction can be controlled with the swdio_dir"},{"line_number":2445,"context_line":"signal; the active state means that the buffer should be set as an output with"},{"line_number":2446,"context_line":"repect to the adapter. The command options are cumulative with later commands"},{"line_number":2447,"context_line":"able to override settings defined by earlier ones. The two commands"},{"line_number":2448,"context_line":"@command{gpio led 7 -active-high} and @command{gpio led -chip 1 -active-low}"},{"line_number":2449,"context_line":"sent sequentially are equivalent to issuing the single command @command{gpio led"}],"source_content_type":"text/x-texinfo","patch_set":10,"id":"513a843e_9b8a020f","line":2446,"in_reply_to":"53c0bc38_6d2e42be","updated":"2022-06-16 20:20:31.000000000","message":"Done","commit_id":"c74a4ee9a5da8f7296f391f75c0b021071a521b9"}],"src/jtag/adapter.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b8f005c6eb3e09c0f525dafe5e8dad56917445ed","unresolved":true,"context_lines":[{"line_number":62,"context_line":"\tenum adapter_clk_mode clock_mode;"},{"line_number":63,"context_line":"\tint speed_khz;"},{"line_number":64,"context_line":"\tint rclk_fallback_speed_khz;"},{"line_number":65,"context_line":"\tstruct adaptor_gpio gpio;"},{"line_number":66,"context_line":"} adapter_config;"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"bool is_adapter_initialized(void)"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"ab02c074_eb274799","line":65,"updated":"2022-05-05 08:26:41.000000000","message":"this can be an array\n struct adapter_gpio_config gpios[GPIO_IDX_NUM];\nwhere the index is from an\n enum gpio_config_index {\n  GPIO_IDX_TDO,\n  ...\n  GPIO_IDX_NUM,\n};\nFor the moment can be an array declared in struct adapter_config. Then depending on its size we can move to on-demand allocation.","commit_id":"cff4398e51b1bfa469ada7f7c0f48dfba447277b"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"960e308a3802e4bd7cb587285d4a2ca40c44b014","unresolved":false,"context_lines":[{"line_number":62,"context_line":"\tenum adapter_clk_mode clock_mode;"},{"line_number":63,"context_line":"\tint speed_khz;"},{"line_number":64,"context_line":"\tint rclk_fallback_speed_khz;"},{"line_number":65,"context_line":"\tstruct adaptor_gpio gpio;"},{"line_number":66,"context_line":"} adapter_config;"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"bool is_adapter_initialized(void)"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"49ec8ec9_d52d49ea","line":65,"in_reply_to":"ab02c074_eb274799","updated":"2022-05-05 22:11:31.000000000","message":"Done","commit_id":"cff4398e51b1bfa469ada7f7c0f48dfba447277b"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b8f005c6eb3e09c0f525dafe5e8dad56917445ed","unresolved":true,"context_lines":[{"line_number":779,"context_line":"\t\t\t\t\t\t  (srst \u003d\u003d VALUE_DEASSERT) ? SRST_DEASSERT : SRST_ASSERT);"},{"line_number":780,"context_line":"}"},{"line_number":781,"context_line":""},{"line_number":782,"context_line":"static struct adapter_gpio_config *get_gpio_config(const char *signal_name)"},{"line_number":783,"context_line":"{"},{"line_number":784,"context_line":"\tif (strcmp(signal_name, \"tdo\") \u003d\u003d 0)"},{"line_number":785,"context_line":"\t\treturn \u0026adapter_config.gpio.tdo;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"99eeb3de_7745e617","line":782,"updated":"2022-05-05 08:26:41.000000000","message":"in the idea of going to gpio array, this can be converted in a mapper from \"char *\" to \"enum gpio_config_index\"\nThe signal_name could be described in a mapper that includes the type input, output, bidir, ...:\n struct gpio_map {\n   enum gpio_config_index idx;\n   enum gpio_type;\n   const char *name;\n } gpio_map[] \u003d {\n   { GPIO_IDX_TDO, GPIO_TYPE_INPUT, \"tdo\", },\n   ...\n };","commit_id":"cff4398e51b1bfa469ada7f7c0f48dfba447277b"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"960e308a3802e4bd7cb587285d4a2ca40c44b014","unresolved":false,"context_lines":[{"line_number":779,"context_line":"\t\t\t\t\t\t  (srst \u003d\u003d VALUE_DEASSERT) ? SRST_DEASSERT : SRST_ASSERT);"},{"line_number":780,"context_line":"}"},{"line_number":781,"context_line":""},{"line_number":782,"context_line":"static struct adapter_gpio_config *get_gpio_config(const char *signal_name)"},{"line_number":783,"context_line":"{"},{"line_number":784,"context_line":"\tif (strcmp(signal_name, \"tdo\") \u003d\u003d 0)"},{"line_number":785,"context_line":"\t\treturn \u0026adapter_config.gpio.tdo;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"bd7cc920_ed473400","line":782,"in_reply_to":"99eeb3de_7745e617","updated":"2022-05-05 22:11:31.000000000","message":"Done","commit_id":"cff4398e51b1bfa469ada7f7c0f48dfba447277b"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b8f005c6eb3e09c0f525dafe5e8dad56917445ed","unresolved":true,"context_lines":[{"line_number":946,"context_line":"\tCOMMAND_REGISTRATION_DONE"},{"line_number":947,"context_line":"};"},{"line_number":948,"context_line":""},{"line_number":949,"context_line":"static const struct command_registration adapter_gpio_name_handlers[] \u003d {"},{"line_number":950,"context_line":"\t{"},{"line_number":951,"context_line":"\t\t.name \u003d \"tdo\","},{"line_number":952,"context_line":"\t\t.handler \u003d adapter_gpio_input_config_handler,"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"041eaf43_75e19453","line":949,"updated":"2022-05-05 08:26:41.000000000","message":"we can avoid adding one command per signal.\nA single handler could manage all using ARGV[0] for signal name\nThe direction is detected from the name and will be used for rejecting flags that are not valid (e.g. -push-pull for an input).\nIt could be also nice to have \"adapter gpio\" without any parameter to dump the status of all configured GPIO, and \"adapter gpio tdo\" to only dump this GPIO, if configured. But this feature can be added later","commit_id":"cff4398e51b1bfa469ada7f7c0f48dfba447277b"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"960e308a3802e4bd7cb587285d4a2ca40c44b014","unresolved":false,"context_lines":[{"line_number":946,"context_line":"\tCOMMAND_REGISTRATION_DONE"},{"line_number":947,"context_line":"};"},{"line_number":948,"context_line":""},{"line_number":949,"context_line":"static const struct command_registration adapter_gpio_name_handlers[] \u003d {"},{"line_number":950,"context_line":"\t{"},{"line_number":951,"context_line":"\t\t.name \u003d \"tdo\","},{"line_number":952,"context_line":"\t\t.handler \u003d adapter_gpio_input_config_handler,"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"852c1705_665510b9","line":949,"in_reply_to":"041eaf43_75e19453","updated":"2022-05-05 22:11:31.000000000","message":"Dumping the configuration is a nice idea. I\u0027ve added that now - it was helpful when testing to check I saw the expected behaviour.","commit_id":"cff4398e51b1bfa469ada7f7c0f48dfba447277b"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a7d8f426c8fae6e4926b20a64110696cbcc7ab9d","unresolved":true,"context_lines":[{"line_number":52,"context_line":"\t\t[ADAPTER_GPIO_IDX_TDO] \u003d {"},{"line_number":53,"context_line":"\t\t\t.gpio_num \u003d -1,"},{"line_number":54,"context_line":"\t\t\t.chip_num \u003d -1,"},{"line_number":55,"context_line":"\t\t},"},{"line_number":56,"context_line":"\t\t[ADAPTER_GPIO_IDX_LED] \u003d {"},{"line_number":57,"context_line":"\t\t\t.gpio_num \u003d -1,"},{"line_number":58,"context_line":"\t\t\t.chip_num \u003d -1,"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"186f0f40_84b4a07d","line":55,"updated":"2022-05-06 15:43:12.000000000","message":"to avoid this initialization that will become long and will generate issues if a developer adds a new gpio (e.g. \"led2\") and forget this initialization, add to struct adapter_gpio_config a field bool is_configured, then below in adapter_gpio_config_handler() ...","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"2175e1a9d21b7fbfb3d2bfb0c24547ae87a35a6a","unresolved":false,"context_lines":[{"line_number":52,"context_line":"\t\t[ADAPTER_GPIO_IDX_TDO] \u003d {"},{"line_number":53,"context_line":"\t\t\t.gpio_num \u003d -1,"},{"line_number":54,"context_line":"\t\t\t.chip_num \u003d -1,"},{"line_number":55,"context_line":"\t\t},"},{"line_number":56,"context_line":"\t\t[ADAPTER_GPIO_IDX_LED] \u003d {"},{"line_number":57,"context_line":"\t\t\t.gpio_num \u003d -1,"},{"line_number":58,"context_line":"\t\t\t.chip_num \u003d -1,"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"a0bf481e_51b39310","line":55,"in_reply_to":"186f0f40_84b4a07d","updated":"2022-05-06 22:22:39.000000000","message":"That struct has a field adapter_initialized so for clarity I\u0027ve used gpios_initialized.","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a7d8f426c8fae6e4926b20a64110696cbcc7ab9d","unresolved":true,"context_lines":[{"line_number":779,"context_line":"\tenum adapter_gpio_direction direction;"},{"line_number":780,"context_line":"\tconst char *name;"},{"line_number":781,"context_line":"} gpio_map[ADAPTER_GPIO_IDX_NUM] \u003d {"},{"line_number":782,"context_line":"\t{ ADAPTER_GPIO_IDX_TDO, ADAPTER_GPIO_DIRECTION_INPUT, \"tdo\", },"},{"line_number":783,"context_line":"\t{ ADAPTER_GPIO_IDX_LED, ADAPTER_GPIO_DIRECTION_OUTPUT, \"led\", },"},{"line_number":784,"context_line":"};"},{"line_number":785,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"4eefd6ab_a617e583","line":782,"updated":"2022-05-06 15:43:12.000000000","message":"I think that also here we can use ADAPTER_GPIO_IDX_xx as array\u0027s index:\n [ADAPTER_GPIO_IDX_TDO] \u003d {\"tdo\", ADAPTER_GPIO_DIRECTION_INPUT, },\neven if, due to struct alignment, on 64 bit PC the array size will remain the same.","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"2175e1a9d21b7fbfb3d2bfb0c24547ae87a35a6a","unresolved":false,"context_lines":[{"line_number":779,"context_line":"\tenum adapter_gpio_direction direction;"},{"line_number":780,"context_line":"\tconst char *name;"},{"line_number":781,"context_line":"} gpio_map[ADAPTER_GPIO_IDX_NUM] \u003d {"},{"line_number":782,"context_line":"\t{ ADAPTER_GPIO_IDX_TDO, ADAPTER_GPIO_DIRECTION_INPUT, \"tdo\", },"},{"line_number":783,"context_line":"\t{ ADAPTER_GPIO_IDX_LED, ADAPTER_GPIO_DIRECTION_OUTPUT, \"led\", },"},{"line_number":784,"context_line":"};"},{"line_number":785,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"45840cea_2db71c79","line":782,"in_reply_to":"4eefd6ab_a617e583","updated":"2022-05-06 22:22:39.000000000","message":"Done","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a7d8f426c8fae6e4926b20a64110696cbcc7ab9d","unresolved":true,"context_lines":[{"line_number":783,"context_line":"\t{ ADAPTER_GPIO_IDX_LED, ADAPTER_GPIO_DIRECTION_OUTPUT, \"led\", },"},{"line_number":784,"context_line":"};"},{"line_number":785,"context_line":""},{"line_number":786,"context_line":"static const struct gpio_map *get_gpio_map_entry(const char *signal_name)"},{"line_number":787,"context_line":"{"},{"line_number":788,"context_line":"\tfor (int i \u003d 0; i \u003c ADAPTER_GPIO_IDX_NUM; ++i) {"},{"line_number":789,"context_line":"\t\tif (strcmp(gpio_map[i].name, signal_name) \u003d\u003d 0)"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"50f143c2_f97afd98","line":786,"updated":"2022-05-06 15:43:12.000000000","message":"and here return index of gpio_map or -1\nDon\u0027t return \u0027enum adapter_gpio_config_index\u0027, because of the error case -1","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"2175e1a9d21b7fbfb3d2bfb0c24547ae87a35a6a","unresolved":false,"context_lines":[{"line_number":783,"context_line":"\t{ ADAPTER_GPIO_IDX_LED, ADAPTER_GPIO_DIRECTION_OUTPUT, \"led\", },"},{"line_number":784,"context_line":"};"},{"line_number":785,"context_line":""},{"line_number":786,"context_line":"static const struct gpio_map *get_gpio_map_entry(const char *signal_name)"},{"line_number":787,"context_line":"{"},{"line_number":788,"context_line":"\tfor (int i \u003d 0; i \u003c ADAPTER_GPIO_IDX_NUM; ++i) {"},{"line_number":789,"context_line":"\t\tif (strcmp(gpio_map[i].name, signal_name) \u003d\u003d 0)"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"989b2c5e_ec3450d9","line":786,"in_reply_to":"50f143c2_f97afd98","updated":"2022-05-06 22:22:39.000000000","message":"Done","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a7d8f426c8fae6e4926b20a64110696cbcc7ab9d","unresolved":true,"context_lines":[{"line_number":815,"context_line":"\t\t\t drive \u003d \"unknown\";"},{"line_number":816,"context_line":"\t\t\t break;"},{"line_number":817,"context_line":"\t\t};"},{"line_number":818,"context_line":"\t\tconst char *init_state \u003d gpio_config-\u003einit_active ? \"active\" : \"inactive\";"},{"line_number":819,"context_line":"\t\tcommand_print(CMD, \"adapter gpio %s (output): num %d, chip %d, active-%s, %s, init-state %s\","},{"line_number":820,"context_line":"\t\t\tmap_entry-\u003ename, gpio_config-\u003egpio_num, gpio_config-\u003echip_num, active_state,"},{"line_number":821,"context_line":"\t\t\tdrive, init_state);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"183397d3_60aad4a3","line":818,"updated":"2022-05-06 15:43:12.000000000","message":"not clear how you plan to use active/inactive. I will wait and see.\nIn my suggestion I though about how the gpio should be initialized at OpenOCD\u0027s \"init\", before the adapter starts using it; something like initial or steady state of the gpio (0|1|high-z|input). But this can be seen later.","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"2175e1a9d21b7fbfb3d2bfb0c24547ae87a35a6a","unresolved":false,"context_lines":[{"line_number":815,"context_line":"\t\t\t drive \u003d \"unknown\";"},{"line_number":816,"context_line":"\t\t\t break;"},{"line_number":817,"context_line":"\t\t};"},{"line_number":818,"context_line":"\t\tconst char *init_state \u003d gpio_config-\u003einit_active ? \"active\" : \"inactive\";"},{"line_number":819,"context_line":"\t\tcommand_print(CMD, \"adapter gpio %s (output): num %d, chip %d, active-%s, %s, init-state %s\","},{"line_number":820,"context_line":"\t\t\tmap_entry-\u003ename, gpio_config-\u003egpio_num, gpio_config-\u003echip_num, active_state,"},{"line_number":821,"context_line":"\t\t\tdrive, init_state);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"8b170a16_dbfc2280","line":818,"in_reply_to":"183397d3_60aad4a3","updated":"2022-05-06 22:22:39.000000000","message":"This is equivalent but I think using a logical description of the signals at the adapter layer, which are mapped to the physical electrical values in the driver might be more meaningful. So a GPIO defined as \"-push-pull -active-low -init-state inactive\" is initialized with the value int(active_state ^ active_low).\n\nFor -open-drain and-open-source outputs I think that inactive means the undriven/relaxed value (ie when direction is an input). high-z or input options are not compatible with push-pull outputs but validation has to wait until \"init\".","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"140db460be28fe9f591ebcae15dd78374cdb4779","unresolved":false,"context_lines":[{"line_number":815,"context_line":"\t\t\t drive \u003d \"unknown\";"},{"line_number":816,"context_line":"\t\t\t break;"},{"line_number":817,"context_line":"\t\t};"},{"line_number":818,"context_line":"\t\tconst char *init_state \u003d gpio_config-\u003einit_active ? \"active\" : \"inactive\";"},{"line_number":819,"context_line":"\t\tcommand_print(CMD, \"adapter gpio %s (output): num %d, chip %d, active-%s, %s, init-state %s\","},{"line_number":820,"context_line":"\t\t\tmap_entry-\u003ename, gpio_config-\u003egpio_num, gpio_config-\u003echip_num, active_state,"},{"line_number":821,"context_line":"\t\t\tdrive, init_state);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"c9414894_a4d9126b","line":818,"in_reply_to":"8b170a16_dbfc2280","updated":"2022-05-07 13:45:54.000000000","message":"what about bidirectional signals like SWDIO? The initial condition has 3 possible states.\nHumm, SWD uses a \"start bit\" that is high level, so the low level output or the input should be used as initial state for SWDIO. But this is also a pin used for TMS ...\nAnyway the key point is to make it clear in the documentation (once added), so user don\u0027t get surprises. And if later something does not fit some specific case it can be modified","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"502e9a7b987a1e180354abf397c7645dcf90dc77","unresolved":false,"context_lines":[{"line_number":815,"context_line":"\t\t\t drive \u003d \"unknown\";"},{"line_number":816,"context_line":"\t\t\t break;"},{"line_number":817,"context_line":"\t\t};"},{"line_number":818,"context_line":"\t\tconst char *init_state \u003d gpio_config-\u003einit_active ? \"active\" : \"inactive\";"},{"line_number":819,"context_line":"\t\tcommand_print(CMD, \"adapter gpio %s (output): num %d, chip %d, active-%s, %s, init-state %s\","},{"line_number":820,"context_line":"\t\t\tmap_entry-\u003ename, gpio_config-\u003egpio_num, gpio_config-\u003echip_num, active_state,"},{"line_number":821,"context_line":"\t\t\tdrive, init_state);"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"0aafe603_559c757f","line":818,"in_reply_to":"c9414894_a4d9126b","updated":"2022-05-07 19:49:13.000000000","message":"I\u0027m expecting that the TMS pin and SWDIO pin will have separate configurations, and which one gets applied will depend on transport_is_jtag() / transport_is_swd(). However the bidirectional nature of SWDIO means that I will expand enum adapter_gpio_direction to include ADAPTER_GPIO_DIRECTION_BIDIRECTIONAL. Perhaps init_state needs some changes too. Maybe that will be clearer when I apply this with a real driver.\n\nThe SWDIO pin initialization is further complicated when a buffer is used. Input/output mode should then follow the direction implied by the init_state of the buffer. It concerns me that the logic for initialization will have to live in each and every driver. The initialization is hard to generalise so it probably needs to be this way. When it comes to driving the signals then the logic dealing with active-high/low signals can (and probably should) be handled higher up in bitbang.c. I\u0027m not familiar with the non-bit-banging methods to know if they can be handled similarly.","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a7d8f426c8fae6e4926b20a64110696cbcc7ab9d","unresolved":true,"context_lines":[{"line_number":826,"context_line":"COMMAND_HANDLER(helper_adapter_gpio_print_all_configs)"},{"line_number":827,"context_line":"{"},{"line_number":828,"context_line":"\tint i;"},{"line_number":829,"context_line":"\tfor (i \u003d 0; i \u003c ADAPTER_GPIO_IDX_NUM; ++i)"},{"line_number":830,"context_line":"\t\tCALL_COMMAND_HANDLER(helper_adapter_gpio_print_config, \u0026(gpio_map[i]));"},{"line_number":831,"context_line":"\treturn ERROR_OK;"},{"line_number":832,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"38800c37_9bf784d3","line":829,"updated":"2022-05-06 15:43:12.000000000","message":"move the declaration in the statement\n for (int i \u003d 0; ...)","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"2175e1a9d21b7fbfb3d2bfb0c24547ae87a35a6a","unresolved":false,"context_lines":[{"line_number":826,"context_line":"COMMAND_HANDLER(helper_adapter_gpio_print_all_configs)"},{"line_number":827,"context_line":"{"},{"line_number":828,"context_line":"\tint i;"},{"line_number":829,"context_line":"\tfor (i \u003d 0; i \u003c ADAPTER_GPIO_IDX_NUM; ++i)"},{"line_number":830,"context_line":"\t\tCALL_COMMAND_HANDLER(helper_adapter_gpio_print_config, \u0026(gpio_map[i]));"},{"line_number":831,"context_line":"\treturn ERROR_OK;"},{"line_number":832,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"348dc03c_62303eb6","line":829,"in_reply_to":"38800c37_9bf784d3","updated":"2022-05-06 22:22:39.000000000","message":"Done","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a7d8f426c8fae6e4926b20a64110696cbcc7ab9d","unresolved":true,"context_lines":[{"line_number":831,"context_line":"\treturn ERROR_OK;"},{"line_number":832,"context_line":"}"},{"line_number":833,"context_line":""},{"line_number":834,"context_line":"COMMAND_HELPER(helper_adapter_gpio_options, unsigned int *i, const struct gpio_map *map_entry,"},{"line_number":835,"context_line":"\tstruct adapter_gpio_config *gpio_config)"},{"line_number":836,"context_line":"{"},{"line_number":837,"context_line":"\tconst char *opt \u003d CMD_ARGV[*i];"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"322c9bc4_e24e030b","line":834,"updated":"2022-05-06 15:43:12.000000000","message":"I think it can be more readable if this function is expanded inline in the loop that calls it.\nIf makes stuff more readable, it\u0027s also be possible to use\n while (CMD_ARGC) {\n   ...\n   CMD_ARGC--;\n   CMD_ARGV++;\n   ...\n   CMD_ARGC -\u003d 2;\n   CMD_ARGV +\u003d 2;\n   ...\n }","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"2175e1a9d21b7fbfb3d2bfb0c24547ae87a35a6a","unresolved":false,"context_lines":[{"line_number":831,"context_line":"\treturn ERROR_OK;"},{"line_number":832,"context_line":"}"},{"line_number":833,"context_line":""},{"line_number":834,"context_line":"COMMAND_HELPER(helper_adapter_gpio_options, unsigned int *i, const struct gpio_map *map_entry,"},{"line_number":835,"context_line":"\tstruct adapter_gpio_config *gpio_config)"},{"line_number":836,"context_line":"{"},{"line_number":837,"context_line":"\tconst char *opt \u003d CMD_ARGV[*i];"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"1ca2df33_cbd6daed","line":834,"in_reply_to":"322c9bc4_e24e030b","updated":"2022-05-06 22:22:39.000000000","message":"Done","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a7d8f426c8fae6e4926b20a64110696cbcc7ab9d","unresolved":true,"context_lines":[{"line_number":916,"context_line":"\t\treturn ERROR_OK;"},{"line_number":917,"context_line":"\t}"},{"line_number":918,"context_line":""},{"line_number":919,"context_line":"\tgpio_config \u003d \u0026(adapter_config.gpios[map_entry-\u003eidx]);"},{"line_number":920,"context_line":"\twhile (i \u003c CMD_ARGC) {"},{"line_number":921,"context_line":"\t\tLOG_DEBUG(\"Processing %s\", CMD_ARGV[i]);"},{"line_number":922,"context_line":"\t\tif (isdigit(*CMD_ARGV[i])) {"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"24e6321e_0403ae22","line":919,"updated":"2022-05-06 15:43:12.000000000","message":"... continuation from above:\n if (!gpio_config-\u003eis_configured) {\n   gpio_config-\u003eis_configured \u003d true;\n   gpio_config-\u003egpio_num \u003d -1;\n   gpio_config-\u003echip_num \u003d -1;\n }","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"2175e1a9d21b7fbfb3d2bfb0c24547ae87a35a6a","unresolved":false,"context_lines":[{"line_number":916,"context_line":"\t\treturn ERROR_OK;"},{"line_number":917,"context_line":"\t}"},{"line_number":918,"context_line":""},{"line_number":919,"context_line":"\tgpio_config \u003d \u0026(adapter_config.gpios[map_entry-\u003eidx]);"},{"line_number":920,"context_line":"\twhile (i \u003c CMD_ARGC) {"},{"line_number":921,"context_line":"\t\tLOG_DEBUG(\"Processing %s\", CMD_ARGV[i]);"},{"line_number":922,"context_line":"\t\tif (isdigit(*CMD_ARGV[i])) {"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"ea37791b_4ec27deb","line":919,"in_reply_to":"24e6321e_0403ae22","updated":"2022-05-06 22:22:39.000000000","message":"I\u0027ve moved the initialization slightly earlier so that it has completed before the print versions of \"adapter gpio\" can run.","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a7d8f426c8fae6e4926b20a64110696cbcc7ab9d","unresolved":true,"context_lines":[{"line_number":1062,"context_line":"\t\t.mode \u003d COMMAND_CONFIG,"},{"line_number":1063,"context_line":"\t\t.help \u003d \"gpio adapter command group\","},{"line_number":1064,"context_line":"\t\t.usage \u003d \"led|tdo \""},{"line_number":1065,"context_line":"\t\t\t\"[number] \""},{"line_number":1066,"context_line":"\t\t\t\"[-chip chip_number] \""},{"line_number":1067,"context_line":"\t\t\t\"[-active-high|-active-low] \""},{"line_number":1068,"context_line":"\t\t\t\"[-push-pull|-open-drain|-open-source] \""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"4ed16077_24b6f58e","line":1065,"updated":"2022-05-06 15:43:12.000000000","message":"[gpio_number]","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"2175e1a9d21b7fbfb3d2bfb0c24547ae87a35a6a","unresolved":false,"context_lines":[{"line_number":1062,"context_line":"\t\t.mode \u003d COMMAND_CONFIG,"},{"line_number":1063,"context_line":"\t\t.help \u003d \"gpio adapter command group\","},{"line_number":1064,"context_line":"\t\t.usage \u003d \"led|tdo \""},{"line_number":1065,"context_line":"\t\t\t\"[number] \""},{"line_number":1066,"context_line":"\t\t\t\"[-chip chip_number] \""},{"line_number":1067,"context_line":"\t\t\t\"[-active-high|-active-low] \""},{"line_number":1068,"context_line":"\t\t\t\"[-push-pull|-open-drain|-open-source] \""}],"source_content_type":"text/x-csrc","patch_set":3,"id":"83772dcf_6175f501","line":1065,"in_reply_to":"4ed16077_24b6f58e","updated":"2022-05-06 22:22:39.000000000","message":"Done","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a7d8f426c8fae6e4926b20a64110696cbcc7ab9d","unresolved":true,"context_lines":[{"line_number":1106,"context_line":"}"},{"line_number":1107,"context_line":""},{"line_number":1108,"context_line":"/* Allow drivers access to the GPIO configuration */"},{"line_number":1109,"context_line":"const struct adapter_gpio_config *adapter_get_gpio_config(enum adapter_gpio_config_index idx)"},{"line_number":1110,"context_line":"{"},{"line_number":1111,"context_line":"\tfor (int i \u003d 0; i \u003c ADAPTER_GPIO_IDX_NUM; ++i) {"},{"line_number":1112,"context_line":"\t\tif (gpio_map[i].idx \u003d\u003d idx)"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"de7e0327_800c874a","line":1109,"updated":"2022-05-06 15:43:12.000000000","message":"if we always only use the index, this function becomes\n return \u0026gpio_map[idx];\nDoes drivers need to use gpio_map[i]?","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"2175e1a9d21b7fbfb3d2bfb0c24547ae87a35a6a","unresolved":false,"context_lines":[{"line_number":1106,"context_line":"}"},{"line_number":1107,"context_line":""},{"line_number":1108,"context_line":"/* Allow drivers access to the GPIO configuration */"},{"line_number":1109,"context_line":"const struct adapter_gpio_config *adapter_get_gpio_config(enum adapter_gpio_config_index idx)"},{"line_number":1110,"context_line":"{"},{"line_number":1111,"context_line":"\tfor (int i \u003d 0; i \u003c ADAPTER_GPIO_IDX_NUM; ++i) {"},{"line_number":1112,"context_line":"\t\tif (gpio_map[i].idx \u003d\u003d idx)"}],"source_content_type":"text/x-csrc","patch_set":3,"id":"26b4b05f_f7c5b1ab","line":1109,"in_reply_to":"de7e0327_800c874a","updated":"2022-05-06 22:22:39.000000000","message":"I had used the wrong array. Some of the defensive coding can be removed now that the arrays use designated initializers for array elements.","commit_id":"c5952d8ee4f4ecefaa4e534e65f26a99ef8df397"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"140db460be28fe9f591ebcae15dd78374cdb4779","unresolved":true,"context_lines":[{"line_number":47,"context_line":"\tint speed_khz;"},{"line_number":48,"context_line":"\tint rclk_fallback_speed_khz;"},{"line_number":49,"context_line":"\tstruct adapter_gpio_config gpios[ADAPTER_GPIO_IDX_NUM];"},{"line_number":50,"context_line":"\tbool gpios_initialized; /* Initialization of GPIOs to their unset values performed at run time */"},{"line_number":51,"context_line":"} adapter_config;"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"bool is_adapter_initialized(void)"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"16cd7b38_36f29f2e","line":50,"updated":"2022-05-07 13:45:54.000000000","message":"I\u0027m more biased towards a per-gpio flag, so the uninitialized flags also means user don\u0027t plan to use that gpio and during print it can have uninitialized label.\nBut the same info is from gpio_num\u003d\u003d-1!\nLet\u0027s keep as is, for now.","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"502e9a7b987a1e180354abf397c7645dcf90dc77","unresolved":false,"context_lines":[{"line_number":47,"context_line":"\tint speed_khz;"},{"line_number":48,"context_line":"\tint rclk_fallback_speed_khz;"},{"line_number":49,"context_line":"\tstruct adapter_gpio_config gpios[ADAPTER_GPIO_IDX_NUM];"},{"line_number":50,"context_line":"\tbool gpios_initialized; /* Initialization of GPIOs to their unset values performed at run time */"},{"line_number":51,"context_line":"} adapter_config;"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"bool is_adapter_initialized(void)"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"f50a52b2_cee149db","line":50,"in_reply_to":"16cd7b38_36f29f2e","updated":"2022-05-07 19:49:13.000000000","message":"Done","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"502e9a7b987a1e180354abf397c7645dcf90dc77","unresolved":false,"context_lines":[{"line_number":47,"context_line":"\tint speed_khz;"},{"line_number":48,"context_line":"\tint rclk_fallback_speed_khz;"},{"line_number":49,"context_line":"\tstruct adapter_gpio_config gpios[ADAPTER_GPIO_IDX_NUM];"},{"line_number":50,"context_line":"\tbool gpios_initialized; /* Initialization of GPIOs to their unset values performed at run time */"},{"line_number":51,"context_line":"} adapter_config;"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"bool is_adapter_initialized(void)"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"f5d92808_ca06feeb","line":50,"in_reply_to":"16cd7b38_36f29f2e","updated":"2022-05-07 19:49:13.000000000","message":"Done","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"140db460be28fe9f591ebcae15dd78374cdb4779","unresolved":true,"context_lines":[{"line_number":783,"context_line":""},{"line_number":784,"context_line":"COMMAND_HELPER(helper_adapter_gpio_print_config, enum adapter_gpio_config_index gpio_idx)"},{"line_number":785,"context_line":"{"},{"line_number":786,"context_line":"\tstruct adapter_gpio_config *gpio_config \u003d \u0026(adapter_config.gpios[gpio_idx]);"},{"line_number":787,"context_line":"\tconst char *active_state \u003d gpio_config-\u003eactive_low ? \"low\" : \"high\";"},{"line_number":788,"context_line":"\tif (gpio_map[gpio_idx].direction \u003d\u003d ADAPTER_GPIO_DIRECTION_INPUT) {"},{"line_number":789,"context_line":"\t\tcommand_print(CMD, \"adapter gpio %s (input): num %d, chip %d, active-%s\","}],"source_content_type":"text/x-csrc","patch_set":4,"id":"935d741b_92532d8b","line":786,"updated":"2022-05-07 13:45:54.000000000","message":"parenthesis are not needed:\n ... \u003d \u0026adapter_config.gpios[gpio_idx];","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"502e9a7b987a1e180354abf397c7645dcf90dc77","unresolved":false,"context_lines":[{"line_number":783,"context_line":""},{"line_number":784,"context_line":"COMMAND_HELPER(helper_adapter_gpio_print_config, enum adapter_gpio_config_index gpio_idx)"},{"line_number":785,"context_line":"{"},{"line_number":786,"context_line":"\tstruct adapter_gpio_config *gpio_config \u003d \u0026(adapter_config.gpios[gpio_idx]);"},{"line_number":787,"context_line":"\tconst char *active_state \u003d gpio_config-\u003eactive_low ? \"low\" : \"high\";"},{"line_number":788,"context_line":"\tif (gpio_map[gpio_idx].direction \u003d\u003d ADAPTER_GPIO_DIRECTION_INPUT) {"},{"line_number":789,"context_line":"\t\tcommand_print(CMD, \"adapter gpio %s (input): num %d, chip %d, active-%s\","}],"source_content_type":"text/x-csrc","patch_set":4,"id":"59e8cb05_43324fe7","line":786,"in_reply_to":"935d741b_92532d8b","updated":"2022-05-07 19:49:13.000000000","message":"Done","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"140db460be28fe9f591ebcae15dd78374cdb4779","unresolved":true,"context_lines":[{"line_number":847,"context_line":"\t\treturn ERROR_OK;"},{"line_number":848,"context_line":"\t}"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"\tgpio_config \u003d \u0026(adapter_config.gpios[gpio_idx]);"},{"line_number":851,"context_line":"\twhile (i \u003c CMD_ARGC) {"},{"line_number":852,"context_line":"\t\tLOG_DEBUG(\"Processing %s\", CMD_ARGV[i]);"},{"line_number":853,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":4,"id":"88c811ff_de25a3f7","line":850,"updated":"2022-05-07 13:45:54.000000000","message":"remove parenthesis","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"502e9a7b987a1e180354abf397c7645dcf90dc77","unresolved":false,"context_lines":[{"line_number":847,"context_line":"\t\treturn ERROR_OK;"},{"line_number":848,"context_line":"\t}"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"\tgpio_config \u003d \u0026(adapter_config.gpios[gpio_idx]);"},{"line_number":851,"context_line":"\twhile (i \u003c CMD_ARGC) {"},{"line_number":852,"context_line":"\t\tLOG_DEBUG(\"Processing %s\", CMD_ARGV[i]);"},{"line_number":853,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":4,"id":"0944cad4_69fa094a","line":850,"in_reply_to":"88c811ff_de25a3f7","updated":"2022-05-07 19:49:13.000000000","message":"Done","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"140db460be28fe9f591ebcae15dd78374cdb4779","unresolved":true,"context_lines":[{"line_number":1093,"context_line":"/* Allow drivers access to the GPIO configuration */"},{"line_number":1094,"context_line":"const struct adapter_gpio_config *adapter_get_gpio_config(enum adapter_gpio_config_index idx)"},{"line_number":1095,"context_line":"{"},{"line_number":1096,"context_line":"\treturn (const struct adapter_gpio_config *)\u0026(adapter_config.gpios[idx]);"},{"line_number":1097,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"12dc654a_355c43ff","line":1096,"updated":"2022-05-07 13:45:54.000000000","message":"without parenthesis after \"\u0026\"\nI think no need for the cast; just\n return \u0026adapter_config.gpios[idx];\nshould not trigger any compile error, even if the returned value is const\u0027ed.","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"502e9a7b987a1e180354abf397c7645dcf90dc77","unresolved":false,"context_lines":[{"line_number":1093,"context_line":"/* Allow drivers access to the GPIO configuration */"},{"line_number":1094,"context_line":"const struct adapter_gpio_config *adapter_get_gpio_config(enum adapter_gpio_config_index idx)"},{"line_number":1095,"context_line":"{"},{"line_number":1096,"context_line":"\treturn (const struct adapter_gpio_config *)\u0026(adapter_config.gpios[idx]);"},{"line_number":1097,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"9f1b5c5c_c5140e58","line":1096,"in_reply_to":"12dc654a_355c43ff","updated":"2022-05-07 19:49:13.000000000","message":"Done","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"0adf9b9a53c903c7272d3c50355f7fb35e694157","unresolved":true,"context_lines":[{"line_number":798,"context_line":"\t[ADAPTER_GPIO_IDX_SWCLK] \u003d { \"swclk\", ADAPTER_GPIO_DIRECTION_OUTPUT, true, true, },"},{"line_number":799,"context_line":"\t[ADAPTER_GPIO_IDX_TRST] \u003d { \"trst\", ADAPTER_GPIO_DIRECTION_OUTPUT, false, true, },"},{"line_number":800,"context_line":"\t[ADAPTER_GPIO_IDX_SRST] \u003d { \"srst\", ADAPTER_GPIO_DIRECTION_OUTPUT, false, true, },"},{"line_number":801,"context_line":"\t[ADAPTER_GPIO_IDX_LED] \u003d { \"led\", ADAPTER_GPIO_DIRECTION_OUTPUT, true, true, },"},{"line_number":802,"context_line":"};"},{"line_number":803,"context_line":""},{"line_number":804,"context_line":"static int get_gpio_index(const char *signal_name)"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"4139d877_fec6e3c2","line":801,"updated":"2022-06-11 15:03:37.000000000","message":"Add \"user0\" ADAPTER_GPIO_DIRECTION_BIDIRECTIONAL. Which init state? input, probably.","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"3e5f6e936a65fc248a99e269e73176fc594877eb","unresolved":true,"context_lines":[{"line_number":798,"context_line":"\t[ADAPTER_GPIO_IDX_SWCLK] \u003d { \"swclk\", ADAPTER_GPIO_DIRECTION_OUTPUT, true, true, },"},{"line_number":799,"context_line":"\t[ADAPTER_GPIO_IDX_TRST] \u003d { \"trst\", ADAPTER_GPIO_DIRECTION_OUTPUT, false, true, },"},{"line_number":800,"context_line":"\t[ADAPTER_GPIO_IDX_SRST] \u003d { \"srst\", ADAPTER_GPIO_DIRECTION_OUTPUT, false, true, },"},{"line_number":801,"context_line":"\t[ADAPTER_GPIO_IDX_LED] \u003d { \"led\", ADAPTER_GPIO_DIRECTION_OUTPUT, true, true, },"},{"line_number":802,"context_line":"};"},{"line_number":803,"context_line":""},{"line_number":804,"context_line":"static int get_gpio_index(const char *signal_name)"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"d997097e_49116e14","line":801,"in_reply_to":"35e45724_1e41c009","updated":"2022-06-13 17:08:42.000000000","message":"I just want to suggest to users that there is no need to invent a new GPIO name for special user\u0027s cases. This could avoid having this list growing at any new special case.\nOne useful use case is sending signals to the ARM CTI through a GPIO of the SoC under test, or reading one target\u0027s GPIO set by the SW under test.","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"dd6e9880e34b1881155f631e4fb2c3fa13745018","unresolved":true,"context_lines":[{"line_number":798,"context_line":"\t[ADAPTER_GPIO_IDX_SWCLK] \u003d { \"swclk\", ADAPTER_GPIO_DIRECTION_OUTPUT, true, true, },"},{"line_number":799,"context_line":"\t[ADAPTER_GPIO_IDX_TRST] \u003d { \"trst\", ADAPTER_GPIO_DIRECTION_OUTPUT, false, true, },"},{"line_number":800,"context_line":"\t[ADAPTER_GPIO_IDX_SRST] \u003d { \"srst\", ADAPTER_GPIO_DIRECTION_OUTPUT, false, true, },"},{"line_number":801,"context_line":"\t[ADAPTER_GPIO_IDX_LED] \u003d { \"led\", ADAPTER_GPIO_DIRECTION_OUTPUT, true, true, },"},{"line_number":802,"context_line":"};"},{"line_number":803,"context_line":""},{"line_number":804,"context_line":"static int get_gpio_index(const char *signal_name)"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"35e45724_1e41c009","line":801,"in_reply_to":"4139d877_fec6e3c2","updated":"2022-06-12 22:27:52.000000000","message":"What is the use case of this \"user0\" GPIO? I cannot find any similar uses in the code and don\u0027t recall this being discussed before. I\u0027m happy to add it but I need to understand the purpose to document it.\n\nYes, the default direction should be input.","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"61c2d2265ee5062870f8c6c6f018c333c7be2dcb","unresolved":false,"context_lines":[{"line_number":798,"context_line":"\t[ADAPTER_GPIO_IDX_SWCLK] \u003d { \"swclk\", ADAPTER_GPIO_DIRECTION_OUTPUT, true, true, },"},{"line_number":799,"context_line":"\t[ADAPTER_GPIO_IDX_TRST] \u003d { \"trst\", ADAPTER_GPIO_DIRECTION_OUTPUT, false, true, },"},{"line_number":800,"context_line":"\t[ADAPTER_GPIO_IDX_SRST] \u003d { \"srst\", ADAPTER_GPIO_DIRECTION_OUTPUT, false, true, },"},{"line_number":801,"context_line":"\t[ADAPTER_GPIO_IDX_LED] \u003d { \"led\", ADAPTER_GPIO_DIRECTION_OUTPUT, true, true, },"},{"line_number":802,"context_line":"};"},{"line_number":803,"context_line":""},{"line_number":804,"context_line":"static int get_gpio_index(const char *signal_name)"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"f2ef2d48_80fe4635","line":801,"in_reply_to":"d997097e_49116e14","updated":"2022-06-15 21:40:12.000000000","message":"I will add user0 now that I understand what is required. This is going to require an extra command to get/set its state but that should be in a separate changeset so I won\u0027t include it here.\n\nPerhaps such a command (\"adapter setgpio user0 0|1|active|inactive|input\" ?) can be added in a way that it is possible to set the state of any GPIO configured with \"adapter gpio\"? I\u0027ve been building buffered SWD programming adapters to fit onto Raspberry Pis (Beaglebones too via a shim PCB) and a command like this would be very helpful for testing new hardware and OpenOCD adapters. Will also want \"adapter getgpio ...\" to read input/bidirectional GPIO.","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a0f18ff8de31fb65a95110be987e841a5a2150cd","unresolved":false,"context_lines":[{"line_number":798,"context_line":"\t[ADAPTER_GPIO_IDX_SWCLK] \u003d { \"swclk\", ADAPTER_GPIO_DIRECTION_OUTPUT, true, true, },"},{"line_number":799,"context_line":"\t[ADAPTER_GPIO_IDX_TRST] \u003d { \"trst\", ADAPTER_GPIO_DIRECTION_OUTPUT, false, true, },"},{"line_number":800,"context_line":"\t[ADAPTER_GPIO_IDX_SRST] \u003d { \"srst\", ADAPTER_GPIO_DIRECTION_OUTPUT, false, true, },"},{"line_number":801,"context_line":"\t[ADAPTER_GPIO_IDX_LED] \u003d { \"led\", ADAPTER_GPIO_DIRECTION_OUTPUT, true, true, },"},{"line_number":802,"context_line":"};"},{"line_number":803,"context_line":""},{"line_number":804,"context_line":"static int get_gpio_index(const char *signal_name)"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"c8ff5bbf_8442435f","line":801,"in_reply_to":"f2ef2d48_80fe4635","updated":"2022-06-15 22:24:40.000000000","message":"You are right! We need extra commands get/set. Should be in a separate patch.\nIn https://review.openocd.org/6943/ there are two commands to read TDO and set TDI, TCK, TMS, TRST and SRST. They are useful to send arbitrary JTAG sequences. Don\u0027t look at the command syntax ...\nWhat I want to say is that not only user0 but any other GPIO should be available through get/set. It\u0027s up to the user if he/she mess-up the JTAG communication.","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"0adf9b9a53c903c7272d3c50355f7fb35e694157","unresolved":true,"context_lines":[{"line_number":1167,"context_line":"}"},{"line_number":1168,"context_line":""},{"line_number":1169,"context_line":"/* Allow drivers access to the GPIO configuration */"},{"line_number":1170,"context_line":"const struct adapter_gpio_config *adapter_gpio_get_config(enum adapter_gpio_config_index idx)"},{"line_number":1171,"context_line":"{"},{"line_number":1172,"context_line":"\treturn \u0026adapter_config.gpios[idx];"},{"line_number":1173,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"3a3824a5_076742aa","line":1170,"updated":"2022-06-11 15:03:37.000000000","message":"This function is called continuously during bitbang, and can kill the max speed.\nBut I want to keep \"adapter_config\" private, so this should not be converted as static inline in adapter.h.\nOne possible workaround is to add another function that returns a pointer to the whole array.\n const struct adapter_gpio_config *adapter_gpio_get_config_array()\n {\n      return adapter_config.gpios;\n }\n\nUser code can either run the existing\n static int am335xgpio_write(int tck, int tms, int tdi)\n {\n        set_gpio_value(adapter_gpio_get_config(ADAPTER_GPIO_IDX_TDI), tdi);\n        set_gpio_value(adapter_gpio_get_config(ADAPTER_GPIO_IDX_TMS), tms);\n        set_gpio_value(adapter_gpio_get_config(ADAPTER_GPIO_IDX_TCK), tck);\n\nor can save somewhere\n const struct adapter_gpio_config *gpio_config \u003d adapter_gpio_get_config_array();\nand later\n static int am335xgpio_write(int tck, int tms, int tdi)\n {\n        set_gpio_value(\u0026gpio_config[ADAPTER_GPIO_IDX_TDI], tdi);\n        set_gpio_value(\u0026gpio_config[ADAPTER_GPIO_IDX_TMS], tms);\n        set_gpio_value(\u0026gpio_config[ADAPTER_GPIO_IDX_TCK], tck);\navoiding too many function calls.\n\nBUT, special attention should be used for \"srst\" and \"trst\"? Their config is not supposed to be constant, as can be changed at runtime with \"reset_config\".\nAt least these 2 GPIO should be mandatory handled through adapter_gpio_get_config()?","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"3e5f6e936a65fc248a99e269e73176fc594877eb","unresolved":true,"context_lines":[{"line_number":1167,"context_line":"}"},{"line_number":1168,"context_line":""},{"line_number":1169,"context_line":"/* Allow drivers access to the GPIO configuration */"},{"line_number":1170,"context_line":"const struct adapter_gpio_config *adapter_gpio_get_config(enum adapter_gpio_config_index idx)"},{"line_number":1171,"context_line":"{"},{"line_number":1172,"context_line":"\treturn \u0026adapter_config.gpios[idx];"},{"line_number":1173,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"a829c1a0_07a774bc","line":1170,"in_reply_to":"206f77c5_2d9728d8","updated":"2022-06-13 17:08:42.000000000","message":"I just throw the idea. If you have a simple implementation in mind, that\u0027s welcome.\nAlso I guess it would lower the performance, but not tested it on real HW.","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"dd6e9880e34b1881155f631e4fb2c3fa13745018","unresolved":true,"context_lines":[{"line_number":1167,"context_line":"}"},{"line_number":1168,"context_line":""},{"line_number":1169,"context_line":"/* Allow drivers access to the GPIO configuration */"},{"line_number":1170,"context_line":"const struct adapter_gpio_config *adapter_gpio_get_config(enum adapter_gpio_config_index idx)"},{"line_number":1171,"context_line":"{"},{"line_number":1172,"context_line":"\treturn \u0026adapter_config.gpios[idx];"},{"line_number":1173,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"206f77c5_2d9728d8","line":1170,"in_reply_to":"3a3824a5_076742aa","updated":"2022-06-12 22:27:52.000000000","message":"Minimising these functions calls to optimise bit-banging speed would be good, and keeping a local copy is easy and cheap but why do you suggest two functions instead of just one that returns the array address? The call to sync_adapter_reset_with_gpios() made from inside COMMAND_HANDLER(handle_reset_config_command) makes it safe to access the \"srst\" and \"trst\" configs via a saved pointer to adapter_config.gpios, even after runtime reconfiguration of \"srst\" and \"trst\".\n\nHave I missed something?","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"61c2d2265ee5062870f8c6c6f018c333c7be2dcb","unresolved":false,"context_lines":[{"line_number":1167,"context_line":"}"},{"line_number":1168,"context_line":""},{"line_number":1169,"context_line":"/* Allow drivers access to the GPIO configuration */"},{"line_number":1170,"context_line":"const struct adapter_gpio_config *adapter_gpio_get_config(enum adapter_gpio_config_index idx)"},{"line_number":1171,"context_line":"{"},{"line_number":1172,"context_line":"\treturn \u0026adapter_config.gpios[idx];"},{"line_number":1173,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"f4db4b0f_f9f92d44","line":1170,"in_reply_to":"a829c1a0_07a774bc","updated":"2022-06-15 21:40:12.000000000","message":"I\u0027ll modify the interface for getting the adapter GPIO config and then we can see how it works in practice with the am335xgpio implementation. Properly testing the am335xgpio adapter on actual hardware is still to be done - I\u0027ll see if I can compare SWCLK speed at the same time.","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"a0f18ff8de31fb65a95110be987e841a5a2150cd","unresolved":false,"context_lines":[{"line_number":1167,"context_line":"}"},{"line_number":1168,"context_line":""},{"line_number":1169,"context_line":"/* Allow drivers access to the GPIO configuration */"},{"line_number":1170,"context_line":"const struct adapter_gpio_config *adapter_gpio_get_config(enum adapter_gpio_config_index idx)"},{"line_number":1171,"context_line":"{"},{"line_number":1172,"context_line":"\treturn \u0026adapter_config.gpios[idx];"},{"line_number":1173,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"a24d4971_af653dbb","line":1170,"in_reply_to":"f4db4b0f_f9f92d44","updated":"2022-06-15 22:24:40.000000000","message":"cool!","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"52ba8986eb37aef12a33b319174b49864049d0b0","unresolved":true,"context_lines":[{"line_number":941,"context_line":"\t\t\tif (CMD_ARGC - i \u003c 2) {"},{"line_number":942,"context_line":"\t\t\t\tLOG_ERROR(\"-chip option requires a parameter\");"},{"line_number":943,"context_line":"\t\t\t\treturn ERROR_FAIL;"},{"line_number":944,"context_line":"\t\t\t} else {"},{"line_number":945,"context_line":"\t\t\t\tLOG_DEBUG(\"-chip arg is %s\", CMD_ARGV[i + 1]);"},{"line_number":946,"context_line":"\t\t\t\tint chip_num; /* Use a meaningful output parameter for more helpful error messages */"},{"line_number":947,"context_line":"\t\t\t\tCOMMAND_PARSE_NUMBER(int, CMD_ARGV[i + 1], chip_num);"}],"source_content_type":"text/x-csrc","patch_set":16,"id":"5bc54424_80b624cf","line":944,"updated":"2022-06-25 16:45:11.000000000","message":"after a \u0027return\u0027 you can skip the \u0027else\u0027 and save one indentation for the remaining code","commit_id":"aaddc277f3ecbe4d96683740122ca2f601cda2c9"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"a558279a940167564e4e57d3061dce3ce19d1b11","unresolved":false,"context_lines":[{"line_number":941,"context_line":"\t\t\tif (CMD_ARGC - i \u003c 2) {"},{"line_number":942,"context_line":"\t\t\t\tLOG_ERROR(\"-chip option requires a parameter\");"},{"line_number":943,"context_line":"\t\t\t\treturn ERROR_FAIL;"},{"line_number":944,"context_line":"\t\t\t} else {"},{"line_number":945,"context_line":"\t\t\t\tLOG_DEBUG(\"-chip arg is %s\", CMD_ARGV[i + 1]);"},{"line_number":946,"context_line":"\t\t\t\tint chip_num; /* Use a meaningful output parameter for more helpful error messages */"},{"line_number":947,"context_line":"\t\t\t\tCOMMAND_PARSE_NUMBER(int, CMD_ARGV[i + 1], chip_num);"}],"source_content_type":"text/x-csrc","patch_set":16,"id":"860ee0c6_ef441bf0","line":944,"in_reply_to":"5bc54424_80b624cf","updated":"2022-06-25 17:33:59.000000000","message":"Done","commit_id":"aaddc277f3ecbe4d96683740122ca2f601cda2c9"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"6d4ce2b3ca66307f1d73dccfb97a1da3dd4e7941","unresolved":false,"context_lines":[{"line_number":130,"context_line":"\t\treturn ERROR_JTAG_INVALID_INTERFACE;"},{"line_number":131,"context_line":"\t}"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"\tadapter_driver_gpios_init();"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"\tint retval;"},{"line_number":136,"context_line":"\tretval \u003d adapter_driver-\u003einit();"}],"source_content_type":"text/x-csrc","patch_set":19,"id":"2cead286_b142ebad","line":133,"updated":"2022-07-04 17:42:24.000000000","message":"I discovered a bug. By running \"openocd -c \u0027adapter driver linuxgpiod\u0027\" the driver\u0027s init() function would be called with the gpio_num and chip_num values still set to zero; they had never been initialized to their unconfigured values of -1. This caused the init function to try to open (and modify) an incorrect GPIO.","commit_id":"43c684aa9b0db6475a920db12a5ca62a22000834"}],"src/jtag/adapter.h":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"140db460be28fe9f591ebcae15dd78374cdb4779","unresolved":true,"context_lines":[{"line_number":2,"context_line":"/*"},{"line_number":3,"context_line":" * Copyright (C) 2005 by Dominic Rath \u003cDominic.Rath@gmx.de\u003e"},{"line_number":4,"context_line":" * Copyright (c) 2018 Pengutronix, Oleksij Rempel \u003ckernel@pengutronix.de\u003e"},{"line_number":5,"context_line":" */"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"#ifndef OPENOCD_JTAG_ADAPTER_H"},{"line_number":8,"context_line":"#define OPENOCD_JTAG_ADAPTER_H"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"9a94fc9f_4c5b2640","line":5,"updated":"2022-05-07 13:45:54.000000000","message":"with the hard work you are doing you are surely entitled to be listed here. It\u0027s up to you!","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"502e9a7b987a1e180354abf397c7645dcf90dc77","unresolved":false,"context_lines":[{"line_number":2,"context_line":"/*"},{"line_number":3,"context_line":" * Copyright (C) 2005 by Dominic Rath \u003cDominic.Rath@gmx.de\u003e"},{"line_number":4,"context_line":" * Copyright (c) 2018 Pengutronix, Oleksij Rempel \u003ckernel@pengutronix.de\u003e"},{"line_number":5,"context_line":" */"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"#ifndef OPENOCD_JTAG_ADAPTER_H"},{"line_number":8,"context_line":"#define OPENOCD_JTAG_ADAPTER_H"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"53f9b3ac_3d9a40c5","line":5,"in_reply_to":"9a94fc9f_4c5b2640","updated":"2022-05-07 19:49:13.000000000","message":"Thank you. git blame suggests there are uncredited authors (yourself included) with more lines committed.","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"140db460be28fe9f591ebcae15dd78374cdb4779","unresolved":true,"context_lines":[{"line_number":26,"context_line":"enum adapter_gpio_config_index {"},{"line_number":27,"context_line":"\tADAPTER_GPIO_IDX_TDO,"},{"line_number":28,"context_line":"\tADAPTER_GPIO_IDX_LED,"},{"line_number":29,"context_line":"\tADAPTER_GPIO_IDX_NUM,"},{"line_number":30,"context_line":"};"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"/** Configuration options for a single GPIO */"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"32a994d8_6db31077","line":29,"updated":"2022-05-07 13:45:54.000000000","message":"to avoid any confusion, add a comment to this line, e.g.\n ADAPTER_GPIO_IDX_NUM, /* must be the last one */","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"502e9a7b987a1e180354abf397c7645dcf90dc77","unresolved":false,"context_lines":[{"line_number":26,"context_line":"enum adapter_gpio_config_index {"},{"line_number":27,"context_line":"\tADAPTER_GPIO_IDX_TDO,"},{"line_number":28,"context_line":"\tADAPTER_GPIO_IDX_LED,"},{"line_number":29,"context_line":"\tADAPTER_GPIO_IDX_NUM,"},{"line_number":30,"context_line":"};"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"/** Configuration options for a single GPIO */"}],"source_content_type":"text/x-csrc","patch_set":4,"id":"e099c9ab_7b86c768","line":29,"in_reply_to":"32a994d8_6db31077","updated":"2022-05-07 19:49:13.000000000","message":"Done","commit_id":"192ae4df8b116aa139b00781ad06bbb4c29a0fa6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"0adf9b9a53c903c7272d3c50355f7fb35e694157","unresolved":true,"context_lines":[{"line_number":32,"context_line":"\tADAPTER_GPIO_INIT_STATE_INPUT,"},{"line_number":33,"context_line":"};"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"/** Adapater GPIO */"},{"line_number":36,"context_line":"enum adapter_gpio_config_index {"},{"line_number":37,"context_line":"\tADAPTER_GPIO_IDX_TDO,"},{"line_number":38,"context_line":"\tADAPTER_GPIO_IDX_TDI,"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"da02ebbd_52835e82","line":35,"updated":"2022-06-11 15:03:37.000000000","message":"typo s/Adapater/Adapter/","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"dd6e9880e34b1881155f631e4fb2c3fa13745018","unresolved":false,"context_lines":[{"line_number":32,"context_line":"\tADAPTER_GPIO_INIT_STATE_INPUT,"},{"line_number":33,"context_line":"};"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"/** Adapater GPIO */"},{"line_number":36,"context_line":"enum adapter_gpio_config_index {"},{"line_number":37,"context_line":"\tADAPTER_GPIO_IDX_TDO,"},{"line_number":38,"context_line":"\tADAPTER_GPIO_IDX_TDI,"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"fbae9dd3_a36f6e46","line":35,"in_reply_to":"da02ebbd_52835e82","updated":"2022-06-12 22:27:52.000000000","message":"Done","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"0adf9b9a53c903c7272d3c50355f7fb35e694157","unresolved":true,"context_lines":[{"line_number":43,"context_line":"\tADAPTER_GPIO_IDX_SWDIO_DIR,"},{"line_number":44,"context_line":"\tADAPTER_GPIO_IDX_SWCLK,"},{"line_number":45,"context_line":"\tADAPTER_GPIO_IDX_SRST,"},{"line_number":46,"context_line":"\tADAPTER_GPIO_IDX_LED,"},{"line_number":47,"context_line":"\tADAPTER_GPIO_IDX_NUM, /* must be the last item */"},{"line_number":48,"context_line":"};"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":7,"id":"5cbdb317_d68bfc41","line":46,"updated":"2022-06-11 15:03:37.000000000","message":"Add also ADAPTER_GPIO_IDX_USER0, so any extra user GPIO has already a prototype.","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"61c2d2265ee5062870f8c6c6f018c333c7be2dcb","unresolved":false,"context_lines":[{"line_number":43,"context_line":"\tADAPTER_GPIO_IDX_SWDIO_DIR,"},{"line_number":44,"context_line":"\tADAPTER_GPIO_IDX_SWCLK,"},{"line_number":45,"context_line":"\tADAPTER_GPIO_IDX_SRST,"},{"line_number":46,"context_line":"\tADAPTER_GPIO_IDX_LED,"},{"line_number":47,"context_line":"\tADAPTER_GPIO_IDX_NUM, /* must be the last item */"},{"line_number":48,"context_line":"};"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":7,"id":"551928f4_f894737d","line":46,"in_reply_to":"15fc4021_be2cb6ac","updated":"2022-06-15 21:40:12.000000000","message":"Done","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"dd6e9880e34b1881155f631e4fb2c3fa13745018","unresolved":true,"context_lines":[{"line_number":43,"context_line":"\tADAPTER_GPIO_IDX_SWDIO_DIR,"},{"line_number":44,"context_line":"\tADAPTER_GPIO_IDX_SWCLK,"},{"line_number":45,"context_line":"\tADAPTER_GPIO_IDX_SRST,"},{"line_number":46,"context_line":"\tADAPTER_GPIO_IDX_LED,"},{"line_number":47,"context_line":"\tADAPTER_GPIO_IDX_NUM, /* must be the last item */"},{"line_number":48,"context_line":"};"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":7,"id":"15fc4021_be2cb6ac","line":46,"in_reply_to":"5cbdb317_d68bfc41","updated":"2022-06-12 22:27:52.000000000","message":"Awaiting feedback on user0.","commit_id":"aa8e3756f291efba1d7b7cac3cb52579750bd6c6"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"912a2cdf53ce3b8f1cbd57ee88f1fe7ef82fdfca","unresolved":true,"context_lines":[{"line_number":44,"context_line":"\tADAPTER_GPIO_IDX_SWCLK,"},{"line_number":45,"context_line":"\tADAPTER_GPIO_IDX_SRST,"},{"line_number":46,"context_line":"\tADAPTER_GPIO_IDX_LED,"},{"line_number":47,"context_line":"\tADAPTER_GPIO_IDX_USER0,"},{"line_number":48,"context_line":"\tADAPTER_GPIO_IDX_NUM, /* must be the last item */"},{"line_number":49,"context_line":"};"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":10,"id":"3c63207f_1c713260","line":47,"updated":"2022-06-16 07:52:11.000000000","message":"Maybe better adding user0 in the same patch that adds commands get/set","commit_id":"c74a4ee9a5da8f7296f391f75c0b021071a521b9"},{"author":{"_account_id":1001975,"name":"Steve Marple","email":"stevemarple@googlemail.com","username":"stevemarple"},"change_message_id":"cd1a0c17e83d62411aefbcf8a2218bdd84838ce8","unresolved":false,"context_lines":[{"line_number":44,"context_line":"\tADAPTER_GPIO_IDX_SWCLK,"},{"line_number":45,"context_line":"\tADAPTER_GPIO_IDX_SRST,"},{"line_number":46,"context_line":"\tADAPTER_GPIO_IDX_LED,"},{"line_number":47,"context_line":"\tADAPTER_GPIO_IDX_USER0,"},{"line_number":48,"context_line":"\tADAPTER_GPIO_IDX_NUM, /* must be the last item */"},{"line_number":49,"context_line":"};"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":10,"id":"e1c89df3_78a21f63","line":47,"in_reply_to":"3c63207f_1c713260","updated":"2022-06-16 20:20:31.000000000","message":"Yes. We know how to do that know and the change to insert later is small.","commit_id":"c74a4ee9a5da8f7296f391f75c0b021071a521b9"}]}
