baseband/fpga_5gnr_fec: add info get function
[dpdk.git] / drivers / baseband / fpga_5gnr_fec / fpga_5gnr_fec.h
index 98a2fe9..ab51cb7 100644 (file)
@@ -227,4 +227,13 @@ struct fpga_5gnr_fec_device {
        bool pf_device;
 };
 
+/* Read a register of FPGA 5GNR FEC device */
+static inline uint32_t
+fpga_reg_read_32(void *mmio_base, uint32_t offset)
+{
+       void *reg_addr = RTE_PTR_ADD(mmio_base, offset);
+       uint32_t ret = *((volatile uint32_t *)(reg_addr));
+       return rte_le_to_cpu_32(ret);
+}
+
 #endif /* _FPGA_5GNR_FEC_H_ */