From: <ge...@op...> - 2023-06-13 09:15:19
|
This is an automated email from Gerrit. "ahmed BOUDJELIDA <abo...@na...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7697 -- gerrit commit db031846ab86ba63f360ed9cd1120847213a15d5 Author: Ahmed BOUDJELIDA <abo...@na...> Date: Tue Jun 13 19:06:52 2023 +0200 jtag/drivers: Add new driver and firmware for ANGIE USB-JTAG Adapter This is a driver and firmware code for NanoXplore's ANGIE USB-JTAG Adapter. The driver and firmware are based on the openULINK project. Since the ANGIE Adapter has a Spartan-6 FPGA in addition to the microcontroller, the driver adds a function "angie_load_bitstream" that programs this FPGA before starting the JTAG communication. An image for ANGIE's firmware and bitstream are also included. Change-Id: I59701fe84a64c8403c5ca89a613c05470dd5c740 Signed-off-by: Ahmed BOUDJELIDA <abo...@na...> diff --git a/configure.ac b/configure.ac index ac2808e1f5..ecf8384bf8 100644 --- a/configure.ac +++ b/configure.ac @@ -118,6 +118,7 @@ m4_define([USB1_ADAPTERS], [[stlink], [ST-Link Programmer], [HLADAPTER_STLINK]], [[ti_icdi], [TI ICDI JTAG Programmer], [HLADAPTER_ICDI]], [[ulink], [Keil ULINK JTAG Programmer], [ULINK]], + [[angie], [ANGIE Adapter], [ANGIE]], [[usb_blaster_2], [Altera USB-Blaster II Compatible], [USB_BLASTER_2]], [[ft232r], [Bitbang mode of FT232R based devices], [FT232R]], [[vsllink], [Versaloon-Link JTAG Programmer], [VSLLINK]], diff --git a/doc/openocd.texi b/doc/openocd.texi index 832047f0ea..1420b5faaa 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -534,6 +534,9 @@ of USB-based ones. @item @b{Wiggler} - There are many clones of this. @* Link: @url{http://www.macraigor.com/wiggler.htm} +@item @b{angie} +@* Link: @url{https://nanoxplore.org/} + @item @b{DLC5} - From XILINX - There are many clones of this @* Link: Search the web for: ``XILINX DLC5'' - it is no longer produced, PDF schematics are easily found and it is easy to make. @@ -3241,6 +3244,10 @@ opendous-jtag is a freely programmable USB adapter. This is the Keil ULINK v1 JTAG debugger. @end deffn +@deffn {Interface Driver} {angie} +This is the NanoXplore's ANGIE USB-JTAG Adapter. +@end deffn + @deffn {Interface Driver} {xds110} The XDS110 is included as the embedded debug probe on many Texas Instruments LaunchPad evaluation boards. The XDS110 is also available as a stand-alone USB diff --git a/src/jtag/drivers/ANGIE/README b/src/jtag/drivers/ANGIE/README new file mode 100755 index 0000000000..2d4a1986dd --- /dev/null +++ b/src/jtag/drivers/ANGIE/README @@ -0,0 +1,37 @@ +This project is based on the openULINK project by Martin Schmoelzer. + +This is the ANGIE firmware for ANGIE USB-JTAG adapter from NanoXplore. + +The main components of ANGIE adapter are: +- Cypress EZ-USB FX2 microcontroller +- Spartan-6 FPGA +- SRAM memory chip +- Pin headers for various JTAG pin assignments + +To compile the firmware, the SDCC compiler package is required. Most Linux +distributions include SDCC in their official package repositories. The SDCC +source code can be found at http://sdcc.sourceforge.net/ + +Simply type "make hex" in the ANGIE directory to compile the firmware. +"make clean" will remove all generated files except the Intel HEX file required +for downloading the firmware to ANGIE. + +Note that the EZ-USB FX2 microcontroller does not have on-chip flash, ANGIE +include on-board EEPROM memory to store the firmware program of the FX2, but +we are not going to use this method. + +Instead, upon initial connection of the ANGIE adapter to the host PC via USB, +the EZ-USB FX2 core has enough intelligence to act as a stand-alone USB device, +responding to USB control requests and allowing firmware download via a special +VENDOR-type control request. Then, the EZ-USB microcontroller simulates a +disconnect and re-connect to the USB bus. It may take up to two seconds for the +host to recognize the newly connected device before OpenOCD can proceed to +execute JTAG commands. This delay is only visible when OpenOCD first uses a +blank (unconfigured) ANGIE device. + +Once the firmware downloaded, the FX2 microcontroller activate its GPIF mode, download +the Spartan-6 FPGA's bitstream, program the FPGA rapidly, and switch back to +default io mode. + +Once the user disconnects the ANGIE adapter, all its memory contents are lost +and the firmware & bitstream download process has to be executed again. \ No newline at end of file diff --git a/src/jtag/drivers/ANGIE/angie_bitstream.bit b/src/jtag/drivers/ANGIE/angie_bitstream.bit new file mode 100644 index 0000000000..5718d15032 Binary files /dev/null and b/src/jtag/drivers/ANGIE/angie_bitstream.bit differ diff --git a/src/jtag/drivers/ANGIE/angie_firmware.hex b/src/jtag/drivers/ANGIE/angie_firmware.hex new file mode 100755 index 0000000000..76d185bbaf --- /dev/null +++ b/src/jtag/drivers/ANGIE/angie_firmware.hex @@ -0,0 +1,604 @@ +:040000000200713257 +:01000B0032C2 +:0100130032BA +:01001B0032B2 +:0100230032AA +:01002B0032A2 +:01003300329A +:01003B003292 +:01004300328A +:01004B003282 +:01005300327A +:01005B003272 +:01006300326A +:03006B000201107F +:0300D20002006EBB +:03006E000200D5B8 +:1000D50090E600E054E74412F090E100E4F5F012F8 +:1000E500165B1206D612175912075512078190E6AC +:1000F50080E043E00AF09000FA12163190E680E0C5 +:0B01050053E0F7F0120BDB900000222B +:0300CA00750A00B4 +:10011000C020C0E0C0F0C082C083C007C006C005D8 +:10012000C004C003C002C001C000C0D075D00053DD +:1001300091EF90E65D7401F090E6A0E043E080F07E +:1001400012060BD0D0D000D001D002D003D004D002 +:1001500005D006D007D083D082D0F0D0E0D02032B6 +:10016000323232323232323232C0E0C082C0837533 +:1001700009015391EF90E65F7404F0D083D082D0F0 +:10018000E032C0E0C082C0837508015391EF90E671 +:100190005F7408F0D083D082D0E03275080032322C +:1001A000323232323232323232323232323232322F +:1001B000323232323232323232323232AF82747FC3 +:1001C0005FFE24F75003020210EE240A83F582EE4C +:1001D000240D83F583E473E9ED0010041008100C7E +:1001E00001010202020202020290E6A022EF30E7C1 +:1001F000067EA27FE680047EA17FE68E828F832228 +:1002000090E6A32290E6A42290E6A52290E6A622FC +:1002100090000022AF828F05530580E4C423CDC433 +:1002200023541F6DCD541FCD6DCD30E40244E074D6 +:100230000F5F90E6832DF0E043E020F02290E6B8D7 +:10024000E0FFBF8002800DBF81028023BF82028059 +:10025000390202CA90E740E4F090E741F090E68A64 +:10026000F000000090E68B7402F0000000805F90C8 +:10027000E740E4F090E741F090E68AF0000000905B +:10028000E68B7402F0000000804490E6BCE0F5824A +:100290001201BCAE82AF837D008E828F838DF012FF +:1002A000221CFE30E00890E7407401F0800590E7E2 +:1002B00040E4F090E741E4F090E68AF0000000901E +:1002C000E68B7402F00000008004758200227582C3 +:1002D000012290E6B8E0FFFEBE00028005BF0244A6 +:1002E000800A90E6A0E043E001F0803890E6BAE0B2 +:1002F000FEA3E0FF4E702590E6BCE0F5821201BC43 +:10030000AE82AF83EE4F7003F582228E828F83E040 +:10031000FD5305FE8E828F83EDF0800890E6A0E00D +:1003200043E001F07582012290E6B8E0FFFEBE00D6 +:10033000028005BF0247801290E6BAE0FEA3E0FF0C +:10034000BE023ABF00377582012290E6BAE0FEA3F2 +:10035000E04E702590E6BCE0F5821201BCAE82AFA3 +:1003600083EE4F7003F582228E828F83E0FD43057A +:10037000018E828F83EDF0800475820022758201E8 +:100380002290E6BAE0A3E0FF90E6BAE0FEBF0102E9 +:10039000800DBF0202801ABF0302802602042C7D5A +:1003A0003C7F2290E6B3EFF090E6B4743CF0020498 +:1003B000307D4E7F2290E6B3EFF090E6B4744EF0BD +:1003C000806E90E6BCE0FDA3E04D70117D8A7F2237 +:1003D00090E6B3EFF090E6B4748AF0805390E6BCF8 +:1003E000E0FDA3E0FFBD0940BF043D1EC2D575F08E +:1003F00002EE30E704B2D5F404A430D50AF42401A7 +:10040000C5F0F43400C5F024F4F582742235F0F51B +:1004100083E493FEA3E493FF8E048F0590E6B3ED8F +:10042000F090E6B4EEF0800875820022758200221A +:1004300075820122758284120214758202120214DE +:1004400090E6A27402F090E6A1E4F090E68DF00050 +:10045000000022AC82AD83AEF0FF90E6CEF000004B +:100460000090E6CFEEF000000090E6D0EDF0000046 +:100470000090E6D1ECF022750C40750DE790E6BED9 +:10048000E0F50EA3E0F50F90E6B8E0FF30E733AEFD +:100490000EAF0FC374409EE49F50067E407F0080E5 +:1004A00004AE0EAF0F8E0B750A00C3E50A950B5014 +:1004B00011E50A250CF582E4350DF583E4F0050A13 +:1004C00080E890E6B9E0FFBFB0028009BFB1030247 +:1004D00005A702060390E68AE4F090E68BF090E62A +:1004E000A0E020E1F9850C82850D83E0FC7F007E91 +:1004F000007D00850C82850D83A3E0F879008903D7 +:100500008802E4F94207E94206EA4205EB42048523 +:100510000C82850D83A3A3E0F879007A008A038911 +:10052000028801E44207E94206EA4205EB420485FB +:100530000C82850D83A3A3A3E0F879007A007B00E9 +:10054000903C00E84FF0E94EA3F0EA4DA3F0EB4CED +:10055000A3F090E6BAE0FEA3E05306C07F00BE0021 +:1005600005BF00028003020607C28590E6C074F250 +:10057000F000000090E6187410F0000000D28590A2 +:10058000000A121631903C00E0FCA3E0FDA3E0FE5F +:10059000A3E08C828D838EF0120453C282C28375D5 +:1005A000BB000000008060750A0AE5BB20E726AFAB +:1005B0000A150AEF701774FCC0E07422C0E0748062 +:1005C000C0E012193915811581158180089000014C +:1005D00012163180D590E6BAE0FEA3E05306C07F44 +:1005E00000BE000FBF000CD283D28290E601E05320 +:1005F000E0FCF090E68AE4F090E6BEE0FF90E68B47 +:10060000F08004758201227582002290E6B9E0FF35 +:1006100024F350030206C6EF240A83F582EF241167 +:1006200083F583E4733F50616A61D5837A93D5ABD8 +:10063000C3D50606060606060606060606060612C2 +:10064000023DE58260012290E6A0E043E001F02255 +:100650001202D2E58260012290E6A0E043E001F0C0 +:100660002290E6A0E043E001F022120328E5827028 +:100670006490E6A0E043E001F02290E6A0E043E0D1 +:1006800001F022120381E582704B90E6A0E043E086 +:1006900001F022902253E493FF90E740F090E68A25 +:1006A000E4F090E68B04F000000022902259E493DD +:1006B000FF90E740F090E68AE4F090E68B04F000CB +:1006C000000022020434120477E582600890E6A05C +:1006D000E043E001F02290E61174A0F000000090E9 +:1006E000E61074A0F000000090E61274A0F0000084 +:1006F0000090E613E4F000000090E614E4F000003F +:100700000090E615E4F000000090E68DE4F00000B3 +:100710000090E68DE4F000000090E68FE4F0000029 +:100720000090E68FE4F000000090E6047480F00092 +:10073000000090E6047402F000000090E604E4F08B +:1007400000000090E618E4F000000090E618741035 +:10075000F000000022D2AFD2E843D82090E668E053 +:1007600043E009F090E65EE043E00CF090E65F7451 +:100770000CF090E65CE043E001F090E65D7401F07F +:100780002290E6707401F075B2EF7580FFD282D2CC +:1007900083D28575B3EF7590FFD290C291C292C299 +:0F07A00093D29590E671E4F075B4EF75A0FF2247 +:10223C0012010002FFFFFF404E584E420000010207 +:10224C000301090227000101048032090400000384 +:10225C00FFFFFF0007050102400000070581024057 +:10226C0000000705020200020007058402000200BC +:10227C00070506020002000705080200020004031D +:10228C00090422034E0061006E006F0058007000BC +:10229C006C006F00720065002C00200053004100A0 +:1022AC0053002E001C0341004E004700490045001E +:1022BC002000410064006100700074006500720031 +:1022CC000E033000300030003000300031001A03B3 +:1022DC004A005400410047002000410064006100A6 +:1022EC0070007400650072008E22B022CC22DA22BB +:1022FC004750494620646F6E652074696D65206F88 +:04230C0075740A00DA +:1007AF007F00E5102480F582E434E7F583E0FE60F6 +:1007BF005DBE010302091EBE0203020849BE030308 +:1007CF0002094ABE0403020872BE0503020973BE82 +:1007DF00200302089FBE21030209A0BE22030208C4 +:1007EF00DBBE23030209DCBE2403020A1FBE25035E +:1007FF00020A62BE2603020AA5BE2703020ADEBE54 +:10080F002803020B1ABE2A03020B98020B9C7E05CB +:10081F00AD100DED3395E0FCED2480F582EC34E75F +:10082F00F583E0FFE51004F582851126C007C006A9 +:10083F00120C1AD006D007020B9EAD100DED33959A +:10084F00E0FCED2480F582EC34E7F583E02405FE2F +:10085F00E51004F582C007C006120ECED006D007F1 +:10086F00020B9EAD100DED3395E0FCED2480F5826B +:10087F00EC34E7F583E0FF2405FEE51004F58285EF +:10088F00113DC007C006121195D006D007020B9E6E +:10089F007E02AD100DED3395E0FCED2480F582EC7A +:1008AF0034E7F583E0FDAC100C0CEC3395E0FBEC7A +:1008BF002480F582EB34E7F583E0F5188D82C007CD +:1008CF00C006121541D006D007020B9E7E02AD1056 +:1008DF000DED3395E0FCED2480F582EC34E7F583E4 +:1008EF00E0FD7C00AB100B0BEB3395E0FAEB2480B3 +:1008FF00F582EA34E7F583E0FAE44DF582EA4CF548 +:10090F0083C007C0061214E5D006D007020B9E7EE7 +:10091F0005AD100DED3395E0FCED2480F582EC3440 +:10092F00E7F583E0FFE51004F58285112CC007C0C1 +:10093F0006120D5ED006D007020B9EAD100DED33E3 +:10094F0095E0FCED2480F582EC34E7F583E0240597 +:10095F00FEE51004F582C007C00612101CD006D0A9 +:10096F0007020B9EAD100DED3395E0FCED2480F5E5 +:10097F0082EC34E7F583E0FF2405FEE51004F582F1 +:10098F00851144C007C00612132BD006D007020BE7 +:10099F009E7E02AD100DED3395E0FCED2480F582C7 +:1009AF00EC34E7F583E0FDAC100C0CEC3395E0FB79 +:1009BF00EC2480F582EB34E7F583E0F5188D82C0E7 +:1009CF0007C00612156DD006D007020B9E7E02AD32 +:1009DF00100DED3395E0FCED2480F582EC34E7F556 +:1009EF0083E0FD7C00AB100B0BEB3395E0FAEB24AF +:1009FF0080F582EA34E7F583E0FAE44DF582EA4CBC +:100A0F00F583C007C006121508D006D007020B9E4B +:100A1F007E02AD100DED3395E0FCED2480F582ECF8 +:100A2F0034E7F583E0FD7C00AB100B0BEB3395E067 +:100A3F00FAEB2480F582EA34E7F583E0FAE44DF52A +:100A4F0082EA4CF583C007C0061215FED006D00708 +:100A5F00020B9E7E02AD100DED3395E0FCED248070 +:100A6F00F582EC34E7F583E0FD7C00AB100B0BEB6C +:100A7F003395E0FAEB2480F582EA34E7F583E0FA68 +:100A8F00E44DF582EA4CF583C007C006121631D04B +:100A9F0006D007020B9E7E007F02C007C00612150C +:100AAF00AFAC82AD83D006D007E51124C0F582E448 +:100ABF0034E7F5838D03EBF0AB110BEB3395E0FAD5 +:100ACF00EB24C0F582EA34E7F583ECF0020B9E7E4F +:100ADF0002AD100DED3395E0FCED2480F582EC3482 +:100AEF00E7F583E0FDAC100C0CEC3395E0FBEC2448 +:100AFF0080F582EB34E7F583E0F5188D82C007C0EF +:100B0F00061215C9D006D007020B9E7E05AD100D3B +:100B1F00ED3395E0FCED2480F582EC34E7F583E0CE +:100B2F00FDAC100C0CEC3395E0FBEC2480F582EB64 +:100B3F0034E7F583E0F518AC100C0C0CEC3395E0B2 +:100B4F00FBEC2480F582EB34E7F583E0F519E51033 +:100B5F002404FC3395E0FBEC2480F582EB34E7F5BD +:100B6F0083E0F51AAC10EE2CFC3395E0FBEC2480FF +:100B7F00F582EB34E7F583E0F51B8D82C007C006E5 +:100B8F001215D7D006D00780067E0180027E00EFB7 +:100B9F002511F511AD107F008E037C00EB2DFDECC0 +:100BAF003FFF0DBD00010F90E68DE0FC7B00C3ED14 +:100BBF009CEF64808BF063F08095F04004758201A8 +:100BCF00220EAF10EE2FF5107582002275100075F2 +:100BDF001100E50860FC7508007F00EF7007120731 +:100BEF00AFAF8280F6E511601090E68FE511F0004F +:100BFF000000E50960FC75090090E68DE4F0000047 +:0B0C0F000090E68DE4F000000080C1C2 +:0500CD00E4F53BF53CE9 +:100C1A00E582FF2480F582E434E7F583E0F527EFE7 +:100C2A0004FD3395E0FCED2480F582EC34E7F5838E +:100C3A00E0F52874022FFC3395E0FBEC2480F58262 +:100C4A00EB34E7F583E0C4540FFA53020FEC248027 +:100C5A00F582EB34E7F583E0FC740F5CF529740345 +:100C6A002FF93395E0FBE92480F582EB34E7F5832D +:100C7A00E0FBEF2404F93395E0FFE92480F582EFE5 +:100C8A0034E7F583E0F52AEA60078B188A821215A1 +:100C9A004174F15590FB7A00A827790018B8FF0132 +:100CAA00198A047E00C3EC98EE648089F063F080B0 +:100CBA0095F0502C7E007C008B90EEC313FE7404DA +:100CCA004BF5903094034306800CBC080040E9E5DC +:100CDA00262A24C0F582E434E7F583EEF00A80B8C8 +:100CEA008A06752B00AA297900C3E995285038A8E5 +:100CFA00287F0018B8FF011F89047D00ECB5001198 +:100D0A00EDB5070DEA600A4303021AE52AC313F593 +:100D1A002A8B90E52BC313F52B74044BF590309472 +:100D2A0003432B800980C27408C39528F5F005F0A7 +:100D3A00E52B8002C313D5F0FBFFE5262E24C0F570 +:100D4A0082E434E7F583EFF0EA6008852A188A829C +:100D5A0002154122E582FF2480F582E434E7F58317 +:100D6A00E0F52DEF04FD3395E0FCED2480F582ECEF +:100D7A0034E7F583E0F52E74022FFC3395E0FBECA3 +:100D8A002480F582EB34E7F583E0C4540FFA53026A +:100D9A000FEC2480F582EB34E7F583E0FC740F5CFA +:100DAA00F52F74032FF93395E0FBE92480F582EBE4 +:100DBA0034E7F583E0FBEF2404F93395E0FFE924F7 +:100DCA0080F582EF34E7F583E0F530EA60078B18A7 +:100DDA008A8212156D74F15590FB7A00A82D79005C +:100DEA0018B8FF01198A047E00C3EC98EE64808962 +:100DFA00F063F08095F050427E007C008B90790081 +:100E0A00C3E9952150030980F7EEC313FE74044B1E +:100E1A00F5907900C3E9952150030980F7309403CE +:100E2A004306800CBC080040D3E52C2A24C0F58276 +:100E3A00E434E7F583EEF00A80A28A06753100AA47 +:100E4A002F7900C3E9952E504EA82E7F0018B8FFBF +:100E5A00011F89047D00ECB50011EDB5070DEA60AC +:100E6A000A4303021AE530C313F5308B907F00C39F +:100E7A00EF952150030F80F7E531C313F531740460 +:100E8A004BF5907F00C3EF952150030F80F7309404 +:100E9A00034331800980AC7408C3952EF5F005F040 +:100EAA00E5318002C313D5F0FBFFE52C2E24C0F5F3 +:100EBA0082E434E7F583EFF0EA60088530188A8225 +:100ECA0002156D22E582FF2480F582E434E7F5837A +:100EDA00E0F5328F05ED04FC3395E0FBEC2480F558 +:100EEA0082EB34E7F583E0FC74022DFB3395E0FADC +:100EFA00EB2480F582EA34E7F583E0C4540FF95312 +:100F0A00010FEB2480F582EA34E7F583E0FB740FE6 +:100F1A005BF53374032DF83395E0FAE82480F58203 +:100F2A00EA34E7F583E0FAED2404F83395E0FDE8C6 +:100F3A002480F582ED34E7F583E0F534E9600F8A21 +:100F4A00188982C007C004121541D004D00774F969 +:100F5A005590FA7900A8327B0018B8FF011B890561 +:100F6A007E00C3ED98EE64808BF063F08095F050BC +:100F7A0037EF292405FE3395E0FDEE2480F582ED56 +:100F8A0034E7F583E0FE7D00EE30E0054302088099 +:100F9A00035302F78A90EEC313FE74044AF5900DC8 +:100FAA00BD080040E30980ADEF292405FF3395E031 +:100FBA00FEEF2480F582EE34E7F583E0F535AE33B3 +:100FCA007D00C3ED9C503FE53530E00543020880C3 +:100FDA00035302F78C017B0019B9FF011B8D007FB7 +:100FEA0000E8B50111EFB5030DEE600A4302021ED7 +:100FFA00E534C313F5348A90E535C313F535740423 +:10100A004AF5900D80BCEE60088534188E82021570 +:10101A004122E582F5362480F582E434E7F583E05F +:10102A00F537E536FD04FC3395E0FBEC2480F582C8 +:10103A00EB34E7F583E0FC74022DFB3395E0FAEB21 +:10104A002480F582EA34E7F583E0C4540FF95301AA +:10105A000FEB2480F582EA34E7F583E0FB740F5B3B +:10106A00F53874032DF83395E0FAE82480F582EA1E +:10107A0034E7F583E0FAED2404F83395E0FDE8243B +:10108A0080F582ED34E7F583E0F539E9600B8A18DB +:10109A008982C00412156DD00474F95590FA79004A +:1010AA00A8377B0018B8FF011B89067F00C3EE989A +:1010BA00EF64808BF063F08095F0504EE53629247A +:1010CA0005FF3395E0FEEF2480F582EE34E7F583E1 +:1010DA00E0FF7E00EF30E00543020880035302F789 +:1010EA008A907B00C3EB952250030B80F7EFC31362 +:1010FA00FF74044AF5907B00C3EB952250030B80E2 +:10110A00F70EBE080040CD098096E536292405F978 +:10111A003395E0FFE92480F582EF34E7F583E0F5C3 +:10112A003AAE387B00C3EB9C5055E53A30E00543B4 +:10113A00020880035302F78C00790018B8FF0119DE +:10114A008B057F00EDB50011EFB5010DEE600A4386 +:10115A0002021EE539C313F5398A907F00C3EF9561 +:10116A002250030F80F7E53AC313F53A74044AF59F +:10117A00907F00C3EF952250030F80F70B80A6EEF5 +:10118A0060088539188E8202156D22AF82053BE40C +:10119A00B53B02053CEF2480F582E434E7F583E0B1 +:1011AA00F53E8F05ED04FC3395E0FBEC2480F582D7 +:1011BA00EB34E7F583E0F53F74022DFB3395E0FA53 +:1011CA00EB2480F582EA34E7F583E0C4540FF9533F +:1011DA00010FEB2480F582EA34E7F583E0FB740F14 +:1011EA005BF54074032DF83395E0FAE82480F58224 +:1011FA00EA34E7F583E0FAED2404F83395E0FDE8F4 +:10120A002480F582ED34E7F583E0F541E9600B8A45 +:10121A00188982C007121541D00774F95590FA79D6 +:10122A0000A83E7B0018B8FF011B89057E00C3EDAC +:10123A0098EE64808BF063F08095F0504CEF29248F +:10124A0005FE3395E0FDEE2480F582ED34E7F58363 +:10125A00E0FE7D007B00EE30E00543020880035388 +:10126A0002F78A90EEC313FE74044AF590EDA29435 +:10127A0013FD0BBB080040DEE53D2924C0F582E4DE +:10128A0034E7F583EDF00980988906EF292405FFF4 +:10129A003395E0FDEF2480F582ED34E7F583E0F540 +:1012AA0042754300AB407900C3E9953F5046E54299 +:1012BA0030E00543020880035302F7A83F7F001875 +:1012CA00B8FF011F89047D00ECB50011EDB5070DCB +:1012DA00EB600A4302021BE541C313F5418A90E51C +:1012EA0042C313F54274044AF590E543A29413F5F8 +:1012FA00430980B47408C3953FF5F005F0E54380CF +:10130A0002C313D5F0FBFFE53D2E24C0F582E43479 +:10131A00E7F583EFF0EB60088541188B82021541EF +:10132A0022E582F5452480F582E434E7F583E0F589 +:10133A0046E545FD04FC3395E0FBEC2480F582EBA1 +:10134A0034E7F583E0F54774022DFB3395E0FAEBB9 +:10135A002480F582EA34E7F583E0C4540FF9530197 +:10136A000FEB2480F582EA34E7F583E0FB740F5B28 +:10137A00F54874032DF83395E0FAE82480F582EAFB +:10138A0034E7F583E0FAED2404F83395E0FDE82428 +:10139A0080F582ED34E7F583E0F549E960078A18BC +:1013AA00898212156D74F95590FA7900A8467B0066 +:1013BA0018B8FF011B89067F00C3EE98EF64808B83 +:1013CA00F063F08095F05064E545292405FF3395D4 +:1013DA00E0FEEF2480F582EE34E7F583E0FF7E003D +:1013EA007B00EF30E00543020880035302F78A903E +:1013FA007800C3E8952350030880F7EFC313FF74FE +:10140A00044AF5907800C3E8952350030880F7EE64 +:10141A00A29413FE0BBB080040C8E5442924C0F57A +:10142A0082E434E7F583EEF0090213B68907E5454D +:10143A00292405F93395E0FEE92480F582EE34E7A4 +:10144A00F583E0F54A754B00A9487800C3E895474B +:10145A00505CE54A30E00543020880035302F7ADC9 +:10146A00477E001DBDFF011E88037C00EBB50511F8 +:10147A00ECB5060DE9600A43020219E549C313F502 +:10148A00498A907E00C3EE952350030E80F7E54A01 +:10149A00C313F54A74044AF5907E00C3EE952350AF +:1014AA00030E80F7E54BA29413F54B08809E74084F +:1014BA00C39547F5F005F0E54B8002C313D5F0FB61 +:1014CA00FEE5442F24C0F582E434E7F583EEF0E923 +:1014DA006008854918898202156D22AE82AF83742D +:1014EA00FB5590FD7B007C00C3EB9EEC9F500E8D5C +:1014FA009074044DF5900BBB00EE0C80EB22AE828B +:10150A00AF8374FB5590FD7B007C00C3EB9EEC9F80 +:10151A0050248D907A00C3EA952450030A80F77408 +:10152A00044DF5907A00C3EA952450030A80F70B1C +:10153A00BB00D80C80D522AF8274FB5590FE7D008B +:10154A00C3ED9F501DE51830E005430602800353A2 +:10155A0006FD8E90E518C313F51874044EF5900D28 +:10156A0080DE22AF8274FB5590FE7D00C3ED9F5052 +:10157A0033E51830E00543060280035306FD8E90DA +:10158A007C00C3EC952550030C80F7E518C313F5CE +:10159A001874044EF5907C00C3EC952550030C801A +:1015AA00F70D80C8227F003094027F01742F559076 +:1015BA00FE8F05E4FFFCEE4FF582EC4DF58322E544 +:1015CA0082542FF45290742F55184290228582210A +:1015DA00851822851923851A24851B252200227E37 +:1015EA00567F02EE24FFFCEF34FFFD8C068D07ECDC +:1015FA004D70F022751805751900121815AE82AFD4 +:10160A00837C007D00C3EC9EED9F501AC007C00684 +:10161A00C005C0041215E7D004D005D006D0070CC7 +:10162A00BC00E20D80DF22AE82AF837C007D00C366 +:10163A00EC9EED9F501AC007C006C005C0041215E3 +:10164A00E9D004D005D006D0070CBC00E20D80DF3B +:01165A00226D +:03004300023E007A +:103E00000201100002016000020161000201620073 +:103E10000201630002016400020165000201660004 +:103E200002016700020168000201690002018200CC +:103E300002019B0002019F000201A0000201A100FB +:103E40000201A200020166000201A3000201A40017 +:103E50000201A5000201A6000201A7000201A800BC +:103E60000201A9000201660002016600020166006B +:103E70000201AA000201AB000201AC000201AD0088 +:103E80000201AE000201AF000201B0000201B10068 +:103E90000201B2000201B3000201B4000201B50048 +:103EA0000201B6000201B7000201B8000201B90028 +:083EB0000201BA000201BB008F +:10165B00D310AF01C3C0D085821285831385F014DC +:10166B00F51590E600E05418C423541F70057A0159 +:10167B00FB801C90E600E05418C423541FF9B901F9 +:10168B00067802790080047804790088028903D2F5 +:10169B00CDD2CC8A18751900751A00751B00907184 +:1016AB00B075F00BE4C0021218A38512188513193C +:1016BB0085141A85151B12183EAC82AD83AEF0FF54 +:1016CB00D0020CBC00090DBD00050EBE00010FEFD2 +:1016DB00C313EE13ED13FDEC13FC74FFC39CFC74EE +:1016EB00FF9DFD8DCBEA60067E017F0080047E00AE +:1016FB007F00EE2CF5CAD2CAC29FD29EC29DD29C4D +:10170B00438780D299D0D092AF223098FDAF99C247 +:10171B00987E008F828E8322AF8210990280FB8F7E +:10172B009922AF82BF0A0A75820DC007121723D008 +:10173B00078F82C007121723D007BF0D0A75820AC5 +:10174B00C007121723D0077E008F828E832290E66C +:10175B000174EEF090E6F574FFF09023B4E49390EF +:10176B00E6F3F09023B5E49390E6C3F09023B6E450 +:10177B009390E6C1F09023B7E49390E6C2F09023E8 +:10178B00B9E49390E6C0F09023BAE49390E6F4F0BA +:10179B0075AF077E107F238F9A759B10759DE4752F +:1017AB009E007F0090E67BE090E67CF00FBF800010 +:1017BB0040F200000090E6C4E4F000000090E6C5A3 +:1017CB00E4F09023909390E6C6F0902391E49390ED +:1017DB00E6C7F0902392E49390E6C8F0902393E44D +:1017EB009390E6C9F0902394E49390E6CAF090238B +:1017FB0095E49390E6CBF0902396E49390E6CCF0AF +:0A180B00902397E49390E6CDF022BD +:10231000013F01010101010702070202020202005E +:102320000407070707070707000900000000003F30 +:1023300088013F01010101070102050000000000C2 +:102340000705070707070707090009000000003F06 +:10235000010101010101010700000000000000006F +:102360000707070707070707000000000000003FF6 +:10237000010101010101010700000000000000004F +:102380000707070707070707000000000000003FD6 +:10239000000000000000000000000000000000003D +:1023A000000000000000000000000000000000002D +:0B23B00000000000E0000007EEF2005B +:101815007A10E4FBFCE58225E0F582E58333F58368 +:10182500EB33FBEC33FCEB9518F5F0EC9519400622 +:10183500FCABF0438201DADD22FB7A20E4FCFDFEFD +:10184500FFE5822582F582E58333F583E5F033F5FF +:10185500F0EB33FB4017DAE98042E5822582F58219 +:10186500E58333F583E5F033F5F0EB33FBEC33FC3F +:10187500ED33FDEE33FEEF33FFEC9518ED9519EEE4 +:10188500951AEF951B4013EC9518FCED9519FDEE97 +:0E189500951AFEEF951BFF438201DABEEB228F +:0600A000E478FFF6D8FD34 +:10007E007900E94400601B7A009023C6780475A0CD +:10008E003CE493F2A308B8000205A0D9F4DAF275A5 +:02009E00A0FFC1 +:1018A300AAF0FBE5828518F0A4FCADF0E58385186A +:1018B300F0A42DFDE435F0FEE5828519F0A42DFD9D +:1018C300E5F03EFEE433FFEA8518F0A42EFEE5F0D2 +:1018D3003FFFE5838519F0A42EFEE5F03FFFE58287 +:1018E300851AF0A42EFEE5F03FFFEB8518F0A42F38 +:1018F300FFEA8519F0A42FFFE583851AF0A42FFFD3 +:0E190300E582851BF0A42F8EF08D838C82224E +:1000A6007800E84400600A790075A03CE4F309D8BA +:1000B600FC7804E84400600C7901903C00E4F0A36D +:0400C600D8FCD9FA8F +:10191100C0178581177E008E8312172DD01722855F +:10192100825C85835D85F05EE4F559F55AF55B854A +:10193100165F9019110219FFC017E581F51724FBF5 +:10194100FF8F5FE4F559F55AF55BE51724FBF8863F +:101951005C08865D08865E9019111219FFD0172266 +:10196100AF82C04FC050C05112196E8007C04DC028 +:101971004E8F82221581158115810557E4B55702D5 +:10198100055822AF8274302FFF24C6500B74072FE5 +:10199100FFE54C60034307208F82021961E582FF56 +:1019A100C4540FF582C007121984D007740F5FF574 +:1019B10082021984858218AB52AC53AD54AE55AA3C +:1019C10056751A208A07EF2FF519EE235401451990 +:1019D100FAEB2BFBEC33FCED33FDEE33FEC3EA9562 +:1019E100184008EAC39518FA430301E51A14FF8F5A +:1019F1001A70D18B528C538D548E558A5622858202 +:101A01004D85834E85594F855A50855B51E4F55775 +:101A1100F558AD5CAE5DAF5E8D828E838FF0122284 +:101A21001CFC74012DF55CE43EF55D8F5EECFF70EE +:101A3100030221E0BF250280030221D87E007D0040 +:101A41008E608E617A007B008E627C008E63E4F58D +:101A51006BF56C7564FF7565FF855C6D855D6E85E5 +:101A61005E6F856D82856E83856FF012221CF57025 +:101A7100A385826D85836E856D5C856E5D856F5EE8 +:101A81007425B57008857082121961808574D0251E +:101A9100704003021B41E57024C65003021B4174D0 +:101AA100FFB56455B56552856B18856C1990000AB0 +:101AB100C006C005C004C003C0021221FF858271A7 +:101AC100858372D002D003D004D005D0068570730F +:101AD100757400E5732571F573E5743572F574E578 +:101AE1007324D0F56BE57434FFF56CE56B456C60E0 +:101AF10003021A637D01021A6385641885651990D2 +:101B0100000AC006C005C004C003C0021221FF853F +:101B11008273858374D002D003D004D005D00685AA +:101B21007071757200E5712573F573E5723574F5A1 +:101B310074E57324D0F564E57434FFF565021A6326 +:101B4100742EB5701574FFB56405B5650280030286 +:101B51001A63E4F564F565021A63749F2570500EEB +:101B6100E570248540085370DF754C018003754C86 +:101B7100007420B57003021C0D742BB57003021C98 +:101B810007742DB5700280797442B57003021C137D +:101B91007443B57003021C1E7444B57003021E6BBE +:101BA1007446B57003021E817448B57003021A634E +:101BB1007449B57003021E6B744AB57003021A634F +:101BC100744CB570028050744FB57003021E72746C +:101BD10050B57003021DB67453B57002807674540B +:101BE100B57003021A637455B57003021E777458F9 +:101BF100B57003021E7C745AB57003021A63021E8B +:101C0100857E01021A63756001021A637561010222 +:101C11001A637B01021A63756201021A63EB600A9F +:101C2100E55F14F9895F8773800DE55F24FEF57127 +:101C310085715FA9718773857382C006C005C00471 +:101C4100C003C002121961D002D003D004D005D064 +:101C510006021EA7E55F24FDF57385735FA97387EF +:101C61006D09876E09876F1919856D52856E5385C8 +:101C71006F54856D82856E83856FF0C006C005C087 +:101C810004C003C0021221E7858273858374D002E8 +:101C9100D003D004D005D00674FFB56409B565063C +:101CA100857364857465EE704FC3E573956BE57458 +:101CB100956C5044E56BC39573F571E56C9574F5BE +:101CC1007285716D85726E157174FFB57102157231 +:101CD100E56D456E601C758220C006C005C004C05C +:101CE10003C002121961D002D003D004D005D0067E +:101CF10080CF85716B85726C856471856572855243 +:101D0100828553838554F012221CF56D856D6860C0 +:101D11004FC3E4957174808572F063F08095F05043 +:101D21003F157174FFB571021572856882C006C0D6 +:101D310005C004C003C002121961D002D003D0044F +:101D4100D005D00685526D85536E85546F056DE4BF +:101D5100B56D02056E856D52856E53856F54809EFB +:101D6100EE7003021EA7C3E573956BE574956C4095 +:101D710003021EA7E56BC39573F573E56C9574F5C6 +:101D810074857371857472157374FFB5730215745C +:101D9100E57145727003021EA1758220C006C0055F +:101DA100C004C003C002121961D002D003D004D014 +:101DB10005D00680CCE55F24FDF57185715FA971C1 +:101DC100876D09876E09876F1919856D52856E5365 +:101DD100856F5485546974802569500575714380F8 +:101DE1001974A025695005757150800E74C025695C +:101DF10050057571498003757158857182C006C09F +:101E010005C004C003C00212196175823A1219613A +:101E1100758230121961758278121961D002D0036E +:101E2100D004D005D0067449B5710280217450B533 +:101E31007102801A855382C006C005C004C003C068 +:101E41000212199ED002D003D004D005D0068552CB +:101E510082C006C005C004C003C00212199ED00290 +:101E6100D003D004D005D006803C7A0175630A8086 +:101E710035756308803075630A802B756310802681 +:101E81007C018022857082C006C005C004C003C0E9 +:101E910002121961D002D003D004D005D006800609 +:101EA10085736B85746CEC6068E55F24FCFC8C5F6A +:101EB1008C01877509877609877709877819191938 +:101EC1008575528576538577548578557552BB75DE +:101ED10053237554808552758553768554777401E3 +:101EE1002575F56DE43576F56E85776F856D5285CF +:101EF1006E53856F548575828576838577F01222BE +:101F01001CFC8C757003021A13857582121961808D +:101F1100C4E5637003021A13EB603FE55F14F989AE +:101F21005F87048C75757600757700757800857507 +:101F310052857653857754857855EA6003021FC42C +:101F410085527575760075770075780085755285AF +:101F510076538577548578558069E5626025E55F1C +:101F610024FCFC8C5F8C01877509877609877709CA +:101F7100877819191985755285765385775485782F +:101F8100558040E55F24FEFC8C5F8C018703098747 +:101F910004198B75ECF5763395E0F577F578857551 +:101FA10052857653857754857855EA701685527532 +:101FB100855376F577F5788575528576538577540F +:101FC100857855EA602AE55530E723C3E49552F553 +:101FD10075E49553F576E49554F577E49555F578E0 +:101FE10085755285765385775485785580027A00B8 +:101FF1007C01797EE4F575F576755600856382C0BE +:1020010006C005C004C002C0011219B5D001D0023A +:10201100D004D005D006EC700DE556C4F573E7FB8E +:102021004573F7198002A7560575E4B57502057663 +:10203100ECB40100E433FCE5524553455445557079 +:10204100B8896A857566857667E56B456C70057537 +:102051006B01F56CED7043EE7040856B75856C76A8 +:10206100AB660B8B73757400C3E5739575E5749559 +:10207100765021758220C006C005C004C002121925 +:1020810061D002D004D005D006157574FFB5750274 +:10209100157680CC85756B85766CEA601D75822D11 +:1020A100C006C005C004121961D004D005D00615C0 +:1020B1006B74FFB56B02156C8046E5664567604041 +:1020C100E560601D75822BC006C005C00412196150 +:1020D100D004D005D006156B74FFB56B02156C806A +:1020E1001FE561601B758220C006C005C00412197E +:1020F10061D004D005D006156B74FFB56B02156C69 +:10210100EE703C856B75856C76AA75AB761575742A +:10211100FFB575021576C3E5669AE5679B5041EDFB +:1021210060067A307B0080047A207B008A82C006B8 +:10213100C005C004121961D004D005D00680CAC3FD +:10214100E566956BE567956C500FE56BC39566F594 +:1021510073E56C9567F574800DE4F573F57480068D +:10216100857573857674A96A856675856776AA759E +:10217100AD76157574FFB575021576EA4D602EECD6 +:10218100B40100E433FC700A09E7C4540FFD8D5615 +:1021910080078705740F5DF556855682C006C00419 +:1021A100C001121984D001D004D00680C1EE7003A1 +:1021B100021A13AD73AE748D038E041DBDFF011E93 +:1021C100EB4C7003021A13758220C006C005121968 +:1021D10061D005D00680E08F82121961021A138541 +:0621E1005782855883229D +:0B23BB003C4E4F20464C4F41543E006A +:1021E700AA82AB8312221C6003A380F8C3E5829AFC +:1021F700F582E5839BF58322E5828518F0A4C582E5 +:10220700C0F08519F0A4D0F025F0C5838518F0A497 +:052217002583F5832280 +:0D00710075817E122238E582600302006E68 +:10221C0020F71430F6148883A88220F507E6A883EB +:10222C0075830022E280F7E49322E022758200227B +:00000001FF diff --git a/src/jtag/drivers/ANGIE/include/delay.h b/src/jtag/drivers/ANGIE/include/delay.h new file mode 100755 index 0000000000..40f3c6ecbc --- /dev/null +++ b/src/jtag/drivers/ANGIE/include/delay.h @@ -0,0 +1,238 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/*************************************************************************** +* File : delay.h * +* Contents : Delays handling header file for NanoXplore * +* USB-JTAG ANGIE adapter hardware. * +* * +* Based on openULINK project code by: Martin Schmoelzer. * +* * +**************************************************************************** +* Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. * +* <abo...@na...> * +***************************************************************************/ + +#ifndef __DELAY_H +#define __DELAY_H + +#include <stdint.h> + +#define NOP { __asm nop __endasm; } +#define _nop_( ) NOP + +void delay_5us(void); +void delay_1ms(void); +void delay_us(uint16_t delay); +void delay_ms(uint16_t delay); + +#ifndef _IFREQ +#define _IFREQ 48000 /* IFCLK frequency in kHz */ +#endif + +/* CFREQ can be any one of: 48000, 24000, or 12000 */ +#ifndef _CFREQ +#define _CFREQ 48000 /* CLKOUT frequency in kHz */ +#endif + +#if( _IFREQ < 5000 ) +#error "_IFREQ too small! Valid Range: 5000 to 48000..." +#endif + +#if( _IFREQ > 48000 ) +#error "_IFREQ too large! Valid Range: 5000 to 48000..." +#endif + +#if( _CFREQ != 48000 ) +#if( _CFREQ != 24000 ) +#if( _CFREQ != 12000 ) +#error "_CFREQ invalid! Valid values: 48000, 24000, 12000..." +#endif +#endif +#endif + +/* Synchronization Delay formula: see TRM section 15-14 */ +#define _SCYCL ( 3*(_CFREQ) + 5*(_IFREQ) - 1 ) / ( 2*(_IFREQ) ) + +#if( _SCYCL == 1 ) +#define SYNCDELAY _nop_( ) +#endif + +#if( _SCYCL == 2 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ) +#endif + +#if( _SCYCL == 3 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ); \ + _nop_( ) +#endif + +#if( _SCYCL == 4 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ) +#endif + +#if( _SCYCL == 5 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ) +#endif + +#if( _SCYCL == 6 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ) +#endif + +#if( _SCYCL == 7 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ) +#endif + +#if( _SCYCL == 8 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ) +#endif + +#if( _SCYCL == 9 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ) +#endif + +#if( _SCYCL == 10 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ) +#endif + +#if( _SCYCL == 11 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ) +#endif + +#if( _SCYCL == 12 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ) +#endif + +#if( _SCYCL == 13 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ) +#endif + +#if( _SCYCL == 14 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ) +#endif + +#if( _SCYCL == 15 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ) +#endif + +#if( _SCYCL == 16 ) +#define SYNCDELAY _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ); \ + _nop_( ) +#endif +#endif \ No newline at end of file diff --git a/src/jtag/drivers/ANGIE/include/fx2macros.h b/src/jtag/drivers/ANGIE/include/fx2macros.h new file mode 100644 index 0000000000..a30fb79d5d --- /dev/null +++ b/src/jtag/drivers/ANGIE/include/fx2macros.h @@ -0,0 +1,46 @@ +/** + * This code was taken from the fx2lib project from this link: + * https://github.com/djmuhlestein/fx2lib + * + * Copyright (C) 2009 Ubixum, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/*! \file + * Macros for simple common tasks in fx2 firmware. + * */ + +#ifndef FX2MACROS_H +#define FX2MACROS_H + +#include "reg_ezusb.h" + +typedef enum { + FALSE=0, + TRUE +} BOOL_VALS; + +/** + * \brief Used for getting and setting the CPU clock speed. + **/ +typedef enum { CLK_12M =0, CLK_24M, CLK_48M} CLK_SPD; + +/** + * \brief Evaluates to a CLK_SPD enum. + **/ +#define CPUFREQ (CLK_SPD)((CPUCS & bmCLKSPD) >> 3) + +#endif \ No newline at end of file diff --git a/src/jtag/drivers/ANGIE/include/io.h b/src/jtag/drivers/ANGIE/include/io.h new file mode 100755 index 0000000000..86da64c6ef --- /dev/null +++ b/src/jtag/drivers/ANGIE/include/io.h @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/*************************************************************************** +* File : io.h * +* Contents : input/output declaration header file for NanoXplore * +* USB-JTAG ANGIE adapter hardware. * +* * +* Based on openULINK project code by: Martin Schmoelzer. * +* * +**************************************************************************** +* Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. * +* <abo...@na...> * +***************************************************************************/ + +#ifndef __IO_H +#define __IO_H + +#include "reg_ezusb.h" + +/*************************************************************************** + * JTAG Signals: * + *************************************************************************** + * TMS ....... Test Mode Select * + * TCK ....... Test Clock * + * TDI ....... Test Data Input (from device point of view, not JTAG * + * adapter point of view!) * + * TDO ....... Test Data Output (from device point of view, not JTAG * + * adapter point of view!) * + * TRST ...... Test Reset: Used to reset the TAP Finite State Machine * + * into the Test Logic Reset state * + * SRST ..... Chip Reset * + ***************************************************************************/ + +/* PORT A */ +/* PA0 Not Connected */ +/* PA1 Not Connected */ +#define PIN_RDWR_B IOA2 +#define PIN_CSI_B IOA3 +#define PIN_INIT_B IOA4 +#define PIN_PROGRAM_B IOA5 +/* PA6 Not Connected */ +/* PA7 Not Connected */ + +/* PORT B */ +#define PIN_TRST IOB0 +#define PIN_TMS IOB1 +#define PIN_TCK IOB2 +#define PIN_TDI IOB3 +#define PIN_TDO IOB4 +#define PIN_SRST IOB5 +/* PA6 Not Connected */ +/* PA7 Not Connected */ + +/* JTAG Signals with direction 'OUT' on port B */ +/* PIN_TDI - PIN_TCK - PIN_TMS - PIN_TRST - PIN_SRST */ +#define MASK_PORTB_DIRECTION_OUT (bmBit0 | bmBit1 | bmBit2 | bmBit3 | bmBit5) + +/* PORT C */ +#define PIN_T0 IOC0 +#define PIN_T1 IOC1 +#define PIN_T2 IOC2 +#define PIN_T3 IOC3 +#define PIN_T4 IOC4 +/* PC5 Not Connected */ +/* PC6 Not Connected */ +/* PC7 Not Connected */ + +#endif \ No newline at end of file diff --git a/src/jtag/drivers/ANGIE/include/jtag.h b/src/jtag/drivers/ANGIE/include/jtag.h new file mode 100755 index 0000000000..e5cb02289d --- /dev/null +++ b/src/jtag/drivers/ANGIE/include/jtag.h @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/*************************************************************************** +* File : jtag.h * +* Contents : Jtag handling functions header file for NanoXplore * +* USB-JTAG ANGIE adapter hardware. * +* * +* Based on openULINK project code by: Martin Schmoelzer. * +* * +**************************************************************************** +* Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. * +* <abo...@na...> * +***************************************************************************/ + +#ifndef __JTAG_H +#define __JTAG_H + +#include <stdint.h> + +#define NOP { __asm nop __endasm; } + +uint16_t jtag_get_signals(void); +void jtag_configure_tck_delay(uint8_t scan_in, uint8_t scan_out, + uint8_t scan_io, uint8_t tck, uint8_t tms); +void jtag_clock_tms(uint8_t count, uint8_t sequence); +void jtag_slow_clock_tms(uint8_t count, uint8_t sequence); +void jtag_set_signals(uint8_t low, uint8_t high); +void jtag_clock_tck(uint16_t count); +void jtag_slow_clock_tck(uint16_t count); +void jtag_scan_in(uint8_t out_offset, uint8_t in_offset); +void jtag_scan_out(uint8_t out_offset); +void jtag_scan_io(uint8_t out_offset, uint8_t in_offset); +void jtag_slow_scan_in(uint8_t out_offset, uint8_t in_offset); +void jtag_slow_scan_out(uint8_t out_offset); +void jtag_slow_scan_io(uint8_t out_offset, uint8_t in_offset); +#endif \ No newline at end of file diff --git a/src/jtag/drivers/ANGIE/include/main.h b/src/jtag/drivers/ANGIE/include/main.h new file mode 100755 index 0000000000..bfa86ec6f2 --- /dev/null +++ b/src/jtag/drivers/ANGIE/include/main.h @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/*************************************************************************** +* File : main.h * +* Contents : main code header file for NanoXplore USB-JTAG ANGIE adapter * +* hardware. * +* * +* Based on openULINK project code by: Martin Schmoelzer. * +* * +**************************************************************************** +* Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. * +* <abo...@na...> * +***************************************************************************/ + +#ifndef __MAIN_H +#define __MAIN_H + +#endif \ No newline at end of file diff --git a/src/jtag/drivers/ANGIE/include/msgtypes.h b/src/jtag/drivers/ANGIE/include/msgtypes.h new file mode 100755 index 0000000000..4928a23685 --- /dev/null +++ b/src/jtag/drivers/ANGIE/include/msgtypes.h @@ -0,0 +1,173 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/*************************************************************************** +* File : msgtypes.h * +* Contents : Definition of the commands supported by NanoXplore * +* USB-JTAG ANGIE adapter hardware. * +* * +* Based on openULINK project code by: Martin Schmoelzer. * +* * +**************************************************************************** +* Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. * +* <ahm...@gm...> * +***************************************************************************/ + +/** + * @file + * Definition of the commands supported by the ANGIE firmware. + * + * Basically, two types of commands can be distinguished: + * - Commands with fixed payload size + * - Commands with variable payload size + * + * SCAN commands (in all variations) carry payloads of variable size, all + * other commands carry payloads of fixed size. + * + * In the case of SCAN commands, the payload size (n) is calculated by + * dividing the scan_size_bits variable by 8, rounding up the result. + * + * Offset zero always contains the command ID. + * + **************************************************************************** + * CMD_SCAN_IN, CMD_SLOW_SCAN_IN: * + * * + * OUT: * + * offset 1: scan_size_bytes * + * offset 2: bits_last_byte * + * offset 3: tms_count_start + tms_count_end * + * offset 4: tms_sequence_start * + * offset 5: tms_sequence_end * + * * + * IN: * + * offset 0..n: TDO data * + **************************************************************************** + * CMD_SCAN_OUT, CMD_SLOW_SCAN_OUT: * + * * + * OUT: * + * offset 1: scan_size_bytes * + * offset 2: bits_last_byte * + * offset 3: tms_count_start + tms_count_end * + * offset 4: tms_sequence_start * + * offset 5: tms_sequence_end * + * offset 6..x: TDI data * + **************************************************************************** + * CMD_SCAN_IO, CMD_SLOW_SCAN_IO: * + * * + * OUT: * + * offset 1: scan_size_bytes * + * offset 2: bits_last_byte * + * offset 3: tms_count_start + tms_count_end * + * offset 4: tms_sequence_start * + * offset 5: tms_sequence_end * + * offset 6..x: TDI data * + * * + * IN: * + * offset 0..n: TDO data * + **************************************************************************** + * CMD_CLOCK_TMS, CMD_SLOW_CLOCK_TMS: * + * * + * OUT: * + * offset 1: tms_count * + * offset 2: tms_sequence * + **************************************************************************** + * CMD_CLOCK_TCK, CMD_SLOW_CLOCK_TCK: * + * * + * OUT: * + * offset 1: low byte of tck_count * + * offset 2: high byte of tck_count * + **************************************************************************** + * CMD_CLOCK_SLEEP_US: * + * * + * OUT: * + * offset 1: low byte of sleep_us * + * offset 2: high byte of sleep_us * + **************************************************************************** + * CMD_CLOCK_SLEEP_MS: * + * * + * OUT: * + * offset 1: low byte of sleep_ms * + * offset 2: high byte of sleep_ms * + **************************************************************************** + * CMD_GET_SIGNALS: * + * * + * IN: * + * offset 0: current state of input signals * + * offset 1: current state of output signals * + **************************************************************************** + * CMD_SET_SIGNALS: * + * * + * OUT: * + * offset 1: signals that should be de-asserted * + * offset 2: signals that should be asserted * + **************************************************************************** + * CMD_CONFIGURE_TCK_FREQ: * + * * + * OUT: * + * offset 1: delay value for scan_in function * + * offset 2: delay value for scan_out function * + * offset 3: delay value for scan_io function * + * offset 4: delay value for clock_tck function * + * offset 5: delay value for clock_tms function * + **************************************************************************** + * CMD_SET_LEDS: * + * * + * OUT: * + * offset 1: LED states: * + * Bit 0: turn COM LED on * + * Bit 1: turn RUN LED on * + * Bit 2: turn COM LED off * + * Bit 3: turn RUN LED off * + * Bits 7..4: Reserved * + **************************************************************************** + * CMD_TEST: * + * * + * OUT: * + * offset 1: unused dummy value * + **************************************************************************** + */ + +#ifndef __MSGTYPES_H +#define __MSGTYPES_H + +/* + * Command IDs: + * + * Bits 7..6: Reserved, should always be zero + * Bits 5..0: Command ID. There are 62 usable IDs. Of this 63 available IDs, + * the IDs 0x00..0x1F are commands with variable payload size, + * the IDs 0x20..0x3F are commands with fixed payload size. + */ + +#define CMD_ID_MASK 0x3F + +/* Commands with variable payload size */ +#define CMD_SCAN_IN 0x00 +#define CMD_SLOW_SCAN_IN 0x01 +#define CMD_SCAN_OUT 0x02 +#define CMD_SLOW_SCAN_OUT 0x03 +#define CMD_SCAN_IO 0x04 +#define CMD_SLOW_SCAN_IO 0x05 + +/* Commands with fixed payload size */ +#define CMD_CLOCK_TMS 0x20 +#define CMD_SLOW_CLOCK_TMS 0x21 +#define CMD_CLOCK_TCK 0x22 +#define CMD_SLOW_CLOCK_TCK 0x23 +#define CMD_SLEEP_US 0x24 +#define CMD_SLEEP_MS 0x25 +#define CMD_GET_SIGNALS 0x26 +#define CMD_SET_SIGNALS 0x27 +#define CMD_CONFIGURE_TCK_FREQ 0x28 +#define CMD_SET_LEDS 0x29 +#define CMD_TEST 0x2A + +/* JTAG signal definition for jtag_get_signals() -- Input signals! */ +#define SIGNAL_TDO (1<<0) + +/* JTAG signal definition for jtag_get_signals() -- Output signals! */ +#define SIGNAL_TDI (1<<3) +#define SIGNAL_TMS (1<<1) +#define SIGNAL_TCK (1<<2) +#define SIGNAL_TRST (1<<0) +#define SIGNAL_SRST (1<<5) + +#endif \ No newline at end of file diff --git a/src/jtag/drivers/ANGIE/include/protocol.h b/src/jtag/drivers/ANGIE/include/protocol.h new file mode 100755 index 0000000000..bb4163e2c6 --- /dev/null +++ b/src/jtag/drivers/ANGIE/include/protocol.h @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/*************************************************************************** +* File : protocol.h * +* Contents : Jtag commands handling protocol header file for NanoXplore * +* USB-JTAG ANGIE adapter hardware. * +* * +* Based on openULINK project code by: Martin Schmoelzer. * +* * +**************************************************************************** +* Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. * +* <abo...@na...> * +***************************************************************************/ + +#ifndef __PROTOCOL_H +#define __PROTOCOL_H + +#include <stdbool.h> + +bool execute_command(void); +void command_loop(void); + +#endif \ No newline at end of file diff --git a/src/jtag/drivers/ANGIE/include/reg_ezusb.h b/src/jtag/drivers/ANGIE/include/reg_ezusb.h new file mode 100755 index 0000000000..98c6ef3273 --- /dev/null +++ b/src/jtag/drivers/ANGIE/include/reg_ezusb.h @@ -0,0 +1,658 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/*************************************************************************** +* File : reg_ezusb.h * +* Contents : FX2 microcontroller registers file for NanoXplore * +* USB-JTAG ANGIE adapter hardware. * +* * +* Based on openULINK project code by: Martin Schmoelzer. * +* * +**************************************************************************** +* Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. * +* <abo...@na...> * +***************************************************************************/ + +#ifndef REG_EZUSB_H +#define REG_EZUSB_H + +/** + * @file + * All information in this file was taken from the EZ-USB FX2 Technical + * Reference Manual, Cypress Semiconductor, 3901 North First Street + * San Jose, CA 95134 (www.cypress.com). + * + * The EZ-USB Technical Reference Manual is called "EZ-USB FX2 TRM" hereafter. + */ + +/* Compiler-specific definitions of SBIT, SFR, SFRX, ... macros */ +#include <mcs51/compiler.h> + +/* Bit vectors */ +#define bmBit0 0x01 +#define bmBit1 0x02 +#define bmBit2 0x04 +#define bmBit3 0x08 +#define bmBit4 0x10 +#define bmBit5 0x20 +#define bmBit6 0x40 +#define bmBit7 0x80 + +/************************************************************************** + ************************ Special Function Registers ********************** + ***************************************************************************/ +SFR(IOA, 0x80); +SBIT(IOA0, 0x80, 0); +SBIT(IOA1, 0x80, 1); +SBIT(IOA2, 0x80, 2); +SBIT(IOA3, 0x80, 3); +SBIT(IOA4, 0x80, 4); +SBIT(IOA5, 0x80, 5); +SBIT(IOA6, 0x80, 6); +SBIT(IOA7, 0x80, 7); + +SFR(SP, 0x81); +SFR(DPL0, 0x82); +SFR(DPH0, 0x83); +SFR(DPL1, 0x84); +SFR(DPL2, 0x85); + +SFR(DPS, 0x86); +#define SEL bmBit0 +/* Bit 1 read-only, always reads '0' */ +/* Bit 2 read-only, always reads '0' */ +/* Bit 3 read-only, always reads '0' */ +/* Bit 4 read-only, always reads '0' */ +/* Bit 5 read-only, always reads '0' */ +/* Bit 6 read-only, always reads '0' */ +/* Bit 7 read-only, always reads '0' */ + +SFR(PCON, 0x87); +#define IDLE bmBit0 +#define STOP bmBit1 +#define GF0 bmBit2 +#define GF1 bmBit3 +/* Bit 4 read-only, always reads '1' */ +/* Bit 5 read-only, always reads '1' */ +/* Bit 6 unused */ +#define SMOD0 bmBit7 + +SFR(TCON, 0x88); +SBIT(IT0, 0x88, 0); +SBIT(IE0, 0x88, 1); +SBIT(IT1, 0x88, 2); +SBIT(IE1, 0x88, 3); +SBIT(TR0, 0x88, 4); +SBIT(TF0, 0x88, 5); +SBIT(TR1, 0x88, 6); +SBIT(TF1, 0x88, 7); + +SFR(TMOD, 0x89); +SFR(TL0, 0x8A); +SFR(TL1, 0x8B); +SFR(TH0, 0x8C); +SFR(TH1, 0x8D); + +SFR(CKCON, 0x8E); +#define MD0 bmBit0 +#define MD1 bmBit1 +#define MD2 bmBit2 +#define T0M bmBit3 +#define T1M bmBit4 +#define T2M bmBit5 +/* Bit 6 unused */ +/* Bit 7 unused */ + +SFR(SPC_FNC, 0x8F); +#define bmWRS bmBit0 +/* Bit 1 read-only, always reads '0' */ +/* Bit 2 read-only, always reads '0' */ +/* Bit 3 read-only, always reads '0' */ +/* Bit 4 read-only, always reads '0' */ +/* Bit 5 read-only, always reads '0' */ +/*... [truncated message content] |