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 353B0A0351; Mon, 31 Jan 2022 06:39:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A8DB64114B; Mon, 31 Jan 2022 06:39:42 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2073.outbound.protection.outlook.com [40.107.243.73]) by mails.dpdk.org (Postfix) with ESMTP id 59D2840F35 for ; Mon, 31 Jan 2022 06:39:41 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RV1jv7ICu7lyIBLNttCgTE/cufSPoumzvQYccIduxqZ68wHmLQEZxaFPhS7ZranOZTBc6kdxOvUBZ7LU/r3Z3ADDcWu0WxnvAJ2ZQmmayMbvXP8heYbrtAW9yL9qAG7iyT7+dniMVxUpHGRzOONYHJDF7ztujnA+U6W9tSZFMr4tNSC/R4mx2K8s1AvVys2u1nKp7L4oqmb0sIwofBIJrikCCybS1Neh4gnBvTgfYtnZdUNE/JuxfxYTCohoaSZ25OEdaUX65eDJR7unaPXWKIJEPqoRrrdU+PvEKBGgWlKG3O+Wr0Km1m3UFDUpgZ8nEOH8/Q3lZRR0BOkKcearAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OabMvcqxv1kCl1C0OIYX6xrV2YTzWQR7YcH1IHoLHz4=; b=WYfYV0g0LDuPHEZ1z0rf97ZZFo74UyImSoji0Spl09E5Qj1PExmtidsVYDv9uzToCNTKb3W5w9HzQQbAi5eS7JVRhxKwoPkMTt77daXNK/LUdqyYg5wOdiS5JKQd3rL4iVVhyn7mkKQHU2EAfeSiajgFDJh6tNao9crGxDY86GXJBhtVS4l/c0JpmKfiVWQLGpmHxjbPOS4udw5gAXsq2h18fqd/qi+Qdznw0J62gxm4y2e0S0fVcLEiQepvBEcKcgmAIZam1aZjYxFO/1uj6uoqV2Bh0Kiokbi5fWjqdIPk3Ohu6/k48j7BHyyKmkKZtgzdW9p24N2Og1vuy91i8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OabMvcqxv1kCl1C0OIYX6xrV2YTzWQR7YcH1IHoLHz4=; b=YZ+QQWgUG8DcIKu98THVVJ8UwAfi+63PFI7K6UOnQsXIIaDzgSFKDsSmwZTLbe+y+J8GuH0+zHKJv3nwJN4IXyk6IrqPr3Bl5tlFlI2UORLwRZFgaO+ZItgFdFcm65gR1gdQ4yuW8VvOTNy1qhhC37YVOeY3pA1YhnVC585QoSg= Received: from MW4PR03CA0161.namprd03.prod.outlook.com (2603:10b6:303:8d::16) by MW3PR12MB4457.namprd12.prod.outlook.com (2603:10b6:303:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Mon, 31 Jan 2022 05:39:38 +0000 Received: from CO1NAM11FT055.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8d:cafe::36) by MW4PR03CA0161.outlook.office365.com (2603:10b6:303:8d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15 via Frontend Transport; Mon, 31 Jan 2022 05:39:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT055.mail.protection.outlook.com (10.13.175.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4930.15 via Frontend Transport; Mon, 31 Jan 2022 05:39:38 +0000 Received: from cae-Lilac-RMB.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Sun, 30 Jan 2022 23:39:36 -0600 From: To: CC: , Subject: [PATCH v1 1/2] net/axgbe: add support for Yellow Carp ethernet device Date: Mon, 31 Jan 2022 11:09:19 +0530 Message-ID: <20220131053920.167230-2-ssebasti@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220131053920.167230-1-ssebasti@amd.com> References: <20220131053920.167230-1-ssebasti@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 875a3ace-0916-4d90-b67a-08d9e47c1277 X-MS-TrafficTypeDiagnostic: MW3PR12MB4457:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MK58Mxw5YK///ZeleyCFfWnw3ZFqFaISv7opkBPYOsP6zkEDWBTRgY2L91wbLs9fKMrDfw6ShyJQvWPzMO3g3gWXGV2rpB/bLsWBcEzfqTDlrWDGp15QBDn/fNy3MZWKtX9XaUZ8hP+WnpS5q54Bi2h/CVIeYaUjShbXjhAL1jGyFGE1sKMstzAwVolKESBGJ8uoIW6625r37YWEI8mAw/fjp4Mi+Imr9b1MEyYWSIh8YOlSSmFU4KP9zUaL1k/fWyPL7fIIpf4CoW8qNxbxjz1sLVu1LlYevIIBIwNIyMdWPo7skM/Gig1QDiTkMHJeDxU+z3Vk7t2Ko6VAdR2mhFzKr29aubqqwlaJ1ngt/srIv6WJNs/mcqQfk4P78ZdmgFPm8jAzmbLaWKKkbB4kw2t2wAp4BNaeXr6bJD5JcMuxD6EcDexu/aIa4Ls9IpMLkGUztFmowToQqiivgF4B700o79lYYNv6m9vsEDYDquvr4/4xss+gPjhCDi4A+6R68WBfkOu2fIrpDeb+Roz1vp/aLvifzIUWbWgmGZJhl2D9IA01gSN+VmCq0giVERr62mY4MWFDlm+7YWkMst+KDH1/mTu2sCSNzSqxynhnQCYhNNFNCgTv9X8FMNOHF5uy6M1lBYRvwaJuANsdVpLQllStoHEHLJEGfL9Ff/pzOEi7JGxQYKhgEPpgP3SMuNb+W0imZry1tzdy12bJllQ2ZA== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(83380400001)(508600001)(8936002)(5660300002)(54906003)(6916009)(70206006)(70586007)(316002)(82310400004)(4326008)(8676002)(7696005)(6666004)(40460700003)(1076003)(16526019)(26005)(186003)(47076005)(336012)(426003)(356005)(81166007)(2876002)(2616005)(2906002)(36860700001)(36756003)(36900700001)(20210929001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2022 05:39:38.4830 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 875a3ace-0916-4d90-b67a-08d9e47c1277 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT055.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4457 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: Selwin Sebastian Yellow Carp ethernet devices (V3xxx) use the existing PCI ID but the window settings for the indirect PCS access have been altered. Add the check for Yellow Carp Ethernet devices to use the new register values. Signed-off-by: Selwin Sebastian --- drivers/net/axgbe/axgbe_common.h | 2 ++ drivers/net/axgbe/axgbe_ethdev.c | 34 +++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/drivers/net/axgbe/axgbe_common.h b/drivers/net/axgbe/axgbe_common.h index 5310ac54f5..b9ebf64fb8 100644 --- a/drivers/net/axgbe/axgbe_common.h +++ b/drivers/net/axgbe/axgbe_common.h @@ -901,6 +901,8 @@ #define PCS_V2_WINDOW_SELECT 0x9064 #define PCS_V2_RV_WINDOW_DEF 0x1060 #define PCS_V2_RV_WINDOW_SELECT 0x1064 +#define PCS_V2_YC_WINDOW_DEF 0x18060 +#define PCS_V2_YC_WINDOW_SELECT 0x18064 /* PCS register entry bit positions and sizes */ #define PCS_V2_WINDOW_DEF_OFFSET_INDEX 6 diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index e9546469f3..2be9387f98 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -173,6 +173,8 @@ static const struct axgbe_xstats axgbe_xstats_strings[] = { /* The set of PCI devices this driver supports */ #define AMD_PCI_VENDOR_ID 0x1022 #define AMD_PCI_RV_ROOT_COMPLEX_ID 0x15d0 +#define AMD_PCI_YC_ROOT_COMPLEX_ID 0x14b5 +#define AMD_PCI_SNOWY_ROOT_COMPLEX_ID 0x1450 #define AMD_PCI_AXGBE_DEVICE_V2A 0x1458 #define AMD_PCI_AXGBE_DEVICE_V2B 0x1459 @@ -2178,17 +2180,6 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev) pci_dev = RTE_DEV_TO_PCI(eth_dev->device); pdata->pci_dev = pci_dev; - /* - * Use root complex device ID to differentiate RV AXGBE vs SNOWY AXGBE - */ - if ((get_pci_rc_devid()) == AMD_PCI_RV_ROOT_COMPLEX_ID) { - pdata->xpcs_window_def_reg = PCS_V2_RV_WINDOW_DEF; - pdata->xpcs_window_sel_reg = PCS_V2_RV_WINDOW_SELECT; - } else { - pdata->xpcs_window_def_reg = PCS_V2_WINDOW_DEF; - pdata->xpcs_window_sel_reg = PCS_V2_WINDOW_SELECT; - } - pdata->xgmac_regs = (void *)pci_dev->mem_resource[AXGBE_AXGMAC_BAR].addr; pdata->xprop_regs = (void *)((uint8_t *)pdata->xgmac_regs @@ -2203,6 +2194,27 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev) else pdata->vdata = &axgbe_v2b; + /* + * Use PCI root complex device ID to identify the CPU + */ + switch (get_pci_rc_devid()) { + case AMD_PCI_RV_ROOT_COMPLEX_ID: + pdata->xpcs_window_def_reg = PCS_V2_RV_WINDOW_DEF; + pdata->xpcs_window_sel_reg = PCS_V2_RV_WINDOW_SELECT; + break; + case AMD_PCI_YC_ROOT_COMPLEX_ID: + pdata->xpcs_window_def_reg = PCS_V2_YC_WINDOW_DEF; + pdata->xpcs_window_sel_reg = PCS_V2_YC_WINDOW_SELECT; + break; + case AMD_PCI_SNOWY_ROOT_COMPLEX_ID: + pdata->xpcs_window_def_reg = PCS_V2_WINDOW_DEF; + pdata->xpcs_window_sel_reg = PCS_V2_WINDOW_SELECT; + break; + default: + PMD_DRV_LOG(ERR, "No supported devices found\n"); + return -ENODEV; + } + /* Configure the PCS indirect addressing support */ reg = XPCS32_IOREAD(pdata, pdata->xpcs_window_def_reg); pdata->xpcs_window = XPCS_GET_BITS(reg, PCS_V2_WINDOW_DEF, OFFSET); -- 2.25.1