From 0f8c20fe0658082c044443d0c8a51b773c457191 Mon Sep 17 00:00:00 2001 From: "Pavel V. Shatov (Meister)" Date: Sat, 7 Jul 2018 00:40:13 +0300 Subject: Changed FMC initialization code to match the new sync FMC arbiter. Removed unnecessary code (no more double read, yay!) --- stm-fmc.h | 52 ++++------------------------------------------------ 1 file changed, 4 insertions(+), 48 deletions(-) (limited to 'stm-fmc.h') diff --git a/stm-fmc.h b/stm-fmc.h index eab053d..92b261b 100644 --- a/stm-fmc.h +++ b/stm-fmc.h @@ -39,12 +39,6 @@ #define FMC_FPGA_BASE_ADDR 0x60000000 #define FMC_FPGA_ADDR_MASK 0x03FFFFFC // there are 26 physical lines, but "only" 24 usable for now -#define FMC_FPGA_NWAIT_MAX_POLL_TICKS 10 - -#define FMC_GPIO_PORT_NWAIT GPIOD -#define FMC_GPIO_PIN_NWAIT GPIO_PIN_6 - -#define FMC_NWAIT_IDLE GPIO_PIN_SET #define fmc_af_gpio(port, pins) \ GPIO_InitStruct.Pin = pins; \ @@ -58,60 +52,22 @@ extern void fmc_init(void); -static inline HAL_StatusTypeDef _fmc_nwait_idle(void) -{ - int cnt; - - // poll NWAIT (number of iterations is limited) - for (cnt=0; cnt Date: Sat, 6 Apr 2019 17:54:06 -0400 Subject: Remove fmc_[read|write]_32, since we now memcpy in hal_io_[read|write]. --- stm-fmc.h | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'stm-fmc.h') diff --git a/stm-fmc.h b/stm-fmc.h index 92b261b..c01d4ff 100644 --- a/stm-fmc.h +++ b/stm-fmc.h @@ -52,22 +52,9 @@ extern void fmc_init(void); -static inline void fmc_write_32(const uint32_t addr, const uint32_t data) +static inline void *fmc_fpga_addr(off_t addr) { - // calculate target fpga address - uint32_t *ptr = (uint32_t *) (FMC_FPGA_BASE_ADDR + (addr & FMC_FPGA_ADDR_MASK)); - - // write data to fpga - *ptr = data; -} - -static inline void fmc_read_32(const uint32_t addr, uint32_t * const data) -{ - // calculate target fpga address - uint32_t *ptr = (uint32_t *) (FMC_FPGA_BASE_ADDR + (addr & FMC_FPGA_ADDR_MASK)); - - // read data from fpga - *data = *ptr; + return (void *)(FMC_FPGA_BASE_ADDR + (addr & FMC_FPGA_ADDR_MASK)); } #endif /* __STM_FMC_H */ -- cgit v1.2.3