From 50b1aff6f6f2a3a127f6121c5dedd8c2fa5a1c4d Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 14 Nov 2010 23:04:16 +0100 Subject: Initial version of a SAM7 USART based ISO7816-3 T=0 sniffer --- firmware/include/openpcd.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'firmware/include') diff --git a/firmware/include/openpcd.h b/firmware/include/openpcd.h index e5a0ac7..ea32764 100644 --- a/firmware/include/openpcd.h +++ b/firmware/include/openpcd.h @@ -34,6 +34,8 @@ enum openpcd_cmd_class { OPENPCD_CMD_CLS_ADC = 0x5, OPENPCD_CMD_CLS_LIBRFID = 0x6, OPENPCD_CMD_CLS_PRESENCE = 0x7, + /* SIM SCAN */ + OPENPCD_CMD_CLS_SIM = 0x8, /* PICC (transponder) side */ OPENPCD_CMD_CLS_PICC = 0xe, @@ -102,6 +104,7 @@ enum openpcd_cmd_class { #define OPENPCD_VENDOR_ID 0x16c0 +#define SIMTRACE_PRODUCT_ID 0x0762 #define OPENPCD_PRODUCT_ID 0x076b #define OPENPICC_PRODUCT_ID 0x076c #define OPENPCD_OUT_EP 0x01 -- cgit v1.2.3 From 3c29506f17ff4a30a3d988361c67d2ec1af13eeb Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 18 Nov 2010 14:09:31 +0100 Subject: simtrace: add TC based waiting time counter, signal ATR / expiry via USB --- firmware/include/simtrace_usb.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 firmware/include/simtrace_usb.h (limited to 'firmware/include') diff --git a/firmware/include/simtrace_usb.h b/firmware/include/simtrace_usb.h new file mode 100644 index 0000000..c020093 --- /dev/null +++ b/firmware/include/simtrace_usb.h @@ -0,0 +1,24 @@ +#ifndef SIMTRACE_USB_H +#define SIMTRACE_USB_H + +//#include + +/* this is kept compatible with OpenPCD protocol */ +struct simtrace_hdr { + u_int8_t cmd; + u_int8_t flags; + u_int8_t res[2]; + u_int8_t data[0]; +} __attribute__ ((packed)); + +enum simtrace_usb_msgt { + SIMTRACE_MSGT_NULL, + SIMTRACE_MSGT_DATA, + SIMTRACE_MSGT_RESET, /* reset was asserted, no more data */ +}; + +/* flags for MSGT_DATA */ +#define SIMTRACE_FLAG_ATR 0x01 /* ATR immediately after reset */ +#define SIMTRACE_FLAG_WTIME_EXP 0x04 /* work waiting time expired */ + +#endif /* SIMTRACE_USB_H */ -- cgit v1.2.3 From 855b8fdd853cc25a95094364e0fc57c1ffbb5cc0 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 21 Nov 2010 20:19:05 +0100 Subject: AT91SAM7.h: Fix computation of AT91C_IFLASH_LOCK_REGION_SIZE --- firmware/include/AT91SAM7.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'firmware/include') diff --git a/firmware/include/AT91SAM7.h b/firmware/include/AT91SAM7.h index 53eb072..42743f6 100644 --- a/firmware/include/AT91SAM7.h +++ b/firmware/include/AT91SAM7.h @@ -1942,6 +1942,6 @@ typedef struct _AT91S_UDP { #endif #define AT91C_IFLASH_NB_OF_PAGES (AT91C_ISRAM_SIZE>>AT91C_IFLASH_PAGE_SHIFT) -#define AT91C_IFLASH_LOCK_REGION_SIZE (AT91C_ISRAM_SIZE/AT91C_IFLASH_NB_OF_LOCK_BITS) +#define AT91C_IFLASH_LOCK_REGION_SIZE (AT91C_IFLASH_SIZE/AT91C_IFLASH_NB_OF_LOCK_BITS) #endif/*__AT91SAM7_H__*/ -- cgit v1.2.3 From ebaba1be96a6970705eb805dc3afc1d54f489ac8 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 17 Jun 2011 09:55:18 +0200 Subject: simtrace: introduce mode sniffer / mitm switching --- firmware/include/lib_AT91SAM7.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'firmware/include') diff --git a/firmware/include/lib_AT91SAM7.h b/firmware/include/lib_AT91SAM7.h index f26ac54..2aa7df6 100644 --- a/firmware/include/lib_AT91SAM7.h +++ b/firmware/include/lib_AT91SAM7.h @@ -444,6 +444,22 @@ static inline void AT91F_PIO_CfgPullup( pPio->PIO_PPUER = pullupEnable; } +static inline void AT91F_PIO_CfgPullupEn( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int pullupEnable) // \arg enable pullup on PIO +{ + // Connect or not Pullup + pPio->PIO_PPUER = pullupEnable; +} + +static inline void AT91F_PIO_CfgPullupDis( + AT91PS_PIO pPio, // \arg pointer to a PIO controller + unsigned int pullupEnable) // \arg enable pullup on PIO +{ + // Connect or not Pullup + pPio->PIO_PPUDR = pullupEnable; +} + //*---------------------------------------------------------------------------- //* \fn AT91F_PIO_CfgDirectDrive //* \brief Enable direct drive on PIO -- cgit v1.2.3