From aeaf94f4e83826fe56f38fc670973a60a5010ef1 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Wed, 8 Apr 2015 16:01:31 -0400 Subject: Unify and refactor eim and i2c software. Unify memory maps. Move tc_init, tc_next, tc_wait_* into tc_[eim|i2c].c. Move eim_setup into tc_eim.c, move i2c_open into tc_i2c.c. --- i2c/sw/tc_i2c.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'i2c/sw/tc_i2c.h') diff --git a/i2c/sw/tc_i2c.h b/i2c/sw/tc_i2c.h index f9648da..b1afae1 100644 --- a/i2c/sw/tc_i2c.h +++ b/i2c/sw/tc_i2c.h @@ -33,15 +33,23 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* I2C configuration */ -#define I2C_dev "/dev/i2c-2" -#define I2C_addr 0x0f +/* cryptech memory map */ +#define BASE_ADDR 0 +#define SEGMENT_SIZE 0x2000 +#define ADDR(x) (x) +#include "cryptech_memory_map.h" -/* I2C public functions */ -int i2c_open(char *dev, int addr); +/* I2C configuration */ +#define I2C_dev "/dev/i2c-2" +#define I2C_addr 0x0f +#define I2C_SLAVE 0x0703 /* test case public functions */ int tc_write(off_t offset, const uint8_t *data, size_t len); int tc_read(off_t offset, uint8_t *data, size_t len); int tc_expected(off_t offset, const uint8_t *data, size_t len); +int tc_init(off_t offset); +int tc_next(off_t offset); int tc_wait(off_t offset, uint8_t status, int *count); +int tc_wait_ready(off_t offset); +int tc_wait_valid(off_t offset); -- cgit v1.2.3