diff --git a/src/drv/mmap.rfm.5565/mmap5565.c b/src/drv/mmap.rfm.5565/mmap5565.c index b4c1dcb1ea8807757310fd3d2635662028891408..436586ad6f37ff5bfc593e5c8b31b13adb76f7b8 100644 --- a/src/drv/mmap.rfm.5565/mmap5565.c +++ b/src/drv/mmap.rfm.5565/mmap5565.c @@ -253,7 +253,7 @@ unsigned long mapcard(struct pci_dev *pcidev, int memsize) { } - pRfmMem = LIGO_IOREMAP((unsigned long)pci_io_addr, memsize); + pRfmMem = IOREMAP((unsigned long)pci_io_addr, memsize); kmalloc_area[rfm_cnt] = pci_io_addr; printk("VMIC%x protected address=0x%lx\n", rfmType, (unsigned long)pRfmMem); @@ -261,7 +261,7 @@ unsigned long mapcard(struct pci_dev *pcidev, int memsize) { rfmType == 0x5565? PCI_BASE_ADDRESS_2:PCI_BASE_ADDRESS_1, &csrAddress); printk("CSR address is 0x%x\n",csrAddress); - csrAddr = LIGO_IOREMAP((unsigned long)csrAddress, 0x40); + csrAddr = IOREMAP((unsigned long)csrAddress, 0x40); if(rfmType == 0x5565) { p5565Csr = (VMIC5565_CSR *)csrAddr; diff --git a/src/drv/mmap.rfm.5579/mmap5579.c b/src/drv/mmap.rfm.5579/mmap5579.c index 830fa09bd76ed9fee0b3b61bf9baaee019293cbb..38599cfb735212ca247fd742e701ea94b670d916 100644 --- a/src/drv/mmap.rfm.5579/mmap5579.c +++ b/src/drv/mmap.rfm.5579/mmap5579.c @@ -12,7 +12,7 @@ # include <linux/modversions.h> #endif #include <asm/io.h> -#include "ligo_ioremap.h" +#include "ioremap_selection.h" #define VMIC_VID 0x114a #define VMIC_TID 0x5565 @@ -253,7 +253,7 @@ unsigned long mapcard(struct pci_dev *pcidev, int memsize) { } - pRfmMem = LIGO_IOREMAP((unsigned long)pci_io_addr, memsize); + pRfmMem = IOREMAP((unsigned long)pci_io_addr, memsize); kmalloc_area[rfm_cnt] = pci_io_addr; printk("VMIC%x protected address=0x%lx\n", rfmType, (unsigned long)pRfmMem); @@ -261,7 +261,7 @@ unsigned long mapcard(struct pci_dev *pcidev, int memsize) { rfmType == 0x5565? PCI_BASE_ADDRESS_2:PCI_BASE_ADDRESS_1, &csrAddress); printk("CSR address is 0x%x\n",csrAddress); - csrAddr = LIGO_IOREMAP((unsigned long)csrAddress, 0x40); + csrAddr = IOREMAP((unsigned long)csrAddress, 0x40); if(rfmType == 0x5565) { p5565Csr = (VMIC5565_CSR *)csrAddr; diff --git a/src/drv/mmap.rfm/mmap.c b/src/drv/mmap.rfm/mmap.c index 489734edb19d4edbafe9c11ee66c5769e891f3c0..4b9aa6d570ca732a7a7859a0b42c78c395ea49ec 100644 --- a/src/drv/mmap.rfm/mmap.c +++ b/src/drv/mmap.rfm/mmap.c @@ -12,7 +12,7 @@ # include <linux/modversions.h> #endif #include <asm/io.h> -#include "ligo_ioremap.h" +#include "ioremap_selection.h" #define VMIC_VID 0x114a #define VMIC_TID 0x5565 @@ -253,7 +253,7 @@ unsigned long mapcard(struct pci_dev *pcidev, int memsize) { } - pRfmMem = LIGO_IOREMAP((unsigned long)pci_io_addr, memsize); + pRfmMem = IOREMAP((unsigned long)pci_io_addr, memsize); kmalloc_area[rfm_cnt] = pci_io_addr; printk("VMIC%x protected address=0x%lx\n", rfmType, (unsigned long)pRfmMem); @@ -261,7 +261,7 @@ unsigned long mapcard(struct pci_dev *pcidev, int memsize) { rfmType == 0x5565? PCI_BASE_ADDRESS_2:PCI_BASE_ADDRESS_1, &csrAddress); printk("CSR address is 0x%x\n",csrAddress); - csrAddr = LIGO_IOREMAP((unsigned long)csrAddress, 0x40); + csrAddr = IOREMAP((unsigned long)csrAddress, 0x40); if(rfmType == 0x5565) { p5565Csr = (VMIC5565_CSR *)csrAddr; diff --git a/src/include/drv/gsc16ai64.c b/src/include/drv/gsc16ai64.c index d874cec7853451d2303f14b6e8645d76ec300924..9dbb37bd840a037c2210315509627ecf997adc09 100644 --- a/src/include/drv/gsc16ai64.c +++ b/src/include/drv/gsc16ai64.c @@ -10,7 +10,7 @@ #include "gsc_adc_common.h" #include "gsc16ai64.h" -#include "ligo_ioremap.h" +#include "ioremap_selection.h" // ***************************************************************************** /// \brief Routine to initialize GSC 16bit, 32 channel ADC modules @@ -50,7 +50,7 @@ gsc16ai64Init( CDS_HARDWARE* pHardware, struct pci_dev* adcdev ) return -1; printk( "pci0 = 0x%x\n", pci_io_addr ); /// Map module DMA space directly to computer memory space. - _adc_add = LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x200 ); + _adc_add = IOREMAP( (unsigned long)pci_io_addr, 0x200 ); /// Map the module DMA control registers via PLX chip registers adcDma[ devNum ] = (PLX_9056_DMA*)_adc_add; @@ -60,7 +60,7 @@ gsc16ai64Init( CDS_HARDWARE* pHardware, struct pci_dev* adcdev ) return -1; printk( "pci2 = 0x%x\n", pci_io_addr ); /// Map the module control register so local memory space. - _adc_add = LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x200 ); + _adc_add = IOREMAP( (unsigned long)pci_io_addr, 0x200 ); printk( "ADC I/O address=0x%x 0x%lx\n", pci_io_addr, (long)_adc_add ); /// Set global ptr to control register memory space. _adcPtr[ devNum ] = (GSA_ADC_REG*)_adc_add; diff --git a/src/include/drv/gsc16ao16.c b/src/include/drv/gsc16ao16.c index 77552a29a400c55a3ce1cedcedc3aa384a9770a3..91ffa997bd7f20f8b3d52be0a692d1a0c97992b0 100644 --- a/src/include/drv/gsc16ao16.c +++ b/src/include/drv/gsc16ao16.c @@ -10,7 +10,7 @@ #include "gsc_dac_common.h" #include "gsc16ao16.h" -#include "ligo_ioremap.h" +#include "ioremap_selection.h" // ***************************************************************************** /// \brief Routine to initialize GSC 16AO16 DAC modules. @@ -44,7 +44,7 @@ gsc16ao16Init( CDS_HARDWARE* pHardware, struct pci_dev* dacdev ) if(pedStatus != 0) return -1; printk( "pci0 = 0x%x\n", pci_io_addr ); - _dac_add = LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x200 ); + _dac_add = IOREMAP( (unsigned long)pci_io_addr, 0x200 ); /// Set up a pointer to DMA registers on PLX chip dacDma[ devNum ] = (PLX_9056_DMA*)_dac_add; @@ -53,7 +53,7 @@ gsc16ao16Init( CDS_HARDWARE* pHardware, struct pci_dev* dacdev ) if(pedStatus != 0) return -1; printk( "dac pci2 = 0x%x\n", pci_io_addr ); - _dac_add = LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x200 ); + _dac_add = IOREMAP( (unsigned long)pci_io_addr, 0x200 ); printk( "DAC I/O address=0x%x 0x%lx\n", pci_io_addr, (long)_dac_add ); _dacPtr[ devNum ] = (GSC_DAC_REG*)_dac_add; diff --git a/src/include/drv/gsc18ai32.c b/src/include/drv/gsc18ai32.c index 8297e7bc93dccf3395e6ac2d58b141672c7117df..740c20e43c755ed117d5e56470232f377971729d 100644 --- a/src/include/drv/gsc18ai32.c +++ b/src/include/drv/gsc18ai32.c @@ -6,7 +6,7 @@ #include "gsc_adc_common.h" #include "gsc18ai32.h" -#include "ligo_ioremap.h" +#include "ioremap_selection.h" // ***************************************************************************** /// \brief Routine to initialize GSC 18bit, 32 channel ADC modules @@ -44,7 +44,7 @@ gsc18ai32Init( CDS_HARDWARE* pHardware, struct pci_dev* adcdev ) return -1; printk( "pci0 = 0x%x\n", pci_io_addr ); /// Map module DMA space directly to computer memory space. - _adc_add = LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x200 ); + _adc_add = IOREMAP( (unsigned long)pci_io_addr, 0x200 ); /// Map the module DMA control registers via PLX chip registers adcDma[ devNum ] = (PLX_9056_DMA*)_adc_add; @@ -54,7 +54,7 @@ gsc18ai32Init( CDS_HARDWARE* pHardware, struct pci_dev* adcdev ) return -1; printk( "pci2 = 0x%x\n", pci_io_addr ); /// Map the module control register so local memory space. - _adc_add = LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x200 ); + _adc_add = IOREMAP( (unsigned long)pci_io_addr, 0x200 ); printk( "ADC 18 I/O address=0x%x 0x%lx\n", pci_io_addr, (long)_adc_add ); /// Set global ptr to control register memory space. adc18Ptr = (GSA_ADC_REG*)_adc_add; diff --git a/src/include/drv/gsc18ai64.c b/src/include/drv/gsc18ai64.c index ba77e487bd8489437dda68f490ba31b3f07eb407..4206418e82bb1e065ea7622670b61912fed6c85c 100644 --- a/src/include/drv/gsc18ai64.c +++ b/src/include/drv/gsc18ai64.c @@ -6,7 +6,7 @@ #include "gsc_adc_common.h" #include "gsc18ai64.h" -#include "ligo_ioremap.h" +#include "ioremap_selection.h" // ***************************************************************************** /// \brief Routine to initialize GSC 18bit, 64 channel ADC modules @@ -44,7 +44,7 @@ gsc18ai64Init( CDS_HARDWARE* pHardware, struct pci_dev* adcdev ) return -1; printk( "pci0 = 0x%x\n", pci_io_addr ); /// Map module DMA space directly to computer memory space. - _adc_add = LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x200 ); + _adc_add = IOREMAP( (unsigned long)pci_io_addr, 0x200 ); /// Map the module DMA control registers via PLX chip registers adcDma[ devNum ] = (PLX_9056_DMA*)_adc_add; @@ -54,7 +54,7 @@ gsc18ai64Init( CDS_HARDWARE* pHardware, struct pci_dev* adcdev ) return -1; printk( "pci2 = 0x%x\n", pci_io_addr ); /// Map the module control register so local memory space. - _adc_add = LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x200 ); + _adc_add = IOREMAP( (unsigned long)pci_io_addr, 0x200 ); printk( "ADC I/O address=0x%x 0x%lx\n", pci_io_addr, (long)_adc_add ); /// Set global ptr to control register memory space. adc18Ptr = (GSA_ADC_REG*)_adc_add; diff --git a/src/include/drv/gsc18ao8.c b/src/include/drv/gsc18ao8.c index c736c232b26af0be43e1bcd681dc859600d65799..350e29f1f7c3ebcf63163c8cac97c28a13d6df19 100644 --- a/src/include/drv/gsc18ao8.c +++ b/src/include/drv/gsc18ao8.c @@ -10,7 +10,7 @@ #include "gsc_dac_common.h" #include "gsc18ao8.h" -#include "ligo_ioremap.h" +#include "ioremap_selection.h" // ***************************************************************************** /// \brief Routine to initialize GSC 18AO8 DAC modules. @@ -49,7 +49,7 @@ gsc18ao8Init( CDS_HARDWARE* pHardware, struct pci_dev* dacdev ) if(pedStatus != 0) return -1; printk( "pci0 = 0x%x\n", pci_io_addr ); - _dac_add = LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x200 ); + _dac_add = IOREMAP( (unsigned long)pci_io_addr, 0x200 ); /// Set up a pointer to DMA registers on PLX chip dacDma[ devNum ] = (PLX_9056_DMA*)_dac_add; @@ -58,7 +58,7 @@ gsc18ao8Init( CDS_HARDWARE* pHardware, struct pci_dev* dacdev ) if(pedStatus != 0) return -1; printk( "dac pci2 = 0x%x\n", pci_io_addr ); - _dac_add = LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x200 ); + _dac_add = IOREMAP( (unsigned long)pci_io_addr, 0x200 ); printk( "DAC I/O address=0x%x 0x%lx\n", pci_io_addr, (long)_dac_add ); dac18bitPtr = (GSC_DAC_REG*)_dac_add; diff --git a/src/include/drv/gsc20ao8.c b/src/include/drv/gsc20ao8.c index be3f6f40d3f2af5bc9233da24831a0c2a0d5fb58..e0ec9e1ddf63484370adaa4afe45d9472954aa1b 100644 --- a/src/include/drv/gsc20ao8.c +++ b/src/include/drv/gsc20ao8.c @@ -10,7 +10,7 @@ #include "gsc_dac_common.h" #include "gsc20ao8.h" -#include "ligo_ioremap.h" +#include "ioremap_selection.h" // ***************************************************************************** /// \brief Routine to initialize GSC 20AO8 DAC modules. @@ -47,7 +47,7 @@ gsc20ao8Init( CDS_HARDWARE* pHardware, struct pci_dev* dacdev ) if(pedStatus != 0) return -1; printk( "pci0 = 0x%x\n", pci_io_addr ); - _dac_add = LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x200 ); + _dac_add = IOREMAP( (unsigned long)pci_io_addr, 0x200 ); /// Set up a pointer to DMA registers on PLX chip dacDma[ devNum ] = (PLX_9056_DMA*)_dac_add; @@ -57,7 +57,7 @@ gsc20ao8Init( CDS_HARDWARE* pHardware, struct pci_dev* dacdev ) return -1; // Send some info to dmesg printk( "dac pci2 = 0x%x\n", pci_io_addr ); - _dac_add = LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x200 ); + _dac_add = IOREMAP( (unsigned long)pci_io_addr, 0x200 ); // Send some info to dmesg printk( "DAC I/O address=0x%x 0x%lx\n", pci_io_addr, (long)_dac_add ); diff --git a/src/include/drv/ioremap_selection.h b/src/include/drv/ioremap_selection.h new file mode 100644 index 0000000000000000000000000000000000000000..fdc27e3c0fa8e9395177c585a2b81c942dcd6a1f --- /dev/null +++ b/src/include/drv/ioremap_selection.h @@ -0,0 +1,21 @@ +/* + * The ioremap call changes names at kernel 5.6. + * + * In 5.10 we use ioremap, in older versions we use ioremap_nocache. + * At least on x86 the impelmentation of these functions is the same. + */ + +#ifndef IOREMAP_SELECTION_H +#define IOREMAP_SELECTION_H + +/* Keeping IOREMAP as a macro instead of a static inline function as + * the kernel has a few similar but different definitions of the argument + * types, and I will not wade into that here. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0) +#define IOREMAP ioremap_nocache +#else +#define IOREMAP ioremap +#endif + +#endif /* IOREMAP_SELECTION_H */ diff --git a/src/include/drv/ligoPcieTiming_core.c b/src/include/drv/ligoPcieTiming_core.c index 2395784996c6ffc0c14bbf84499d36e9410b219d..4e8b5129a8cadbeb43425a9bd6fef536ba15d63c 100644 --- a/src/include/drv/ligoPcieTiming_core.c +++ b/src/include/drv/ligoPcieTiming_core.c @@ -3,7 +3,7 @@ #ifndef LIGO_PCIE_TIMING_CORE_IMPL #define LIGO_PCIE_TIMING_CORE_IMPL #include "ligoPcieTiming.h" -#include "ligo_ioremap.h" +#include "ioremap_selection.h" /// Convert fractional part of 2^32 Hz LPTC timing counter to microseconds /// \param clock_ticks_2_32_hz fractional time as reported by LPTC @@ -31,7 +31,7 @@ lptcInit( CDS_HARDWARE* pCds, struct pci_dev* lptcdev ) printk( "Xilinx enabled status = %d\n", status ); pci_read_config_dword( lptcdev, PCI_BASE_ADDRESS_0, &pci_io_addr ); pci_io_addr &= 0xfffffff0; - addr = (char*)LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x2000 ); + addr = (char*)IOREMAP( (unsigned long)pci_io_addr, 0x2000 ); printk( "Xilinx mapped = 0x%x 0x%p\n", pci_io_addr, addr ); pCds->lptc[ card ] = (unsigned int*)addr; diff --git a/src/include/drv/ligo_ioremap.h b/src/include/drv/ligo_ioremap.h deleted file mode 100644 index 8529973511bead4680598cc81e1acfdccaee95d7..0000000000000000000000000000000000000000 --- a/src/include/drv/ligo_ioremap.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * The ioremap call changes names. - * - * In 5.10 we use ioremap, in older versions we use ioremap_nocache - */ - -#ifndef ADVLIGORTS_LIGO_IOREMAP_H -#define ADVLIGORTS_LIGO_IOREMAP_H - -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0) -#define LIGO_IOREMAP ioremap_nocache -#else -#define LIGO_IOREMAP ioremap -#endif - -#endif /* ADVLIGORTS_LIGO_IOREMAP_H */ diff --git a/src/include/drv/spectracomGPS.c b/src/include/drv/spectracomGPS.c index 147f8e435f8777e1d353e3d32df2929dd615eee6..7aa0af2b5836822fb297798bb90b30f8ed779155 100644 --- a/src/include/drv/spectracomGPS.c +++ b/src/include/drv/spectracomGPS.c @@ -8,7 +8,7 @@ ///< TSync-PCIe Manual</a> #include "spectracomGPS.h" -#include "ligo_ioremap.h" +#include "ioremap_selection.h" // ***************************************************************************** /// \brief Initialize TSYNC GPS card (model BC635PCI-U) @@ -41,7 +41,7 @@ spectracomGpsInitCheckSync( CDS_HARDWARE* pHardware, pci_io_addr &= 0xfffffff0; printk( "TSYNC PIC BASE 0 address = %x\n", pci_io_addr ); - addr1 = (unsigned char*)LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x30 ); + addr1 = (unsigned char*)IOREMAP( (unsigned long)pci_io_addr, 0x30 ); printk( "Remapped 0x%p\n", addr1 ); pHardware->gps = (unsigned int*)addr1; pHardware->gpsType = TSYNC_RCVR; diff --git a/src/include/drv/symmetricomGps.c b/src/include/drv/symmetricomGps.c index 1b86374cd407f0b8f5fd463b87c48907d5affe83..911ef1868932cdc2ade2ad5e547ce2895dff7861 100644 --- a/src/include/drv/symmetricomGps.c +++ b/src/include/drv/symmetricomGps.c @@ -1,5 +1,5 @@ #include "symmetricomGps.h" -#include "ligo_ioremap.h" +#include "ioremap_selection.h" // ***************************************************************************** /// Initialize Symmetricom GPS card (model BC635PCI-U) @@ -22,7 +22,7 @@ symmetricomGpsInit( CDS_HARDWARE* pHardware, struct pci_dev* gpsdev ) pci_io_addr &= 0xfffffff0; printk( "PIC BASE 2 address = %x\n", pci_io_addr ); - addr1 = (unsigned char*)LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x40 ); + addr1 = (unsigned char*)IOREMAP( (unsigned long)pci_io_addr, 0x40 ); printk( "Remapped 0x%p\n", addr1 ); pHardware->gps = (unsigned int*)addr1; pHardware->gpsType = SYMCOM_RCVR; @@ -32,7 +32,7 @@ symmetricomGpsInit( CDS_HARDWARE* pHardware, struct pci_dev* gpsdev ) pci_read_config_dword( gpsdev, PCI_BASE_ADDRESS_3, &pci_io_addr ); pci_io_addr &= 0xfffffff0; addr3 = - (unsigned char*)LIGO_IOREMAP( (unsigned long)pci_io_addr, 0x200 ); + (unsigned char*)IOREMAP( (unsigned long)pci_io_addr, 0x200 ); printk( "PIC BASE 3 address = 0x%x\n", pci_io_addr ); printk( "PIC BASE 3 address = 0x%p\n", addr3 ); dramRead = (unsigned int*)( addr3 + 0x82 ); diff --git a/src/include/drv/vmic5565.c b/src/include/drv/vmic5565.c index 080a8f84c54243119774260e8d5f50dcfc65188d..de1635de6dbe407501173b94445d4290aaf177a7 100644 --- a/src/include/drv/vmic5565.c +++ b/src/include/drv/vmic5565.c @@ -9,7 +9,7 @@ ///< Manual</a> #include "vmic5565.h" -#include "ligo_ioremap.h" +#include "ioremap_selection.h" // ***************************************************************************** /// \brief Routine to initialize VMIC RFM modules. \n @@ -35,7 +35,7 @@ vmic5565Init( CDS_HARDWARE* pHardware, struct pci_dev* rfmdev ) pci_read_config_dword( rfmdev, PCI_BASE_ADDRESS_3, &pci_io_addr ); // Map full 128 MByte new cards only pHardware->pci_rfm[ devNum ] = - (long)LIGO_IOREMAP( (unsigned long)pci_io_addr, 128 * 1024 * 1024 ); + (long)IOREMAP( (unsigned long)pci_io_addr, 128 * 1024 * 1024 ); // Allocate local memory for IPC DMA xfers from RFM module pHardware->pci_rfm_dma[ devNum ] = (long)pci_alloc_consistent( rfmdev, IPC_BUFFER_SIZE, &rfm_dma_handle[ devNum ] ); @@ -44,7 +44,7 @@ vmic5565Init( CDS_HARDWARE* pHardware, struct pci_dev* rfmdev ) // Find the RFM control/status register pci_read_config_dword( rfmdev, PCI_BASE_ADDRESS_2, &csrAddress ); printk( "CSR address is 0x%x\n", csrAddress ); - csrAddr = LIGO_IOREMAP( (unsigned long)csrAddress, 0x40 ); + csrAddr = IOREMAP( (unsigned long)csrAddress, 0x40 ); p5565Csr[ devNum ] = (VMIC5565_CSR*)csrAddr; // pHardware->rfm_reg[devNum] = p5565Csr; @@ -75,7 +75,7 @@ vmic5565Init( CDS_HARDWARE* pHardware, struct pci_dev* rfmdev ) // Find DMA Engine controls in RFM Local Configuration Table pci_read_config_dword( rfmdev, PCI_BASE_ADDRESS_0, &dmaAddress ); printk( "DMA address is 0x%ux\n", dmaAddress ); - dmaAddr = LIGO_IOREMAP( dmaAddress, 0x200 ); + dmaAddr = IOREMAP( dmaAddress, 0x200 ); p5565Dma[ devNum ] = (VMIC5565DMA*)dmaAddr; // pHardware->rfm_dma[devNum] = p5565Dma[devNum]; printk( "5565DMA at 0x%lx\n", (unsigned long int)p5565Dma[ devNum ] );