From patchwork Wed Mar 2 19:29:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 63415 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2560425lbc; Wed, 2 Mar 2016 11:34:59 -0800 (PST) X-Received: by 10.140.16.225 with SMTP id 88mr35998255qgb.96.1456947299091; Wed, 02 Mar 2016 11:34:59 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p40si37484473qge.42.2016.03.02.11.34.58; Wed, 02 Mar 2016 11:34:59 -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 Received: by lists.linaro.org (Postfix, from userid 109) id A3FEF650EF; Wed, 2 Mar 2016 19:34:58 +0000 (UTC) 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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 12E5B650FD; Wed, 2 Mar 2016 19:31:24 +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 C85A265104; Wed, 2 Mar 2016 19:31:21 +0000 (UTC) Received: from mail-qg0-f49.google.com (mail-qg0-f49.google.com [209.85.192.49]) by lists.linaro.org (Postfix) with ESMTPS id D09AA650A8 for ; Wed, 2 Mar 2016 19:30:21 +0000 (UTC) Received: by mail-qg0-f49.google.com with SMTP id t4so21112690qge.0 for ; Wed, 02 Mar 2016 11:30:21 -0800 (PST) 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=ul/1wMOHWMmJlM0nDE3QUObztcosxLbSOU0rdM46Sao=; b=SZzCYPyqb/YOZHOevNPjtXlKSkgJf9SG1FWGvYuOMPs//TfELH/F3hloI0uD9Ab1A9 jj77H4hhVEOtcp2W6vd2fS/+J9ioW+tK1jzR1M6rvorKM6y7NWB4FkQG1m7r8ZDcCskz yeOhjikpTGzGvwfc74Je9c18t+kETqaGpaREBTqsPpk/TRtQzFuT8fOz793uWfJ2gH5/ it7r+UvT2ZChmKTkFrdRFuB5Oud2473nrSifOOUhOOs4fubdE85/el5r5R/5ULk3G/Q6 3pihedyZu2cNZkogJFNf3AP/BPMjuuAdZreuBE6Ht8PZhNBVpfpv2PvG/PJFSwqPHGAi VaMg== X-Gm-Message-State: AD7BkJLD80bHWupt6phuiyBOeujdNb0HVOlztCrFX0Zk4OD3OuCLXvEjd1J7DMA8OKywyBqG57U= X-Received: by 10.140.19.132 with SMTP id 4mr35643440qgh.56.1456947021579; Wed, 02 Mar 2016 11:30:21 -0800 (PST) Received: from localhost.localdomain (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by smtp.gmail.com with ESMTPSA id a129sm15527538qkb.45.2016.03.02.11.30.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Mar 2016 11:30:21 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Wed, 2 Mar 2016 14:29:52 -0500 Message-Id: <1456946992-19251-9-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456946992-19251-1-git-send-email-mike.holmes@linaro.org> References: <1456946992-19251-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v5 8/8] 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 Reviewed-and-tested-by: Bill Fischofer --- .../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");