aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2020-10-15 13:53:53 -0400
committerPaul Selkirk <paul@psgd.org>2020-10-15 13:53:53 -0400
commit16b7a38bedbae0829e0b943c35f0896acb683025 (patch)
tree0a2650f818d4ce8544521bba930703d0eb180910
parent7a08cec524254574013e1839507514bf30085201 (diff)
Add retro fmc_write_32/fmc_read_32 for the board-test projects that use them.
-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 */