aboutsummaryrefslogtreecommitdiff
path: root/stm-fmc.h
diff options
context:
space:
mode:
Diffstat (limited to 'stm-fmc.h')
-rw-r--r--stm-fmc.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/stm-fmc.h b/stm-fmc.h
index c01d4ff..e9b5749 100644
--- a/stm-fmc.h
+++ b/stm-fmc.h
@@ -4,6 +4,8 @@
* Functions to set up and use the FMC bus.
*
* Copyright (c) 2015, NORDUnet A/S All rights reserved.
+ * Copyright: 2020, The Commons Conservancy Cryptech Project
+ * SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -15,9 +17,9 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * - Neither the name of the NORDUnet nor the names of its contributors may
- * be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * - Neither the name of the copyright holder nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -57,4 +59,14 @@ static inline void *fmc_fpga_addr(off_t addr)
return (void *)(FMC_FPGA_BASE_ADDR + (addr & FMC_FPGA_ADDR_MASK));
}
+static inline void fmc_write_32(uint32_t addr, uint32_t data)
+{
+ *(uint32_t *)fmc_fpga_addr(addr) = data;
+}
+
+static inline void fmc_read_32(uint32_t addr, uint32_t *data)
+{
+ *data = *(uint32_t *)fmc_fpga_addr(addr);
+}
+
#endif /* __STM_FMC_H */