From 01680f2ff52b5144aba69018a01ed67261b09283 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Sun, 30 Apr 2023 13:57:29 -0700 Subject: [PATCH] modules/mqnic: Implement I2C interface for fb4CGg3@VU09P Signed-off-by: Alex Forencich --- modules/mqnic/mqnic_board.c | 31 +++++++++++++++++++++++++++++++ modules/mqnic/mqnic_hw.h | 1 + 2 files changed, 32 insertions(+) diff --git a/modules/mqnic/mqnic_board.c b/modules/mqnic/mqnic_board.c index 53e30ce27..cd572af42 100644 --- a/modules/mqnic/mqnic_board.c +++ b/modules/mqnic/mqnic_board.c @@ -644,6 +644,37 @@ static int mqnic_generic_board_init(struct mqnic_dev *mqnic) // read MACs from EEPROM // init_mac_list_from_eeprom(mqnic, mqnic->eeprom_i2c_client, 0x000E, MQNIC_MAX_IF); + break; + case MQNIC_BOARD_ID_FB4CGG3_VU9P: + + request_module("at24"); + + // I2C adapter + adapter = mqnic_i2c_adapter_create(mqnic, 0); + + // QSFP0 + mqnic->mod_i2c_client[0] = create_i2c_client(adapter, "24c02", 0x50, NULL); + + // I2C adapter + adapter = mqnic_i2c_adapter_create(mqnic, 1); + + // QSFP1 + mqnic->mod_i2c_client[1] = create_i2c_client(adapter, "24c02", 0x50, NULL); + + // I2C adapter + adapter = mqnic_i2c_adapter_create(mqnic, 2); + + // QSFP2 + mqnic->mod_i2c_client[2] = create_i2c_client(adapter, "24c02", 0x50, NULL); + + // I2C adapter + adapter = mqnic_i2c_adapter_create(mqnic, 3); + + // QSFP3 + mqnic->mod_i2c_client[3] = create_i2c_client(adapter, "24c02", 0x50, NULL); + + mqnic->mod_i2c_client_count = 4; + break; default: dev_warn(mqnic->dev, "Unknown board ID, not performing any board-specific init"); diff --git a/modules/mqnic/mqnic_hw.h b/modules/mqnic/mqnic_hw.h index c016d18e4..0e446760d 100644 --- a/modules/mqnic/mqnic_hw.h +++ b/modules/mqnic/mqnic_hw.h @@ -69,6 +69,7 @@ #define MQNIC_BOARD_ID_DE10_AGILEX 0x1172b00a #define MQNIC_BOARD_ID_XUPP3R 0x12ba9823 #define MQNIC_BOARD_ID_250SOC 0x198a250e +#define MQNIC_BOARD_ID_FB4CGG3_VU9P 0x1c2c9403 #define MQNIC_BOARD_ID_FB2CG_KU15P 0x1c2ca00e #define MQNIC_BOARD_ID_NEXUS_K35_S 0x1ce40003 #define MQNIC_BOARD_ID_NEXUS_K3P_S 0x1ce40009