From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00054.outbound.protection.outlook.com [40.107.0.54]) by dpdk.org (Postfix) with ESMTP id A58294CA9 for ; Mon, 8 Apr 2019 13:22:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0Vx+5fyYGmIs18dyen4WT2AmqpOr18sk9d3lHCCTceQ=; b=GkGOC9qMsXBhQ3BLV84zS5bVC2lUw7aHspRXFgmNSmfVrgNdzp/D99PC/ZEakVmathRvJjBaeB7Rfu82+aqhBG4rxp8stPuwOmAKUng7kNfRUW6aOOZ8hvC7QvmLqEt4ctVrAnmWcknnAyRGGcbsd27yj7IG35jBnJ9PsYTCVTg= Received: from VE1PR04MB6365.eurprd04.prod.outlook.com (10.255.118.78) by VE1PR04MB6606.eurprd04.prod.outlook.com (20.179.235.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.13; Mon, 8 Apr 2019 11:22:35 +0000 Received: from VE1PR04MB6365.eurprd04.prod.outlook.com ([fe80::f5ad:f178:4c55:13e0]) by VE1PR04MB6365.eurprd04.prod.outlook.com ([fe80::f5ad:f178:4c55:13e0%3]) with mapi id 15.20.1771.016; Mon, 8 Apr 2019 11:22:35 +0000 From: Gagandeep Singh To: "dev@dpdk.org" , "ferruh.yigit@intel.com" CC: Gagandeep Singh Thread-Topic: [PATCH 04/13] net/enetc: set interface mode for SXGMII Thread-Index: AQHU7f1dWmm0JZ9HDkecCn42XpD1TA== Date: Mon, 8 Apr 2019 11:22:34 +0000 Message-ID: <1554745507-15089-5-git-send-email-g.singh@nxp.com> References: <1554745507-15089-1-git-send-email-g.singh@nxp.com> In-Reply-To: <1554745507-15089-1-git-send-email-g.singh@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0003.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::13) To VE1PR04MB6365.eurprd04.prod.outlook.com (2603:10a6:803:12a::14) x-mailer: git-send-email 1.9.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.120.1.67] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 29a96431-0f51-4aae-bcad-08d6bc147f98 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:VE1PR04MB6606; x-ms-traffictypediagnostic: VE1PR04MB6606: x-microsoft-antispam-prvs: x-forefront-prvs: 0001227049 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(39860400002)(396003)(136003)(199004)(189003)(76176011)(97736004)(81156014)(71200400001)(71190400001)(72206003)(3846002)(25786009)(81166006)(53936002)(2616005)(5660300002)(6116002)(8676002)(7736002)(446003)(478600001)(8936002)(11346002)(305945005)(2906002)(256004)(14444005)(66066001)(6512007)(476003)(6436002)(486006)(50226002)(2501003)(99286004)(106356001)(86362001)(110136005)(4326008)(6486002)(68736007)(105586002)(6506007)(52116002)(316002)(26005)(386003)(14454004)(186003)(36756003)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6606; H:VE1PR04MB6365.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ++oB21v3VLn+0d5s6WS5vUzJfuDKI9lsXF0XNIIhPN5tjy1D9wgzI+AB1NdjXNsdAxeGuGGLkseD0qWDvTJwyga1HC81+6lZmjsxof75iX32AudGc/C/vzuXNF8q0dwK3CRJrYVBq2lH0SrpeJ6I55j5wfwrvi6e2H2ED3i1lMIwWa+cx8LCrHRUSezVRnKpbTCN9I+CBx50ar/UurNbsYJCLhjWi638jz5yRBgQOLqc27qDLv/yO3xuTYZuuybJ+C/36A8MAZmlRTjW2NmX9CgpAtzmKVbDC45Kmw9vXGeIHzGm34ry200gEqNzyEkf4heD/SyFMandBJ0NnrnyF1FgAZ4vDoNn+tRnw21bP3QbD1z5HID9/flaFW451Su2uVqObl1y19XUD8XyXVwvTyMnSQakktHTEaGhJLJEfk4= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29a96431-0f51-4aae-bcad-08d6bc147f98 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Apr 2019 11:22:34.9720 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6606 Subject: [dpdk-dev] [PATCH 04/13] net/enetc: set interface mode for SXGMII X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Apr 2019 11:22:37 -0000 Support for SXGMII port has been enabled. It will depends on boot loader information passed through IERB. Signed-off-by: Gagandeep Singh --- drivers/net/enetc/base/enetc_hw.h | 13 ++++++++++++- drivers/net/enetc/enetc_ethdev.c | 11 +++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/net/enetc/base/enetc_hw.h b/drivers/net/enetc/base/ene= tc_hw.h index f36fa11..e3738a6 100644 --- a/drivers/net/enetc/base/enetc_hw.h +++ b/drivers/net/enetc/base/enetc_hw.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2019 NXP */ =20 #ifndef _ENETC_HW_H_ @@ -84,6 +84,12 @@ #define ENETC_PSIPMAR1(n) (0x00104 + (n) * 0x20) #define ENETC_PCAPR0 0x00900 #define ENETC_PCAPR1 0x00904 +#define ENETC_PM0_IF_MODE 0x8300 +#define ENETC_PM1_IF_MODE 0x9300 +#define ENETC_PMO_IFM_RG BIT(2) +#define ENETC_PM0_IFM_RLP (BIT(5) | BIT(11)) +#define ENETC_PM0_IFM_RGAUTO (BIT(15) | ENETC_PMO_IFM_RG | BIT(1)) +#define ENETC_PM0_IFM_XGMII BIT(12) =20 #define ENETC_PV0CFGR(n) (0x00920 + (n) * 0x10) #define ENETC_PVCFGR_SET_TXBDR(val) ((val) & 0xff) @@ -109,6 +115,11 @@ #define ENETC_G_EIPBRR0 0x00bf8 #define ENETC_G_EIPBRR1 0x00bfc =20 + +/* MAC Counters */ +#define ENETC_G_EPFBLPR(n) (0xd00 + 4 * (n)) +#define ENETC_G_EPFBLPR1_XGMII 0x80000000 + /* general register accessors */ #define enetc_rd_reg(reg) rte_read32((void *)(reg)) #define enetc_wr_reg(reg, val) rte_write32((val), (void *)(reg)) diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_eth= dev.c index f1807b9..91e9692 100644 --- a/drivers/net/enetc/enetc_ethdev.c +++ b/drivers/net/enetc/enetc_ethdev.c @@ -139,6 +139,17 @@ static int enetc_tx_queue_setup(struct rte_eth_dev *de= v, uint16_t tx_queue_id, ENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PMR), val | ENETC_PMR_EN); =20 + /* set auto-speed for RGMII */ + if (enetc_port_rd(&hw->hw, ENETC_PM0_IF_MODE) & ENETC_PMO_IFM_RG) { + enetc_port_wr(&hw->hw, ENETC_PM0_IF_MODE, ENETC_PM0_IFM_RGAUTO); + enetc_port_wr(&hw->hw, ENETC_PM1_IF_MODE, ENETC_PM0_IFM_RGAUTO); + } + if (enetc_global_rd(&hw->hw, + ENETC_G_EPFBLPR(1)) =3D=3D ENETC_G_EPFBLPR1_XGMII) { + enetc_port_wr(&hw->hw, ENETC_PM0_IF_MODE, ENETC_PM0_IFM_XGMII); + enetc_port_wr(&hw->hw, ENETC_PM1_IF_MODE, ENETC_PM0_IFM_XGMII); + } + return 0; } =20 --=20 1.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id B71BEA0096 for ; Mon, 8 Apr 2019 13:23:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 420815587; Mon, 8 Apr 2019 13:22:51 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00054.outbound.protection.outlook.com [40.107.0.54]) by dpdk.org (Postfix) with ESMTP id A58294CA9 for ; Mon, 8 Apr 2019 13:22:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0Vx+5fyYGmIs18dyen4WT2AmqpOr18sk9d3lHCCTceQ=; b=GkGOC9qMsXBhQ3BLV84zS5bVC2lUw7aHspRXFgmNSmfVrgNdzp/D99PC/ZEakVmathRvJjBaeB7Rfu82+aqhBG4rxp8stPuwOmAKUng7kNfRUW6aOOZ8hvC7QvmLqEt4ctVrAnmWcknnAyRGGcbsd27yj7IG35jBnJ9PsYTCVTg= Received: from VE1PR04MB6365.eurprd04.prod.outlook.com (10.255.118.78) by VE1PR04MB6606.eurprd04.prod.outlook.com (20.179.235.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.13; Mon, 8 Apr 2019 11:22:35 +0000 Received: from VE1PR04MB6365.eurprd04.prod.outlook.com ([fe80::f5ad:f178:4c55:13e0]) by VE1PR04MB6365.eurprd04.prod.outlook.com ([fe80::f5ad:f178:4c55:13e0%3]) with mapi id 15.20.1771.016; Mon, 8 Apr 2019 11:22:35 +0000 From: Gagandeep Singh To: "dev@dpdk.org" , "ferruh.yigit@intel.com" CC: Gagandeep Singh Thread-Topic: [PATCH 04/13] net/enetc: set interface mode for SXGMII Thread-Index: AQHU7f1dWmm0JZ9HDkecCn42XpD1TA== Date: Mon, 8 Apr 2019 11:22:34 +0000 Message-ID: <1554745507-15089-5-git-send-email-g.singh@nxp.com> References: <1554745507-15089-1-git-send-email-g.singh@nxp.com> In-Reply-To: <1554745507-15089-1-git-send-email-g.singh@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0003.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::13) To VE1PR04MB6365.eurprd04.prod.outlook.com (2603:10a6:803:12a::14) x-mailer: git-send-email 1.9.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.120.1.67] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 29a96431-0f51-4aae-bcad-08d6bc147f98 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:VE1PR04MB6606; x-ms-traffictypediagnostic: VE1PR04MB6606: x-microsoft-antispam-prvs: x-forefront-prvs: 0001227049 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(39860400002)(396003)(136003)(199004)(189003)(76176011)(97736004)(81156014)(71200400001)(71190400001)(72206003)(3846002)(25786009)(81166006)(53936002)(2616005)(5660300002)(6116002)(8676002)(7736002)(446003)(478600001)(8936002)(11346002)(305945005)(2906002)(256004)(14444005)(66066001)(6512007)(476003)(6436002)(486006)(50226002)(2501003)(99286004)(106356001)(86362001)(110136005)(4326008)(6486002)(68736007)(105586002)(6506007)(52116002)(316002)(26005)(386003)(14454004)(186003)(36756003)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6606; H:VE1PR04MB6365.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ++oB21v3VLn+0d5s6WS5vUzJfuDKI9lsXF0XNIIhPN5tjy1D9wgzI+AB1NdjXNsdAxeGuGGLkseD0qWDvTJwyga1HC81+6lZmjsxof75iX32AudGc/C/vzuXNF8q0dwK3CRJrYVBq2lH0SrpeJ6I55j5wfwrvi6e2H2ED3i1lMIwWa+cx8LCrHRUSezVRnKpbTCN9I+CBx50ar/UurNbsYJCLhjWi638jz5yRBgQOLqc27qDLv/yO3xuTYZuuybJ+C/36A8MAZmlRTjW2NmX9CgpAtzmKVbDC45Kmw9vXGeIHzGm34ry200gEqNzyEkf4heD/SyFMandBJ0NnrnyF1FgAZ4vDoNn+tRnw21bP3QbD1z5HID9/flaFW451Su2uVqObl1y19XUD8XyXVwvTyMnSQakktHTEaGhJLJEfk4= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29a96431-0f51-4aae-bcad-08d6bc147f98 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Apr 2019 11:22:34.9720 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6606 Subject: [dpdk-dev] [PATCH 04/13] net/enetc: set interface mode for SXGMII X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190408112234.syIfDP8LaDGumJB9dyZXFBeSJuOzAOnORup1ULvIWBQ@z> Support for SXGMII port has been enabled. It will depends on boot loader information passed through IERB. Signed-off-by: Gagandeep Singh --- drivers/net/enetc/base/enetc_hw.h | 13 ++++++++++++- drivers/net/enetc/enetc_ethdev.c | 11 +++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/net/enetc/base/enetc_hw.h b/drivers/net/enetc/base/ene= tc_hw.h index f36fa11..e3738a6 100644 --- a/drivers/net/enetc/base/enetc_hw.h +++ b/drivers/net/enetc/base/enetc_hw.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018 NXP + * Copyright 2018-2019 NXP */ =20 #ifndef _ENETC_HW_H_ @@ -84,6 +84,12 @@ #define ENETC_PSIPMAR1(n) (0x00104 + (n) * 0x20) #define ENETC_PCAPR0 0x00900 #define ENETC_PCAPR1 0x00904 +#define ENETC_PM0_IF_MODE 0x8300 +#define ENETC_PM1_IF_MODE 0x9300 +#define ENETC_PMO_IFM_RG BIT(2) +#define ENETC_PM0_IFM_RLP (BIT(5) | BIT(11)) +#define ENETC_PM0_IFM_RGAUTO (BIT(15) | ENETC_PMO_IFM_RG | BIT(1)) +#define ENETC_PM0_IFM_XGMII BIT(12) =20 #define ENETC_PV0CFGR(n) (0x00920 + (n) * 0x10) #define ENETC_PVCFGR_SET_TXBDR(val) ((val) & 0xff) @@ -109,6 +115,11 @@ #define ENETC_G_EIPBRR0 0x00bf8 #define ENETC_G_EIPBRR1 0x00bfc =20 + +/* MAC Counters */ +#define ENETC_G_EPFBLPR(n) (0xd00 + 4 * (n)) +#define ENETC_G_EPFBLPR1_XGMII 0x80000000 + /* general register accessors */ #define enetc_rd_reg(reg) rte_read32((void *)(reg)) #define enetc_wr_reg(reg, val) rte_write32((val), (void *)(reg)) diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_eth= dev.c index f1807b9..91e9692 100644 --- a/drivers/net/enetc/enetc_ethdev.c +++ b/drivers/net/enetc/enetc_ethdev.c @@ -139,6 +139,17 @@ static int enetc_tx_queue_setup(struct rte_eth_dev *de= v, uint16_t tx_queue_id, ENETC_REG_WRITE(ENETC_GET_HW_ADDR(hw->hw.port, ENETC_PMR), val | ENETC_PMR_EN); =20 + /* set auto-speed for RGMII */ + if (enetc_port_rd(&hw->hw, ENETC_PM0_IF_MODE) & ENETC_PMO_IFM_RG) { + enetc_port_wr(&hw->hw, ENETC_PM0_IF_MODE, ENETC_PM0_IFM_RGAUTO); + enetc_port_wr(&hw->hw, ENETC_PM1_IF_MODE, ENETC_PM0_IFM_RGAUTO); + } + if (enetc_global_rd(&hw->hw, + ENETC_G_EPFBLPR(1)) =3D=3D ENETC_G_EPFBLPR1_XGMII) { + enetc_port_wr(&hw->hw, ENETC_PM0_IF_MODE, ENETC_PM0_IFM_XGMII); + enetc_port_wr(&hw->hw, ENETC_PM1_IF_MODE, ENETC_PM0_IFM_XGMII); + } + return 0; } =20 --=20 1.9.1