X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fraw%2Fifpga%2Fbase%2Fopae_spi.h;h=d20a4c3edd1998295663d8e8786215d458bd6458;hb=0d6ef740e411180a40e93419e403690ab788985f;hp=ab66e1f32260598d3ebf6eb019ee2e62c4f53c77;hpb=473c88f9b391c2cd8b8622dcc488116cb09b624a;p=dpdk.git diff --git a/drivers/raw/ifpga/base/opae_spi.h b/drivers/raw/ifpga/base/opae_spi.h index ab66e1f322..d20a4c3edd 100644 --- a/drivers/raw/ifpga/base/opae_spi.h +++ b/drivers/raw/ifpga/base/opae_spi.h @@ -38,7 +38,7 @@ #define SPI_WRITE 0x20 #define WRITE_DATA_MASK GENMASK_ULL(31, 0) -#define SPI_MAX_RETRY 100000 +#define SPI_MAX_RETRY 1000000 #define TYPE_SPI 0 #define TYPE_NIOS_SPI 1 @@ -102,6 +102,7 @@ struct spi_transaction_dev { struct altera_spi_device *dev; int chipselect; struct spi_tran_buffer *buffer; + pthread_mutex_t lock; }; struct spi_tran_header { @@ -149,12 +150,19 @@ int spi_reg_read(struct altera_spi_device *dev, u32 reg, u32 *val); #define NIOS_SPI_STAT 0x18 #define NIOS_SPI_VALID BIT_ULL(32) #define NIOS_SPI_READ_DATA GENMASK_ULL(31, 0) -#define NIOS_SPI_INIT_DONE 0x1000 - -#define NIOS_SPI_INIT_DONE 0x1000 -#define NIOS_SPI_INIT_STS0 0x1020 -#define NIOS_SPI_INIT_STS1 0x1024 -#define PKVL_STATUS_RESET 0 -#define PKVL_10G_MODE 1 -#define PKVL_25G_MODE 2 + +#define NIOS_INIT 0x1000 +#define REQ_FEC_MODE GENMASK(23, 8) +#define FEC_MODE_NO 0x0 +#define FEC_MODE_KR 0x5555 +#define FEC_MODE_RS 0xaaaa +#define NIOS_INIT_START BIT(1) +#define NIOS_INIT_DONE BIT(0) +#define NIOS_VERSION 0x1004 +#define NIOS_VERSION_MAJOR_SHIFT 28 +#define NIOS_VERSION_MAJOR GENMASK(31, 28) +#define NIOS_VERSION_MINOR GENMASK(27, 24) +#define NIOS_VERSION_PATCH GENMASK(23, 20) +#define PKVL_A_MODE_STS 0x1020 +#define PKVL_B_MODE_STS 0x1024 #endif