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 DDB4CA0555; Fri, 3 Jun 2022 22:25:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 072034021E; Fri, 3 Jun 2022 22:25:28 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 270AB40041; Fri, 3 Jun 2022 22:25:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654287926; x=1685823926; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=DYtbP65fHGIucWbSEGMU1l8679C183sXzSRlV6UpVi4=; b=VR40YPDKXbspLTF1r5kJ3T4qlP1OSQU+c8BsCMwZOhsUbKU9jzWB9ZES 2cv/LYxa9u36d06YA1nCyjFYjB0bJTUQxHm68a097ydLBAn8nr6ccJ8CY 0JjqBZycSU0ffUVj+P5bf9TVMg0CByoT+vINBZutKYd+FhKOnkX6yBRxy yfrbJANONfcqpbezAEwaRbiuLLCjmOeKjgvNBAI11tRUUgQH8dTv5EVK0 mP/8CuAdLpWamqGbKkeP0Wexk/lWr5CMo49REuwnTBo0NfJfVbz6dOMG/ xoTtLSi/WzvrBMTI0CrZcfQelwvGtlVQNI3iU49DwBu4G2FjnUxRGrU3i g==; X-IronPort-AV: E=McAfee;i="6400,9594,10367"; a="256813780" X-IronPort-AV: E=Sophos;i="5.91,275,1647327600"; d="scan'208";a="256813780" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 13:25:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,275,1647327600"; d="scan'208";a="531171528" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga003.jf.intel.com with ESMTP; 03 Jun 2022 13:25:22 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 3 Jun 2022 13:25:21 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 3 Jun 2022 13:25:21 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Fri, 3 Jun 2022 13:25:21 -0700 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.171) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Fri, 3 Jun 2022 13:25:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N0ry5F4zBRQxFyj+do9gPY2DaQ8trgQc4YgUsRnfgMxMEbLokkVXSiAzYrw/SONPiYH9aTwdH3KzYBRYc6Pg5cVEnZrAI/3G5L4HawMMfV7H5F+1qj6FNS8xmk3em/D+Vq3ZoVYORQQORWJNdrV6rXULIUOMHsTzI/4QNuhJdyNFVSiXLvji4N772hUfcuxVRd0O7X/tBsAiyhnIYeG4iIfha3QQziVZbO6FZ9Zjm/1ds4GLXDaVIGrOZiNgAux8tNhXzeY0pkmMI+IV01JbRP3ZPy44XdjH9/G5NJa0UbW/k/HbwIX7p4JU/GLQZ9Eo1mLUvhSN3m7Yl5n9kjbRMw== 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=rHFRGM8ryqdbNL/4/G6zqzDg0Y2srSstK6cLaIX3d+U=; b=hzJZYmzXw2Cp8R79JdzIj3AApJMG1qmBdeEAuzOYhZmWDXopfWwR7lNe/AbgbNvSAeppyo/xPrvrhgXcuXHpFnhzPWjhl3MNW8JkXb2wDcNA2+dqRlhV1f18RY82fLivDwC6hwlT4+uYx2h33DgJExhjwZJluWfWab08j44P6tnKBgQkzU/QetbBlS/ANWJeID11hb5hogDkJ5zphRvOls4ZR1MCJNj7SjqCxY/OzG0vIYkEFaNK/hm+fbzC4x8ScmhiuqtXi/tsROfiNFXtBJLB5VYsfn8Q7IwqGf/REJiciaCe7TfUlRBjFmSYctOa7UHOO6N00SLf/QANu+KUTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB3660.namprd11.prod.outlook.com (2603:10b6:5:13c::17) by MN2PR11MB4191.namprd11.prod.outlook.com (2603:10b6:208:151::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Fri, 3 Jun 2022 20:25:19 +0000 Received: from DM6PR11MB3660.namprd11.prod.outlook.com ([fe80::181d:ca9a:26e8:cf59]) by DM6PR11MB3660.namprd11.prod.outlook.com ([fe80::181d:ca9a:26e8:cf59%7]) with mapi id 15.20.5314.013; Fri, 3 Jun 2022 20:25:18 +0000 From: "Vargas, Hernan" To: "Chautru, Nicolas" , "dev@dpdk.org" , "gakhil@marvell.com" , "trix@redhat.com" , "maxime.coquelin@redhat.com" CC: "thomas@monjalon.net" , "Kinsella, Ray" , "Richardson, Bruce" , "hemant.agrawal@nxp.com" , "david.marchand@redhat.com" , "stable@dpdk.org" Subject: RE: [PATCH v7 1/6] baseband/acc100: update companion PF configure function Thread-Topic: [PATCH v7 1/6] baseband/acc100: update companion PF configure function Thread-Index: AQHYdT+ayZPfaw65+EWWqq6+afYQEK0+JTqw Date: Fri, 3 Jun 2022 20:25:18 +0000 Message-ID: References: <1653350912-53876-1-git-send-email-nicolas.chautru@intel.com> <1654036307-182860-1-git-send-email-nicolas.chautru@intel.com> <1654036307-182860-2-git-send-email-nicolas.chautru@intel.com> In-Reply-To: <1654036307-182860-2-git-send-email-nicolas.chautru@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.500.17 dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: edd1ee98-2e63-4d35-9fbc-08da459f2d10 x-ms-traffictypediagnostic: MN2PR11MB4191:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jbEktqZ1JTGIMKx241rhxsozFvAkaBshkA7+uyU8dOPcxM0+50OgJ4zWBJ0tolIR9mz85+4SgMqvws6yR1Nqm/agkzJ1oBKtdzvkNYnAD6aqNuC7GAeZuvHV4btI6q/oJLErqzk7lLyYji0ReuWo0y85ausHsZViu7XfQWV/n/pqEgy8mBN7L19tvV7ccH0RsI9QLJ/AtkY2W3OQIPVUmyzjJmnuZJXNrEc5GnG4wFhohJokWOyf8dVJ/VY+Ngp5nOK7YAAhUl11eulMCxjUra+PpLJMpSTkQC9/at0oOJxKUhOyoJQGihVlYZ/eK2o0kcHikJzkHXN3BVPOb5O4A4kGE1CWQNwXOwytpSnic9m/NMnEA5Kp7By6ebDeG6lPqbSodefVIwQwtTLZxhgTsan70N+fAaEDgGilTg02sOy5Wcv3y4+DSEUnNaGAl7MYcmevvf0kiVbXJLwYhlcuwyWqS71P8u8APUU/Aj17eCvrrPMzAGsjXTFGSdZ9GcGNPuIP8qtnHF9qSC2szDXde2ixeairOl9YEfI2nd7/WsGirbci2uXrlHN7bZYjf/MqiKiwHw0fJW6+jCl69XPm0tYL65JKnghn4gsNJSsoC9kKcHAJbFA8xMRlkcjLIR4Cau9XTIli/NjDj55A04VwYjxsIVDoWGVFAPTcEHKsoTJXZhe44vHQ/65/tJJyQjkP3BGsR2zZViehYP2b/u3gdA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3660.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(83380400001)(71200400001)(26005)(2906002)(54906003)(55016003)(8936002)(38070700005)(30864003)(52536014)(4326008)(76116006)(66476007)(66556008)(66946007)(64756008)(8676002)(66446008)(15650500001)(38100700002)(82960400001)(5660300002)(19627235002)(508600001)(7696005)(186003)(316002)(86362001)(9686003)(33656002)(110136005)(53546011)(6506007)(122000001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?6w0/nVJNGX6jp2hgv56Ni/4rl8B62JCt7PwwFOO7yQpUZBi4vKPbJ7h1RVrN?= =?us-ascii?Q?VdDzEbuEk2/zMY0887zOPePl5PzZuoRdqSB97e62y2tcfrWWmTgLn9uF1Bsi?= =?us-ascii?Q?pPP83gCkakftofHNG/7fvROwj53P7Jq9txQRY9E+JYKBflbgFMiekwky60Vm?= =?us-ascii?Q?7A1FmtGtFg5JMDs8w1HFHsRDxbPVgdgDMkkt5Kjm2KQ9GtWun2Jj0fd1gL7/?= =?us-ascii?Q?lOzHYqsV2ATvb5DIq7vndASXJ+zMA0NuPK1294bXofOgNdtWBhdQJxuP4whI?= =?us-ascii?Q?oIiwxGtsR93GIM035SUyNucIyiRSLlDx1QybjEayPPZNESP0hwWZX2DQQHls?= =?us-ascii?Q?0RTFxZtSrzWE4My5kC6Y43zgTdGN5nMINZ8u9wZR6PQ28v7Jy60eOz7xHGZZ?= =?us-ascii?Q?0E4ZJxzahSjWNCwEUf7pffl9ubjiGRaeyM6cXKmFL/6rfHpdfFoDhM4RlhHF?= =?us-ascii?Q?9LzTl+Pg7KbmHEEwkgUWIVRUfMXxHSb+E85iXp9IRMiFNZzWYxjz1UCCnAYX?= =?us-ascii?Q?e/QFwgH+z1xSIg61PDADdlE2Ht6mfmHD+VWvGTqv/ClqshBOzJ7FiP2oVR99?= =?us-ascii?Q?duKIVlkWmacK8CwYqpHXjRx2/K+CLKk9uGBQcJDystHQvKpPH3Kyaum6CH3Q?= =?us-ascii?Q?vGMcgJTJo25iy5+JKjSoYgHXwNdLKuSrmfgRZDqSjjeOU3Or6f6R2fj+FWtK?= =?us-ascii?Q?U2MxwfdEBuD0Lj1/ywuaXS5tPBKRbIrzDA5MSmcosZ4UsIrZaWgNDCpTcC7w?= =?us-ascii?Q?Kr1Q83HLjFgmg6WzUG6MGG0MN+MdLjNiIjimE+/AzpdO/Xyw1WFhUndSj3Hl?= =?us-ascii?Q?Kc9EDZYspf3qeRwDxOElzombyGhdvudh1LbmgGHd0useu+10DLFOLVzWplNY?= =?us-ascii?Q?0QpWI+RgjR/VBZ7A6KZWWttfZUeev+RCWcfgsI7+DWV5+gehbmqaQTawtrCE?= =?us-ascii?Q?fhVGmqHumtmaAdhUl7p/PluGk5VrsnHNEIzIVkZo5DGkggzdRAf34OIbU75I?= =?us-ascii?Q?Wr4Ds9pXAWiEk/HJIiXJRjrdWtRvHPJZG1N7g21w3ayRMvjivoFKaumBFs1+?= =?us-ascii?Q?XykfCc+Wz6pTMwCegYN8L9meqE0+0oZNnHyhI2V9GI3iV8JcOh/DWsZ6Qr8W?= =?us-ascii?Q?lu4vtVpFInyEv7D6P34yczFv0M0OQ63caalX/YUoxdiJb6rgFA2BQeuw11om?= =?us-ascii?Q?mM47a1vDUapWB45fH1F2RTVGhC8eYPz/an7Qv8fuxOhmVZQ1YSJHVr2n/FOJ?= =?us-ascii?Q?dxlcPyeMUdbL8Ijv8lIlWv8nd3daDW520ktII8r/SJDrt75my9DBB5nwOwp/?= =?us-ascii?Q?8sks5nnMtyDxI9LR38AnpHiWwUQdSC7ogOz7k3Kym7EyxJeeFOoPWu29GBTO?= =?us-ascii?Q?KSHqFLwkDbfYUOIwkHNG61iY0KoVRIS8VYtSB3YBP2RUJrRPw44UnTY6EXia?= =?us-ascii?Q?dElK4iF2erY5ac2Y1DHBU0SZnKWZx/YUDUZsX5EsFcP9nOrOJ8mVi4j6gvmt?= =?us-ascii?Q?ijsEBj43MTrGP1iMFbBOpy7LuAgLZSVHuj0A23Kgrotp1lTcDOf8d+RbJRrV?= =?us-ascii?Q?xRZ/RRF3UmT/uuezOKQ13j4AtyLa76XmzNqoCQe1wbQg2j5/ncIdCUkUQq+1?= =?us-ascii?Q?JavbNigCAhNtDSDLBdTBm1JDFY3vKfffET9nT8QgwSJKil7xAGyP4Vu6th1K?= =?us-ascii?Q?BUeEi6Yw/C/5eKhb6TdpUKGkkMwTfNDGYi93+Z5iVuBJ3ktqqRotv6j54jrb?= =?us-ascii?Q?TeNz2rR+2Q=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3660.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: edd1ee98-2e63-4d35-9fbc-08da459f2d10 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2022 20:25:18.4214 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sQfmxE93xq7wT5s+dNpegyv/q7GKTKgXCYvtnTqflobyf90auNL3EGsyXWk+OiPMJltkV5DszFfAtgHFJ59Ksw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4191 X-OriginatorOrg: intel.com 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 -----Original Message----- From: Chautru, Nicolas =20 Sent: Tuesday, May 31, 2022 5:32 PM To: dev@dpdk.org; gakhil@marvell.com; trix@redhat.com; maxime.coquelin@redh= at.com Cc: thomas@monjalon.net; Kinsella, Ray ; Richardson= , Bruce ; hemant.agrawal@nxp.com; Vargas, Herna= n ; david.marchand@redhat.com; Chautru, Nicolas ; stable@dpdk.org Subject: [PATCH v7 1/6] baseband/acc100: update companion PF configure func= tion Update of the device configuration function from PF used for bbdev-test to = latest sequence for ACC199 PRQ device and matching version in pf_bb_config = 22.03. Fixes: b17d70922d5d ("baseband/acc100: add configure function") Cc: stable@dpdk.org Signed-off-by: Nicolas Chautru --- drivers/baseband/acc100/acc100_pf_enum.h | 18 ++++ drivers/baseband/acc1= 00/rte_acc100_pmd.c | 163 +++++++++++++++++++++++-------- drivers/baseband= /acc100/rte_acc100_pmd.h | 20 +++- 3 files changed, 153 insertions(+), 48 deletions(-) Reviewed-by: Hernan Vargas Thanks, Hernan diff --git a/drivers/baseband/acc100/acc100_pf_enum.h b/drivers/baseband/ac= c100/acc100_pf_enum.h index a1ee416..2fba667 100644 --- a/drivers/baseband/acc100/acc100_pf_enum.h +++ b/drivers/baseband/acc100/acc100_pf_enum.h @@ -238,6 +238,24 @@ enum { HWPfPermonBTotalLatLowBusMon =3D 0x00BAC504, HWPfPermonBTotalLatUpperBusMon =3D 0x00BAC508, HWPfPermonBTotalReqCntBusMon =3D 0x00BAC50C, + HwPfFabI2MArbCntrlReg =3D 0x00BB0000, + HWPfFabricMode =3D 0x00BB1000, + HwPfFabI2MGrp0DebugReg =3D 0x00BBF000, + HwPfFabI2MGrp1DebugReg =3D 0x00BBF004, + HwPfFabI2MGrp2DebugReg =3D 0x00BBF008, + HwPfFabI2MGrp3DebugReg =3D 0x00BBF00C, + HwPfFabI2MBuf0DebugReg =3D 0x00BBF010, + HwPfFabI2MBuf1DebugReg =3D 0x00BBF014, + HwPfFabI2MBuf2DebugReg =3D 0x00BBF018, + HwPfFabI2MBuf3DebugReg =3D 0x00BBF01C, + HwPfFabM2IBuf0Grp0DebugReg =3D 0x00BBF020, + HwPfFabM2IBuf1Grp0DebugReg =3D 0x00BBF024, + HwPfFabM2IBuf0Grp1DebugReg =3D 0x00BBF028, + HwPfFabM2IBuf1Grp1DebugReg =3D 0x00BBF02C, + HwPfFabM2IBuf0Grp2DebugReg =3D 0x00BBF030, + HwPfFabM2IBuf1Grp2DebugReg =3D 0x00BBF034, + HwPfFabM2IBuf0Grp3DebugReg =3D 0x00BBF038, + HwPfFabM2IBuf1Grp3DebugReg =3D 0x00BBF03C, HWPfFecUl5gCntrlReg =3D 0x00BC0000, HWPfFecUl5gI2MThreshReg =3D 0x00BC0004, HWPfFecUl5gVersionReg =3D 0x00BC0100, diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/ac= c100/rte_acc100_pmd.c index de7e4bc..79bee43 100644 --- a/drivers/baseband/acc100/rte_acc100_pmd.c +++ b/drivers/baseband/acc100/rte_acc100_pmd.c @@ -141,8 +141,8 @@ int acc_enum =3D accFromQgid(qg_idx, acc100_conf); qtopFromAcc(&q_top, acc_enum, acc100_conf); if (unlikely(q_top =3D=3D NULL)) - return 0; - return q_top->aq_depth_log2; + return 1; + return RTE_MAX(1, q_top->aq_depth_log2); } =20 /* Return the AQ depth for a Queue Group Index */ @@ -4411,7 +4411,7 @@ st= atic int acc100_pci_remove(struct rte_pci_device *pci_dev) { rte_bbdev_log(INFO, "rte_acc100_configure"); uint32_t value, address, status; - int qg_idx, template_idx, vf_idx, acc, i; + int qg_idx, template_idx, vf_idx, acc, i, j; struct rte_bbdev *bbdev =3D rte_bbdev_get_named_dev(dev_name); =20 /* Compile time checks */ @@ -4431,6 +4431,9 @@ static int acc100_pci_remove(struct rte_pci_device *p= ci_dev) /* Store configuration */ rte_memcpy(&d->acc100_conf, conf, sizeof(d->acc100_conf)); =20 + value =3D acc100_reg_read(d, HwPfPcieGpexBridgeControl); + bool firstCfg =3D (value !=3D ACC100_CFG_PCI_BRIDGE); + /* PCIe Bridge configuration */ acc100_reg_write(d, HwPfPcieGpexBridgeControl, ACC100_CFG_PCI_BRIDGE); for (i =3D 1; i < ACC100_GPEX_AXIMAP_NUM; i++) @@ -4451,20 +4454,9 @@ sta= tic int acc100_pci_remove(struct rte_pci_device *pci_dev) value =3D 1; acc100_reg_write(d, address, value); =20 - /* DDR Configuration */ - address =3D HWPfDdrBcTim6; - value =3D acc100_reg_read(d, address); - value &=3D 0xFFFFFFFB; /* Bit 2 */ -#ifdef ACC100_DDR_ECC_ENABLE - value |=3D 0x4; -#endif - acc100_reg_write(d, address, value); - address =3D HWPfDdrPhyDqsCountNum; -#ifdef ACC100_DDR_ECC_ENABLE - value =3D 9; -#else - value =3D 8; -#endif + /* Enable granular dynamic clock gating */ + address =3D HWPfHiClkGateHystReg; + value =3D ACC100_CLOCK_GATING_EN; acc100_reg_write(d, address, value); =20 /* Set default descriptor signature */ @@ -4482,6 +4474,17 @@ static int = acc100_pci_remove(struct rte_pci_device *pci_dev) address =3D HWPfDmaAxcacheReg; acc100_reg_write(d, address, value); =20 + /* Adjust PCIe Lane adaptation */ + for (i =3D 0; i < ACC100_QUAD_NUMS; i++) + for (j =3D 0; j < ACC100_LANES_PER_QUAD; j++) + acc100_reg_write(d, HwPfPcieLnAdaptctrl + i * ACC100_PCIE_QUAD_OFFSET + + j * ACC100_PCIE_LANE_OFFSET, ACC100_ADAPT); + + /* Enable PCIe live adaptation */ + for (i =3D 0; i < ACC100_QUAD_NUMS; i++) + acc100_reg_write(d, HwPfPciePcsEqControl + + i * ACC100_PCIE_QUAD_OFFSET, ACC100_PCS_EQ); + /* Default DMA Configuration (Qmgr Enabled) */ address =3D HWPfDmaConfig0Reg; value =3D 0; @@ -4500,6 +4503,11 @@ static int acc100_pci_remove(struct rte_pci_device *= pci_dev) value =3D HWPfQmgrEgressQueuesTemplate; acc100_reg_write(d, address, value); =20 + /* Default Fabric Mode */ + address =3D HWPfFabricMode; + value =3D ACC100_FABRIC_MODE; + acc100_reg_write(d, address, value); + /* =3D=3D=3D=3D=3D Qmgr Configuration =3D=3D=3D=3D=3D */ /* Configuration of the AQueue Depth QMGR_GRP_0_DEPTH_LOG2 for UL */ int totalQgs =3D conf->q_ul_4g.num_qgroups + @@ -4518,22 +4526,17 @@ stat= ic int acc100_pci_remove(struct rte_pci_device *pci_dev) } =20 /* Template Priority in incremental order */ - for (template_idx =3D 0; template_idx < ACC100_NUM_TMPL; - template_idx++) { - address =3D HWPfQmgrGrpTmplateReg0Indx + - ACC100_BYTES_IN_WORD * (template_idx % 8); + for (template_idx =3D 0; template_idx < ACC100_NUM_TMPL; template_idx++) = { + address =3D HWPfQmgrGrpTmplateReg0Indx + ACC100_BYTES_IN_WORD *=20 +template_idx; value =3D ACC100_TMPL_PRI_0; acc100_reg_write(d, address, value); - address =3D HWPfQmgrGrpTmplateReg1Indx + - ACC100_BYTES_IN_WORD * (template_idx % 8); + address =3D HWPfQmgrGrpTmplateReg1Indx + ACC100_BYTES_IN_WORD *=20 +template_idx; value =3D ACC100_TMPL_PRI_1; acc100_reg_write(d, address, value); - address =3D HWPfQmgrGrpTmplateReg2indx + - ACC100_BYTES_IN_WORD * (template_idx % 8); + address =3D HWPfQmgrGrpTmplateReg2indx + ACC100_BYTES_IN_WORD *=20 +template_idx; value =3D ACC100_TMPL_PRI_2; acc100_reg_write(d, address, value); - address =3D HWPfQmgrGrpTmplateReg3Indx + - ACC100_BYTES_IN_WORD * (template_idx % 8); + address =3D HWPfQmgrGrpTmplateReg3Indx + ACC100_BYTES_IN_WORD *=20 +template_idx; value =3D ACC100_TMPL_PRI_3; acc100_reg_write(d, address, value); } @@ -4584,9 +4587,6 @@ static int acc100_pci_remove(struct rte_pci_device *p= ci_dev) numEngines++; } else acc100_reg_write(d, address, 0); -#if RTE_ACC100_SINGLE_FEC =3D=3D 1 - value =3D 0; -#endif } printf("Number of 5GUL engines %d\n", numEngines); /* 4GDL */ @@ -4601,9 +4601,6 @@ static int acc100_pci_remove(struct rte_pci_device *p= ci_dev) address =3D HWPfQmgrGrpTmplateReg4Indx + ACC100_BYTES_IN_WORD * template_idx; acc100_reg_write(d, address, value); -#if RTE_ACC100_SINGLE_FEC =3D=3D 1 - value =3D 0; -#endif } /* 5GDL */ numQqsAcc +=3D numQgs; @@ -4617,13 +4614,10 @@ static int acc100_pci_remove(struct rte_pci_device = *pci_dev) address =3D HWPfQmgrGrpTmplateReg4Indx + ACC100_BYTES_IN_WORD * template_idx; acc100_reg_write(d, address, value); -#if RTE_ACC100_SINGLE_FEC =3D=3D 1 - value =3D 0; -#endif } =20 /* Queue Group Function mapping */ - int qman_func_id[5] =3D {0, 2, 1, 3, 4}; + int qman_func_id[8] =3D {0, 2, 1, 3, 4, 0, 0, 0}; address =3D HWPfQmgrGrpFunction0; value =3D 0; for (qg_idx =3D 0; qg_idx < 8; qg_idx++) { @@ -4654,7 +4648,7 @@ static i= nt acc100_pci_remove(struct rte_pci_device *pci_dev) } } =20 - /* This pointer to ARAM (256kB) is shifted by 2 (4B per register) */ + /* This pointer to ARAM (128kB) is shifted by 2 (4B per register) */ uint32_t aram_address =3D 0; for (qg_idx =3D 0; qg_idx < totalQgs; qg_idx++) { for (vf_idx =3D 0; vf_idx < conf->num_vf_bundles; vf_idx++) { @@ -4679,6= +4673,11 @@ static int acc100_pci_remove(struct rte_pci_device *pci_dev) =20 /* =3D=3D=3D=3D HI Configuration =3D=3D=3D=3D */ =20 + /* No Info Ring/MSI by default */ + acc100_reg_write(d, HWPfHiInfoRingIntWrEnRegPf, 0); + acc100_reg_write(d, HWPfHiInfoRingVf2pfLoWrEnReg, 0); + acc100_reg_write(d, HWPfHiCfgMsiIntWrEnRegPf, 0xFFFFFFFF); + acc100_reg_write(d, HWPfHiCfgMsiVf2pfLoWrEnReg, 0xFFFFFFFF); /* Prevent Block on Transmit Error */ address =3D HWPfHiBlockTransmitOnErrorEn; value =3D 0; @@ -4691,10 +4690,6 @@ static int acc100_pci_remove(struct rte_pci_device *= pci_dev) address =3D HWPfHiPfMode; value =3D (conf->pf_mode_en) ? ACC100_PF_VAL : 0; acc100_reg_write(d, address, value); - /* Enable Error Detection in HW */ - address =3D HWPfDmaErrorDetectionEn; - value =3D 0x3D7; - acc100_reg_write(d, address, value); =20 /* QoS overflow init */ value =3D 1; @@ -4704,7 +4699,7 @@ static int acc100_pci_remove(struct rte_pci_device *p= ci_dev) acc100_reg_write(d, address, value); =20 /* HARQ DDR Configuration */ - unsigned int ddrSizeInMb =3D 512; /* Fixed to 512 MB per VF for now */ + unsigned int ddrSizeInMb =3D ACC100_HARQ_DDR; for (vf_idx =3D 0; vf_idx < conf->num_vf_bundles; vf_idx++) { address =3D HWPfDmaVfDdrBaseRw + vf_idx * 0x10; @@ -4718,6 +4713,88 @@ static int acc100_pci_remove(struct rte_pci_device *= pci_dev) if (numEngines < (ACC100_SIG_UL_5G_LAST + 1)) poweron_cleanup(bbdev, d, conf); =20 + uint32_t version =3D 0; + for (i =3D 0; i < 4; i++) + version +=3D acc100_reg_read(d, + HWPfDdrPhyIdtmFwVersion + 4 * i) << (8 * i); + if (version !=3D ACC100_PRQ_DDR_VER) { + printf("* Note: Not on DDR PRQ version %8x !=3D %08x\n", + version, ACC100_PRQ_DDR_VER); + } else if (firstCfg) { + /* ---- DDR configuration at boot up --- */ + /* Read Clear Ddr training status */ + acc100_reg_read(d, HWPfChaDdrStDoneStatus); + /* Reset PHY/IDTM/UMMC */ + acc100_reg_write(d, HWPfChaDdrWbRstCfg, 3); + acc100_reg_write(d, HWPfChaDdrApbRstCfg, 2); + acc100_reg_write(d, HWPfChaDdrPhyRstCfg, 2); + acc100_reg_write(d, HWPfChaDdrCpuRstCfg, 3); + acc100_reg_write(d, HWPfChaDdrSifRstCfg, 2); + usleep(ACC100_MS_IN_US); + /* Reset WB and APB resets */ + acc100_reg_write(d, HWPfChaDdrWbRstCfg, 2); + acc100_reg_write(d, HWPfChaDdrApbRstCfg, 3); + /* Configure PHY-IDTM */ + acc100_reg_write(d, HWPfDdrPhyIdletimeout, 0x3e8); + /* IDTM timing registers */ + acc100_reg_write(d, HWPfDdrPhyRdLatency, 0x13); + acc100_reg_write(d, HWPfDdrPhyRdLatencyDbi, 0x15); + acc100_reg_write(d, HWPfDdrPhyWrLatency, 0x10011); + /* Configure SDRAM MRS registers */ + acc100_reg_write(d, HWPfDdrPhyMr01Dimm, 0x3030b70); + acc100_reg_write(d, HWPfDdrPhyMr01DimmDbi, 0x3030b50); + acc100_reg_write(d, HWPfDdrPhyMr23Dimm, 0x30); + acc100_reg_write(d, HWPfDdrPhyMr67Dimm, 0xc00); + acc100_reg_write(d, HWPfDdrPhyMr45Dimm, 0x4000000); + /* Configure active lanes */ + acc100_reg_write(d, HWPfDdrPhyDqsCountMax, 0x9); + acc100_reg_write(d, HWPfDdrPhyDqsCountNum, 0x9); + /* Configure WR/RD leveling timing registers */ + acc100_reg_write(d, HWPfDdrPhyWrlvlWwRdlvlRr, 0x101212); + /* Configure what trainings to execute */ + acc100_reg_write(d, HWPfDdrPhyTrngType, 0x2d3c); + /* Releasing PHY reset */ + acc100_reg_write(d, HWPfChaDdrPhyRstCfg, 3); + /* Configure Memory Controller registers */ + acc100_reg_write(d, HWPfDdrMemInitPhyTrng0, 0x3); + acc100_reg_write(d, HWPfDdrBcDram, 0x3c232003); + acc100_reg_write(d, HWPfDdrBcAddrMap, 0x31); + /* Configure UMMC BC timing registers */ + acc100_reg_write(d, HWPfDdrBcRef, 0xa22); + acc100_reg_write(d, HWPfDdrBcTim0, 0x4050501); + acc100_reg_write(d, HWPfDdrBcTim1, 0xf0b0476); + acc100_reg_write(d, HWPfDdrBcTim2, 0x103); + acc100_reg_write(d, HWPfDdrBcTim3, 0x144050a1); + acc100_reg_write(d, HWPfDdrBcTim4, 0x23300); + acc100_reg_write(d, HWPfDdrBcTim5, 0x4230276); + acc100_reg_write(d, HWPfDdrBcTim6, 0x857914); + acc100_reg_write(d, HWPfDdrBcTim7, 0x79100232); + acc100_reg_write(d, HWPfDdrBcTim8, 0x100007ce); + acc100_reg_write(d, HWPfDdrBcTim9, 0x50020); + acc100_reg_write(d, HWPfDdrBcTim10, 0x40ee); + /* Configure UMMC DFI timing registers */ + acc100_reg_write(d, HWPfDdrDfiInit, 0x5000); + acc100_reg_write(d, HWPfDdrDfiTim0, 0x15030006); + acc100_reg_write(d, HWPfDdrDfiTim1, 0x11305); + acc100_reg_write(d, HWPfDdrDfiPhyUpdEn, 0x1); + acc100_reg_write(d, HWPfDdrUmmcIntEn, 0x1f); + /* Release IDTM CPU out of reset */ + acc100_reg_write(d, HWPfChaDdrCpuRstCfg, 0x2); + /* Wait PHY-IDTM to finish static training */ + for (i =3D 0; i < ACC100_DDR_TRAINING_MAX; i++) { + usleep(ACC100_MS_IN_US); + value =3D acc100_reg_read(d, + HWPfChaDdrStDoneStatus); + if (value & 1) + break; + } + printf("DDR Training completed in %d ms", i); + /* Enable Memory Controller */ + acc100_reg_write(d, HWPfDdrUmmcCtrl, 0x401); + /* Release AXI interface reset */ + acc100_reg_write(d, HWPfChaDdrSifRstCfg, 3); + } + rte_bbdev_log_debug("PF Tip configuration complete for %s", dev_name); return 0; } diff --git a/drivers/baseband/acc100/rte_acc100_pmd.h b/drivers/baseband/ac= c100/rte_acc100_pmd.h index cbcece2..071b37c 100644 --- a/drivers/baseband/acc100/rte_acc100_pmd.h +++ b/drivers/baseband/acc100/rte_acc100_pmd.h @@ -31,11 +31,6 @@ #define RTE_ACC100_PF_DEVICE_ID (0x0d5c) #define RTE_ACC100_VF_DEVICE_ID (0x0d5d) =20 -/* Define as 1 to use only a single FEC engine */ -#ifndef RTE_ACC100_SING= LE_FEC -#define RTE_ACC100_SINGLE_FEC 0 -#endif - /* Values used in filling in descriptors */ #define ACC100_DMA_DESC_TYPE 2 #define ACC100_DMA_CODE_BLK_MODE 0 @@ -153,6 +148,12 @@ #define ACC100_CFG_QMGR_HI_P 0x0F0F #define ACC100_CFG_PCI_AXI 0xC003 #define ACC100_CFG_PCI_BRIDGE 0x40006033 +#define ACC100_QUAD_NUMS 4 +#define ACC100_LANES_PER_QUAD 4 +#define ACC100_PCIE_LANE_OFFSET 0x200 +#define ACC100_PCIE_QUAD_OFFSET 0x2000 +#define ACC100_PCS_EQ 0x6007 +#define ACC100_ADAPT 0x8400 #define ACC100_ENGINE_OFFSET 0x1000 #define ACC100_RESET_HI 0x20100 #define ACC100_RESET_LO 0x20000 @@ -160,6 +161,15 @@ #define ACC100_ENGINES_MAX 9 #define ACC100_LONG_WAIT 1000 #define ACC100_GPEX_AXIMAP_NUM 17 +#define ACC100_CLOCK_GATING_EN 0x30000 +#define ACC100_FABRIC_MODE 0xB +/* DDR Size per VF - 512MB by default + * Can be increased up to 4 GB with single PF/VF */ +#define ACC100_HARQ_DDR (512 * 1) +#define ACC100_PRQ_DDR_VER 0x10092020 +#define ACC100_MS_IN_US (1000) +#define ACC100_DDR_TRAINING_MAX (5000) =20 /* ACC100 DMA Descriptor triplet */ struct acc100_dma_triplet { -- 1.8.3.1