From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0083.outbound.protection.outlook.com [104.47.33.83]) by dpdk.org (Postfix) with ESMTP id 756961B1A7 for ; Tue, 9 Jan 2018 14:24:22 +0100 (CET) Received: from MWHPR03CA0027.namprd03.prod.outlook.com (10.174.173.144) by BN6PR03MB2692.namprd03.prod.outlook.com (10.173.144.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Tue, 9 Jan 2018 13:24:21 +0000 Received: from BY2FFO11FD012.protection.gbl (2a01:111:f400:7c0c::199) by MWHPR03CA0027.outlook.office365.com (2603:10b6:301:3b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:20 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD012.mail.protection.outlook.com (10.1.14.130) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:23:50 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAVl017638; Tue, 9 Jan 2018 06:24:18 -0700 From: Hemant Agrawal To: CC: , Date: Tue, 9 Jan 2018 18:52:51 +0530 Message-ID: <1515504186-13587-4-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778302030447; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(39860400002)(396003)(39380400002)(346002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(50226002)(316002)(48376002)(54906003)(81156014)(8656006)(4326008)(8936002)(105606002)(16586007)(106466001)(81166006)(8676002)(51416003)(76176011)(59450400001)(104016004)(15650500001)(498600001)(86362001)(296002)(2351001)(50466002)(53936002)(5660300001)(97736004)(47776003)(77096006)(6916009)(2950100002)(68736007)(356003)(2906002)(305945005)(6666003)(36756003)(85426001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2692; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD012; 1:XxJMeLDZ3tHobwJ+sQyb92tSxyOzEnR78Ra9qyYEy1b8yYXS6d13gEvm+7gfzgkz/KY/7Kd8n+FUkyWUHzrkA02nHHtSq5/QKp6fGCz+Jrpy5/l6BfDwxDuoQ2Aoplk+ MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4e37558a-fce9-442d-726f-08d5576438ad X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN6PR03MB2692; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2692; 3:erEuXHlcy2Ng6exZFKauZ0q/V6f/Z61f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TOSZl1u6NMylfixNfKzeNsmr7QQB50gsougWOycBYa7b+0WtUb/XRkt1gsgXKYIZIdtLAQjxQYSvf61J1mqrjvbSWiVR5D95FOoRGt5VbbK/UWCpT9SN67ljj890mJY8QeAWnuXX07rDkPvaKgSjcvWQYFMWwrk5dvNaI21sEIcKQgT1niakkbGoIsA674rpFfo7aGJtkZKuvfO6ccLNYxjUNIs6NSntTbsAFhT1jd9f+ZCWr+GAtKygP6wrFukLYb8o9aYY1P2F1NtHwfwrTwBM1JLFYOf9E0= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(6055026)(6096035)(20161123556025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123563025)(20161123565025)(20161123561025)(20161123559100)(201708071742011); SRVR:BN6PR03MB2692; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN6PR03MB2692; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2692; 23:S5afuGJLTblokFzM7OsmVPqMWQA6mzXUQskatschz?= =?us-ascii?Q?BU/V7EsaXlNDvUXrgzxlmAoRIulIuYa3BXsq6R+sncBMkpWtgyyxx/G7Rm5i?= =?us-ascii?Q?BS+BwuTSrd8LlzSWz3oOHxXFDh4qo5kN8ewA0emFJm6Rg5oZHvOo7CMJffOy?= =?us-ascii?Q?Trm3DgDtPmftS5ihROaXSF6W4FxKwLgMT0K35acLEOpZWS1A8dF5ndSdobrI?= =?us-ascii?Q?FQTmo4O0nSCScFDgFoGBDsrdyFsGlAFv/jJEK7Af08H5hSFHvCKv2sono9Gu?= =?us-ascii?Q?Zzkn1YwIwbgoV6poG69pU5QBHvNW+OVE1o2Dw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KPttYPeNFZZVtab8yhmM3EskFLdraUslVRP6R5DBqzE6U8xebMDSvEn/+phvfgnHfVCOb16tdBObhiJRnsZgQre3JbfWNzou/s8ZgT0rfmzUGevr0sF106gHPkHQmDPN+AZlyVzfi7Hcp0RUiLqWtO+ieqdVX5IyRPt9eWwjZ12nEADcb/1SwR6HZ6EKl/ENyYMuHMPvkFhevuyCkdvE+BlSB6ThtPYMyT6ab4MgHgBeZdZMfxaC4zOmYi5IVjmiQjWCFsH6L0hJPJS8ih0e4LVw/ESlSbMdSyGvEE6JmmsxuhtyiObC028bdhgx2ABk2+mYmJ1fdn2dHE/7Aj3ei50z22ExJBBviemaEckn9Ss=; 5:3YN43W7tKP0bwcUmcoFJEkyU7CpA9cMg72w3wXDjjQV7UyfdjOFS4ybHJrgrJY8ibjLCqxOaLJ7Ap2MMSvOE2HGepqyTbjKVE1TnNHB3PoX9zhn4LFJikFZ5TEL5BR3VJ04TiA0ZW7PrE3FJ6p7mWTn7TSdfD9llz64rcIphXbM=; 24:hn+ALZRk6MWMh/5xGt/mEZmvUk/WTUa5TyXZSFGo0O+/wqlEr3MeZQEBDDTRRQMNUgXoA1a/8BVAYURVE+HgAH6KX1S9DQfAlHQVC57dHRQ=; 7:je82IvwBkB5DXV27eqBkQCqk/lyHdhgq3PXxmgqODbTzl2ttZEwVpPvcukIRYCqr4QLob04zez4eW7OFvGAYU4lFPaQ1ZEygD0qdK81p3eZcTDsuDQ+ukYZjTwGMp3nS7fn6xSAy8VjZiPqgLPlwVl2RYOBdabk4IB3eAkpLgE1hDGhMJeftNPDgrcpiBS5wI040MpS5xlBWcD1ah/CItiQI14vM9jmIAzVzFMy8BqbAmJbiD/JvNfB4NAkhp88s SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:23:50.0158 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e37558a-fce9-442d-726f-08d5576438ad X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2692 Subject: [dpdk-dev] [PATCH v2 03/18] bus/dpaa: update platform soc value register routines 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: Tue, 09 Jan 2018 13:24:22 -0000 This patch update the logic and expose the soc value register, so that it can be used by other modules as well. Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/dpaa_bus.c | 12 ++++++++++++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 8 ++++++++ drivers/bus/dpaa/rte_dpaa_bus.h | 11 +++++++++++ drivers/net/dpaa/dpaa_ethdev.c | 4 +++- drivers/net/dpaa/dpaa_ethdev.h | 5 ----- 5 files changed, 34 insertions(+), 6 deletions(-) diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 79f4858..a7c05b3 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -51,6 +51,8 @@ struct netcfg_info *dpaa_netcfg; /* define a variable to hold the portal_key, once created.*/ pthread_key_t dpaa_portal_key; +unsigned int dpaa_svr_family; + RTE_DEFINE_PER_LCORE(bool, _dpaa_io); static inline void @@ -417,6 +419,8 @@ rte_dpaa_bus_probe(void) int ret = -1; struct rte_dpaa_device *dev; struct rte_dpaa_driver *drv; + FILE *svr_file = NULL; + unsigned int svr_ver; BUS_INIT_FUNC_TRACE(); @@ -436,6 +440,14 @@ rte_dpaa_bus_probe(void) break; } } + + svr_file = fopen(DPAA_SOC_ID_FILE, "r"); + if (svr_file) { + if (fscanf(svr_file, "svr:%x", &svr_ver) > 0) + dpaa_svr_family = svr_ver & SVR_MASK; + fclose(svr_file); + } + return 0; } diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index fb9d532..eeeb458 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -64,3 +64,11 @@ DPDK_17.11 { local: *; }; + +DPDK_18.02 { + global: + + dpaa_svr_family; + + local: *; +} DPDK_17.11; diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h index 5758274..d9e8c84 100644 --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/rte_dpaa_bus.h @@ -20,6 +20,17 @@ #define DEV_TO_DPAA_DEVICE(ptr) \ container_of(ptr, struct rte_dpaa_device, device) +/* DPAA SoC identifier; If this is not available, it can be concluded + * that board is non-DPAA. Single slot is currently supported. + */ +#define DPAA_SOC_ID_FILE "/sys/devices/soc0/soc_id" + +#define SVR_LS1043A_FAMILY 0x87920000 +#define SVR_LS1046A_FAMILY 0x87070000 +#define SVR_MASK 0xffff0000 + +extern unsigned int dpaa_svr_family; + struct rte_dpaa_device; struct rte_dpaa_driver; diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index db6574f..24943ef 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -186,7 +186,9 @@ dpaa_fw_version_get(struct rte_eth_dev *dev __rte_unused, DPAA_PMD_ERR("Unable to open SoC device"); return -ENOTSUP; /* Not supported on this infra */ } - if (fscanf(svr_file, "svr:%x", &svr_ver) <= 0) + if (fscanf(svr_file, "svr:%x", &svr_ver) > 0) + dpaa_svr_family = svr_ver & SVR_MASK; + else DPAA_PMD_ERR("Unable to read SoC device"); fclose(svr_file); diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 254fca2..9c3b42c 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -17,11 +17,6 @@ #include #include -/* DPAA SoC identifier; If this is not available, it can be concluded - * that board is non-DPAA. Single slot is currently supported. - */ -#define DPAA_SOC_ID_FILE "/sys/devices/soc0/soc_id" - #define DPAA_MBUF_HW_ANNOTATION 64 #define DPAA_FD_PTA_SIZE 64 -- 2.7.4