| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- #ifndef LMK04821_H
- #define LMK04821_H
- //#include "tmsgheaders.h"
- #include <stdint.h>
- #include <unistd.h>
- #include <stdio.h>
- #include "pci.h"
- #define LMK_COUNT 129
- #define LMK_TOTAL_COUNT 131
- /* Header for the BochV3 FPGA */
- /* 1-MOSI */
- /* Device ID's */
- #define DEVICE_ID_BITP 18
- #define DEVICE_ID_BITM (0x1F << DEVICE_ID_BITP)
- #define DEVICE_ID_LMK_A 0x0
- #define DEVICE_ID_LMK_B 0x1
- #define DEVICE_ID_CP2444 0x2
- #define DEVICE_ID_HUB_TFE 0x3
- #define DEVICE_ID_FLASH 0x4
- /* Word Counter */
- #define MOSI1_WORD_NUM_BITP 1
- #define MOSI1_WORD_NUM_BITM (1FFFF << MOSI1_WORD_NUM_BITP)
- /* 4-MOSI */
- #define CTRL_COLD_PART_BITP 18
- #define CTRL_COLD_PART_BITM (0xF << CTRL_COLD_PART_BITP)
- #define TFE_2B_BITP 17
- #define TFE_2B_BITM (0x1 << TFE_2B_BITP)
- #define TFE_4B_BITP 15
- #define TFE_4B_BITM (0x3 << TFE_4B_BITP)
- #define TFE_7B_BITP 13
- #define TFE_7B_BITM (0x3 << TFE_7B_BITP)
- #define TFE_6B_BITP 11
- #define TFE_6B_BITM (0x3 << TFE_6B_BITP)
- #define BOCHV3_MODE_BITP 23
- #define BOCHV3_MODE_BITM (0x1 << BOCHV3_MODE_BITP)
- #define BOCHV3_TERM_BITP 0
- #define BOCHV3_TERM_BITM (0x1 << BOCHV3_TERM_BITP)
- #define BOCHV3_MODE_4MOSI (0x1 << BOCHV3_MODE_BITP)
- #define BOCHV3_MODE_1M0SI (0x0 << BOCHV3_MODE_BITP)
- #define BOCHV3_TERM_ON (0x1 << BOCHV3_TERM_BITP)
- /* Header for the Cp2444v1 FPGA */
- /* 1-MOSI */
- /* Device ID's */
- #define DEVICE_ID_SW_P1_ 0x0
- #define DEVICE_ID_ATT_P1 0x1
- #define DEVICE_ID_ATT_P2 0x2
- #define DEVICE_ID_ATT_P3 0x3
- #define DEVICE_ID_ATT_P4 0x4
- #define DEVICE_ID_GPIO 0x5
- #define CP2444v1_MODE_BITP 23
- #define CP2444v1_MODE_BITM (0x1 << CP2444v1_MODE_BITP)
- #define CP2444v1_TERM_BITP 0
- #define CP2444v1_TERM_BITM (0x1 << CP2444v1_TERM_BITP)
- #define ENUM_CP2444v1_MODE_4MOSI (0x1 << CP2444v1_MODE_BITP)
- #define ENUN_CP2444v1_MODE_1M0SI (0x0 << CP2444v1_MODE_BITP)
- #define ENUM_CP2444v1_TERM_ON (0x1 << CP2444v1_TERM_BITP)
- #define CP2444v1_GPIO_BITP 22
- #define CP2444v1_GPIO_BITM (0x1 << CP2444v1_GPIO_BITP)
- #define CP2444v1_SW_P1_BITP 21
- #define CP2444v1_SW_P1_BITM (0x1 << CP2444v1_SW_P1_BITP)
- #define CP2444v1_ATT_P1_BITP 20
- #define CP2444v1_ATT_P1_BITM (0x1 << CP2444v1_ATT_P1_BITP)
- #define CP2444v1_ATT_P2_BITP 19
- #define CP2444v1_ATT_P2_BITM (0x1 << CP2444v1_ATT_P2_BITP)
- #define CP2444v1_ATT_P3_BITP 18
- #define CP2444v1_ATT_P3_BITM (0x1 << CP2444v1_ATT_P3_BITP)
- #define CP2444v1_ATT_P4_BITP 17
- #define CP2444v1_ATT_P4_BITM (0x1 << CP2444v1_ATT_P4_BITP)
- #define CP2444v1_QSPI_MAX_WORD_NUM 0x6
- void lmk04821_a_init(reg_addr_pci* pci_bar_1);
- void lmk04821_b_init(reg_addr_pci* pci_bar_1);
- void lmk04821_a_init_boch_v3(reg_addr_pci* pci_bar_1);
- void lmk04821_b_init_boch_v3(reg_addr_pci* pci_bar_1);
- void cp2444_test(reg_addr_pci* pci_bar_1);
- #endif //LMK04821_H
|