diff --git a/armsrc/fpgaloader.h b/armsrc/fpgaloader.h index 3e5801e46..e130f7719 100644 --- a/armsrc/fpgaloader.h +++ b/armsrc/fpgaloader.h @@ -20,6 +20,7 @@ #define __FPGALOADER_H #include "common.h" +#include "fpga.h" #define FpgaDisableSscDma(void) AT91C_BASE_PDC_SSC->PDC_PTCR = AT91C_PDC_RXTDIS; #define FpgaEnableSscDma(void) AT91C_BASE_PDC_SSC->PDC_PTCR = AT91C_PDC_RXTEN; diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index ce371155c..a5580a9f4 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -44,6 +44,7 @@ #include "preferences.h" #include "mifare/gen4.h" #include "generator.h" // keygens. +#include "fpga.h" static int CmdHelp(const char *Cmd); diff --git a/client/src/cmdlf.c b/client/src/cmdlf.c index 16c3124a0..4b6f10088 100644 --- a/client/src/cmdlf.c +++ b/client/src/cmdlf.c @@ -34,7 +34,7 @@ #include "cmdhw.h" // for setting FPGA image #include "cmdlfawid.h" // for awid menu #include "cmdlfem.h" // for em menu -#include "cmdlfem410x.h" // for em4x menu +#include "cmdlfem410x.h" // for em4x menu #include "cmdlfem4x05.h" // for em4x05 / 4x69 #include "cmdlfem4x50.h" // for em4x50 #include "cmdlfem4x70.h" // for em4x70 @@ -67,6 +67,7 @@ #include "cmdlfzx8211.h" // for ZX8211 menu #include "crc.h" #include "pm3_cmd.h" // for LF_CMDREAD_MAX_EXTRA_SYMBOLS +#include "fpga.h" // for set_fpga_mode static int CmdHelp(const char *Cmd); diff --git a/common_fpga/fpga.h b/common_fpga/fpga.h index 35143ec6f..2818af369 100644 --- a/common_fpga/fpga.h +++ b/common_fpga/fpga.h @@ -32,6 +32,17 @@ #define FPGA_RING_BUFFER_BYTES (1024 * 30) #define FPGA_TRACE_SIZE 3072 +// definitions for multiple FPGA config files support +typedef enum +{ + FPGA_BITSTREAM_UNKNOWN = 0, + FPGA_BITSTREAM_LF = 1, + FPGA_BITSTREAM_HF, + FPGA_BITSTREAM_HF_FELICA, + FPGA_BITSTREAM_HF_15, + FPGA_BITSTREAM_MAX = FPGA_BITSTREAM_HF_15, +} FPGA_config; + static const uint8_t bitparse_fixed_header[] = {0x00, 0x09, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xf0, 0x00, 0x00, 0x01}; extern const int g_fpga_bitstream_num; extern const char *const g_fpga_version_information[]; diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index 78a074b6e..bb459f3fb 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -891,11 +891,6 @@ typedef struct { # define UART_TCP_LOCAL_CLIENT_RX_TIMEOUT_MS 40 # define UART_UDP_LOCAL_CLIENT_RX_TIMEOUT_MS 20 -// definitions for multiple FPGA config files support -#define FPGA_BITSTREAM_LF 1 -#define FPGA_BITSTREAM_HF 2 -#define FPGA_BITSTREAM_HF_FELICA 3 -#define FPGA_BITSTREAM_HF_15 4 // CMD_DEVICE_INFO response packet has flags in arg[0], flag definitions: /* Whether a bootloader that understands the g_common_area is present */