From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7995246084; Tue, 14 Jan 2025 11:13:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 67B15402E8; Tue, 14 Jan 2025 11:13:28 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by mails.dpdk.org (Postfix) with ESMTP id 5FE89400EF for ; Tue, 14 Jan 2025 11:13:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736849607; x=1768385607; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hN2lZnECcR3fKFC/OuT9PFIpgGuZVWp0Ujq1DT5iiQc=; b=c223ev/RCTGclXxO0QmND2G7tpdYxNH1g8kxCc0aHJiH0J1kNfdNngyc drAKz0FOCSBrKoIkTDi91zKj5qzIKZvurOyYeNgPIeiswo7Hj/jVU+aJC /nDrpVroKcqBwPvMR/fQCShyok60d06RwMT9kC+CvSQfUBZXw+g0gdhYh RoqIcMarCTMV0us1s6aUdwT+r+Phan+sMwD4UBhNr9DrsrQ+uIdWc2tNv l3xNd+Qo9L78UV8dES0bvvTAie76hUmUqs+yISpD8hme0r1iLZTilAYlg kpHzrV+tV/T+W7i6IDVqeCJ1cTW1l4rKLhJhpedaBB/HEkpg4TYohm57W Q==; X-CSE-ConnectionGUID: 14uTK1YHRNSVl9RnURnD3Q== X-CSE-MsgGUID: zHZfJROORKWg2ZmYQZL76A== X-IronPort-AV: E=McAfee;i="6700,10204,11314"; a="36426767" X-IronPort-AV: E=Sophos;i="6.12,314,1728975600"; d="scan'208";a="36426767" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2025 02:13:25 -0800 X-CSE-ConnectionGUID: ExC+WkvrQd+t8qSLUr2xeA== X-CSE-MsgGUID: ByaW6MTESbK8hO6UL3EjcQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="128007160" Received: from unknown (HELO localhost.localdomain) ([10.239.252.210]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2025 02:13:22 -0800 From: Yuan Wang To: dev@dpdk.org Cc: anatoly.burakov@intel.com, vladimir.medvedkin@intel.com, Dawid Zielinski , Yuan Wang Subject: [PATCH 02/10] net/ixgbe/base: add interface for LED control on E610 Date: Tue, 14 Jan 2025 18:10:12 +0800 Message-ID: <20250114101024.159941-3-yuanx.wang@intel.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20250114101024.159941-1-yuanx.wang@intel.com> References: <20250114101024.159941-1-yuanx.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Dawid Zielinski Add interface for sending ACI command for setting port identification LED on E610. Signed-off-by: Dawid Zielinski Signed-off-by: Yuan Wang --- drivers/net/ixgbe/base/ixgbe_e610.c | 29 ++++++++++++++++++++++++ drivers/net/ixgbe/base/ixgbe_e610.h | 1 + drivers/net/ixgbe/base/ixgbe_type_e610.h | 15 ++++++++++++ 3 files changed, 45 insertions(+) diff --git a/drivers/net/ixgbe/base/ixgbe_e610.c b/drivers/net/ixgbe/base/ixgbe_e610.c index b0d55a2411..ee8614d3db 100644 --- a/drivers/net/ixgbe/base/ixgbe_e610.c +++ b/drivers/net/ixgbe/base/ixgbe_e610.c @@ -2004,6 +2004,35 @@ s32 ixgbe_aci_write_i2c(struct ixgbe_hw *hw, return ixgbe_aci_send_cmd(hw, &desc, NULL, 0); } +/** + * ixgbe_aci_set_port_id_led - set LED value for the given port + * @hw: pointer to the HW struct + * @orig_mode: set LED original mode + * + * Set LED value for the given port (0x06E9) + * + * Return: the exit code of the operation. + */ +s32 ixgbe_aci_set_port_id_led(struct ixgbe_hw *hw, bool orig_mode) +{ + struct ixgbe_aci_cmd_set_port_id_led *cmd; + struct ixgbe_aci_desc desc; + + cmd = &desc.params.set_port_id_led; + + ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_set_port_id_led); + + cmd->lport_num = (u8)hw->bus.func; + cmd->lport_num_valid = IXGBE_ACI_PORT_ID_PORT_NUM_VALID; + + if (orig_mode) + cmd->ident_mode = IXGBE_ACI_PORT_IDENT_LED_ORIG; + else + cmd->ident_mode = IXGBE_ACI_PORT_IDENT_LED_BLINK; + + return ixgbe_aci_send_cmd(hw, &desc, NULL, 0); +} + /** * ixgbe_aci_set_gpio - set GPIO pin state * @hw: pointer to the hw struct diff --git a/drivers/net/ixgbe/base/ixgbe_e610.h b/drivers/net/ixgbe/base/ixgbe_e610.h index 4babee821e..716bb86303 100644 --- a/drivers/net/ixgbe/base/ixgbe_e610.h +++ b/drivers/net/ixgbe/base/ixgbe_e610.h @@ -61,6 +61,7 @@ s32 ixgbe_aci_read_i2c(struct ixgbe_hw *hw, s32 ixgbe_aci_write_i2c(struct ixgbe_hw *hw, struct ixgbe_aci_cmd_link_topo_addr topo_addr, u16 bus_addr, __le16 addr, u8 params, u8 *data); +s32 ixgbe_aci_set_port_id_led(struct ixgbe_hw *hw, bool orig_mode); s32 ixgbe_aci_set_gpio(struct ixgbe_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx, bool value); s32 ixgbe_aci_get_gpio(struct ixgbe_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx, diff --git a/drivers/net/ixgbe/base/ixgbe_type_e610.h b/drivers/net/ixgbe/base/ixgbe_type_e610.h index bad332c6b8..4f09fcf3d5 100644 --- a/drivers/net/ixgbe/base/ixgbe_type_e610.h +++ b/drivers/net/ixgbe/base/ixgbe_type_e610.h @@ -477,6 +477,7 @@ enum ixgbe_aci_opc { ixgbe_aci_opc_write_mdio = 0x06E5, ixgbe_aci_opc_set_gpio_by_func = 0x06E6, ixgbe_aci_opc_get_gpio_by_func = 0x06E7, + ixgbe_aci_opc_set_port_id_led = 0x06E9, ixgbe_aci_opc_set_gpio = 0x06EC, ixgbe_aci_opc_get_gpio = 0x06ED, ixgbe_aci_opc_sff_eeprom = 0x06EE, @@ -1252,6 +1253,19 @@ struct ixgbe_aci_cmd_gpio_by_func { IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_gpio_by_func); +/* Set Port Identification LED (direct, 0x06E9) */ +struct ixgbe_aci_cmd_set_port_id_led { + u8 lport_num; + u8 lport_num_valid; +#define IXGBE_ACI_PORT_ID_PORT_NUM_VALID BIT(0) + u8 ident_mode; +#define IXGBE_ACI_PORT_IDENT_LED_BLINK BIT(0) +#define IXGBE_ACI_PORT_IDENT_LED_ORIG 0 + u8 rsvd[13]; +}; + +IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_set_port_id_led); + /* Set/Get GPIO (direct, 0x06EC/0x06ED) */ struct ixgbe_aci_cmd_gpio { __le16 gpio_ctrl_handle; @@ -1854,6 +1868,7 @@ struct ixgbe_aci_desc { struct ixgbe_aci_cmd_mdio read_write_mdio; struct ixgbe_aci_cmd_mdio read_mdio; struct ixgbe_aci_cmd_mdio write_mdio; + struct ixgbe_aci_cmd_set_port_id_led set_port_id_led; struct ixgbe_aci_cmd_gpio_by_func read_write_gpio_by_func; struct ixgbe_aci_cmd_gpio read_write_gpio; struct ixgbe_aci_cmd_sff_eeprom read_write_sff_param; -- 2.43.5