From 6a9c597bc9e6b9183355de8f99ce45611ea97a95 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Wed, 6 Jul 2016 14:29:14 -0400 Subject: Belatedly adjust hal_io_read/write to the new flat addressing architecture. --- hal_io_eim.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'hal_io_eim.c') diff --git a/hal_io_eim.c b/hal_io_eim.c index 173490f..5824f5b 100644 --- a/hal_io_eim.c +++ b/hal_io_eim.c @@ -4,7 +4,7 @@ * This module contains common code to talk to the FPGA over the EIM bus. * * Author: Paul Selkirk - * Copyright (c) 2014-2015, NORDUnet A/S All rights reserved. + * Copyright (c) 2014-2016, NORDUnet A/S All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -60,17 +60,10 @@ static hal_error_t init(void) } /* translate cryptech register number to EIM address - * - * register number format: - * 3 bits segment selector - * 5 bits core selector (6 bits in native eim) - * 8 bits register selector - * - * sss ccccc rrrrrrrr => 00001000000000 sss 0 ccccc rrrrrrrr 00 */ static hal_addr_t eim_offset(hal_addr_t offset) { - return EIM_BASE_ADDR + ((offset & ~0x1fff) << 3) + ((offset & 0x1fff) << 2); + return EIM_BASE_ADDR + (offset << 2); } void hal_io_set_debug(int onoff) -- cgit v1.2.3