24 lines
545 B
C
24 lines
545 B
C
#ifndef NBHW_FPGA_H
|
|
#define NBHW_FPGA_H
|
|
|
|
/* TODO: Devicetree */
|
|
#define NBHW_BASE_ADDRESS_FPGA 0xfd000000
|
|
#define FPGA_REG(x) *((volatile unsigned short*)( NBHW_BASE_ADDRESS_FPGA + ((unsigned int)x)))
|
|
|
|
typedef enum _fpga_type {
|
|
FPGA_TYPE_NONE,
|
|
FPGA_TYPE_XILINX,
|
|
FPGA_TYPE_LATTICE,
|
|
}fpga_type;
|
|
|
|
typedef struct _fpga_prog_operation {
|
|
void (*pre_programming)(void);
|
|
void (*post_programming)(void);
|
|
void (*spi_write)(u8);
|
|
int (*check_bitstream_compatibility)(fpga_type, u32);
|
|
} fpga_prog_operation;
|
|
|
|
int nbhw_fpga_program(void);
|
|
|
|
#endif
|