From patchwork Fri Jan 29 11:30:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 60791 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1058059lbb; Fri, 29 Jan 2016 03:40:29 -0800 (PST) X-Received: by 10.140.99.53 with SMTP id p50mr9707214qge.97.1454067629123; Fri, 29 Jan 2016 03:40:29 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e30si14798107qkh.24.2016.01.29.03.40.28; Fri, 29 Jan 2016 03:40:29 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 711EA61727; Fri, 29 Jan 2016 11:40:28 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=KR83XMlc; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,T_DKIM_INVALID,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 84F5561D64; Fri, 29 Jan 2016 11:39:07 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 51CE261777; Fri, 29 Jan 2016 11:39:01 +0000 (UTC) Received: from mail-pf0-f177.google.com (mail-pf0-f177.google.com [209.85.192.177]) by lists.linaro.org (Postfix) with ESMTPS id 76B82617D6 for ; Fri, 29 Jan 2016 11:38:36 +0000 (UTC) Received: by mail-pf0-f177.google.com with SMTP id n128so40752527pfn.3 for ; Fri, 29 Jan 2016 03:38:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pLrtJZCCtUeUurQSvJnizRzaCbtKBxZpW1jm+V4x+Fg=; b=KR83XMlcTebYBZyABMN3XcpzSunUOoLDiVR2rgdj82wl3xguT/oP626ctfdMTdhU+a Lyw8XBVR694TjiwNoib8tg9EVksUL33PK8PMM2tDdkE9yCg2w+cQBWcsiLAglFvGWCmM hF38JlQ5SYfusHgSyJiQCzJw76l90rgF9UBRI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pLrtJZCCtUeUurQSvJnizRzaCbtKBxZpW1jm+V4x+Fg=; b=j+klMNXlm+jR3OIcfcln0wWVj0/LF1zLIWbggfbtUVy/vKY/UD1ITvX7IARxMK23Tc oHWhWd5gYeB5k1bv1Dkxbe7DTLx1Ayxuz3qmcZaBG2L9zrQCV09FjlbJj0LPpwG2pSPR egY+SiacfIXrTecr+D4wZbDO10JgGtjmJLGZUR8y4QTlOmxsZhKK0l9imi/EPgTKYsia MQvOMzP+E2Sps3q0iRUMLnpSgbguBgZEi4cFbGoxbgnG2xc2JBHZfgm6cgxkssfO0Kpt Ms/0vMWvDgILmnx64EMlhXKyPWwZhB62JWkrXRfBcUbE8BYVsMiTv1uQoBUC6DXuQmJN oxZg== X-Gm-Message-State: AG10YOSG3qxtUVM5CB6F310rfeEfO3GBozYkVrF4UXqZgP/LqCO1lumSSw8eTneWw6YlobQixZI= X-Received: by 10.98.75.143 with SMTP id d15mr12687792pfj.96.1454067515838; Fri, 29 Jan 2016 03:38:35 -0800 (PST) Received: from ubuntu1504.ap.freescale.net (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id f21sm23063753pfd.6.2016.01.29.03.38.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Jan 2016 03:38:35 -0800 (PST) From: hongbo.zhang@linaro.org To: lng-odp@lists.linaro.org Date: Fri, 29 Jan 2016 19:30:47 +0800 Message-Id: <1454067047-381-5-git-send-email-hongbo.zhang@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1454067047-381-1-git-send-email-hongbo.zhang@linaro.org> References: <1454067047-381-1-git-send-email-hongbo.zhang@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH API-NEXT 4/4] linux-generic: sysinfo clean up for ARM X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Hongbo Zhang The arch/arm/odp_sysinfo_parse.c is currently a symlink to arch/linux/odp_sysinfo_parse.c, but in fact there should be defferences between them. A separated real arch/arm/odp_sysinfo_parse.c is created for ARM, and the model_str is set to a general "ARM", which is much better then the general defaul "UNKNOWN" although not so accurate in detailed ARM CPU model string. ODP_DBG("TODO: true values should be implemented when possible\n") is added for ARM too, this means when possible true values can be implemented for ARM, and only ARM odp_cpuinfo_parser() is updated, while the general defaul odp_cpuinfo_parser() should be leave there unchanged. In other words the current implementation for ARM is a temporary work around, but for the generic default dummy data has to be accepted. ODP_DBG("Refer to https://bugs.linaro.org/show_bug.cgi?id=1870\n") is deleted, because this bug describes another thing, eg in previous code, only cpu_hz_max[0] and model_str[0] were set, the others such as cpu_hz_max[1...n-1] and model_str[1...n-1] were missing, it isn't related with the value itself is dummy or not, and this bug was already fixed. Signed-off-by: Hongbo Zhang --- .../linux-generic/arch/arm/odp_sysinfo_parse.c | 29 +++++++++++++++++++++- .../linux-generic/arch/linux/odp_sysinfo_parse.c | 1 - 2 files changed, 28 insertions(+), 2 deletions(-) mode change 120000 => 100644 platform/linux-generic/arch/arm/odp_sysinfo_parse.c diff --git a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c deleted file mode 120000 index 2f368af..0000000 --- a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c +++ /dev/null @@ -1 +0,0 @@ -../linux/odp_sysinfo_parse.c \ No newline at end of file diff --git a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c new file mode 100644 index 0000000..b141168 --- /dev/null +++ b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c @@ -0,0 +1,28 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include +#include + +int odp_cpuinfo_parser(FILE *file ODP_UNUSED, odp_system_info_t *sysinfo) +{ + int i; + + ODP_DBG("Warning: use dummy values for freq and model string\n"); + ODP_DBG("TODO: true values should be implemented when possible\n"); + for (i = 0; i < MAX_CPU_NUMBER; i++) { + sysinfo->cpu_hz_max[i] = 1400000000; + strcpy(sysinfo->model_str[i], "ARM"); + } + + return 0; +} + +uint64_t odp_cpu_hz_current(int id ODP_UNUSED) +{ + return 0; +} diff --git a/platform/linux-generic/arch/linux/odp_sysinfo_parse.c b/platform/linux-generic/arch/linux/odp_sysinfo_parse.c index 4a22a61..4dcd6d1 100644 --- a/platform/linux-generic/arch/linux/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/linux/odp_sysinfo_parse.c @@ -13,7 +13,6 @@ int odp_cpuinfo_parser(FILE *file ODP_UNUSED, odp_system_info_t *sysinfo) int i; ODP_DBG("Warning: use dummy values for freq and model string\n"); - ODP_DBG("Refer to https://bugs.linaro.org/show_bug.cgi?id=1870\n"); for (i = 0; i < MAX_CPU_NUMBER; i++) { sysinfo->cpu_hz_max[i] = 1400000000; strcpy(sysinfo->model_str[i], "UNKNOWN");