There was a glitch while upgrading the gerrit system yesterday. No automatic email has been sent about the new patches I have pushed on the ADIv6 topic, so here is this email.
I have split the huge patch https://review.openocd.org/6077/ It was an interesting exercise for me and I also found something else to fix in actual code. Already 7 patches related to this work were merged during last weeks. The first 9 new patches from https://review.openocd.org/6446/ to https://review.openocd.org/6454/ are generic enough to be reviewed and merged quickly. The core ADIv6 is in the other 15 patches (plus one to modify the scripts for Ampere QS|QM) in https://review.openocd.org/q/topic:adiv6 It should now be easier to review the whole series. I don't consider this series complete, I still have a few concerns here and there, but it's time to share them and get feedback. The main difference with the original patch 6077 is in the way to address the ADIv6 AP. 6077 uses the trick to create a target mem-ap to assign the ADIv6 base address to an AP number 0-255 of the target mem-ap. This prevents exploring an unknown chip with "apreg" commands, where the AP base address is unknown; many mem-ap has to be created during the exploration; headache! Plus reading the whole ROM table, spread across different AP, will require adding the mem-ap in advance, even on AP that are not of MEM-AP type; odd! My proposal here is to address the ADIv6 AP directly with their base address. The association between AP base address and AP numbers is dynamic and it's an internal business of OpenOCD. The concept of AP number does not exist in ADIv6, and also ADIv5 talks about APSEL not AP number. So with ADIv6 OpenOCD drops the concept of AP number in favor of AP base address. This also drops the trick in 6077 to associate AP#0 to the root AP defined in DAP BASEPTRx. The command "dap info root" does the trick. Other points: - no autodetection of DAP version ADIv5 or ADIv6. To be added in future. - I had to introduce the flags -adiv6/-adiv5 in an early patch, when ADIv6 is not complete yet. Use -adiv6 only on the whole series. Can be eventually modified in a next version of the series. - the script for Ampere QS|QM are of course not tested. Without documentation, I can only guess! - I have tried my best to keep the original authorship of the code. If you see something incorrect just blame me and I will fix it. - SWD was extended for ADIv6 in 6077. I'm checking for it. Antonio