From patchwork Tue Feb 23 08:12:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 62679 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1703942lbl; Tue, 23 Feb 2016 00:18:46 -0800 (PST) X-Received: by 10.140.93.65 with SMTP id c59mr39512295qge.101.1456215526678; Tue, 23 Feb 2016 00:18:46 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 7si32883245qhs.63.2016.02.23.00.18.46; Tue, 23 Feb 2016 00:18:46 -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 47FFE617F8; Tue, 23 Feb 2016 08:18:46 +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_H3, RCVD_IN_MSPIKE_WL, 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 A153562EE1; Tue, 23 Feb 2016 08:15:19 +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 8537262F01; Tue, 23 Feb 2016 08:15:16 +0000 (UTC) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by lists.linaro.org (Postfix) with ESMTPS id 26F2F62EE1 for ; Tue, 23 Feb 2016 08:13:33 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id yy13so106312069pab.3 for ; Tue, 23 Feb 2016 00:13:33 -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=zQrLMnblo8oa00DYnWiY1wIsRFH/L5/g3O3m8TYFGAw=; b=k7kXchvqXo00EwPM9eIa+tNXhVGWJRMGyI4zjifiQdiE9widBcke93AaiSF1+o+CFB +oCUG6ddmXFcxokXlAI8A1Eztq4hAHTyBN2mNVzfPYTLHXZjEfWHw4f47EiOXnZZkx4M NxQb3uI4vDxUiAI10Q6zkXf/Pt5uR3BVrApM8BlSeVEFUc6eb6+cmck8xG94Xte5C0AM EY36Z8bU8YaTiFsOwHYX1hvbZw+hQLwZPxF5aq39dz/ZgpNvrm7zapv4xsX8nO/i6Mu2 0dvPjDkvCMNKTREMbOC/B4q78/tAqap+WlGckG7si5SVy8ew/vxk0k3dT9G8/P7PzaVS bWIQ== X-Gm-Message-State: AG10YOSbPYhm0LZbMei5QTh5ECAUhj21G140FInZurFQACpWhytDTVGrlxQ0L9PpH6eJ8LUkvjY= X-Received: by 10.66.251.162 with SMTP id zl2mr45048797pac.116.1456215212411; Tue, 23 Feb 2016 00:13:32 -0800 (PST) Received: from ubuntu1504.ap.freescale.net (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id 17sm41920352pfp.96.2016.02.23.00.13.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Feb 2016 00:13:31 -0800 (PST) From: hongbo.zhang@linaro.org To: lng-odp@lists.linaro.org Date: Tue, 23 Feb 2016 16:12:53 +0800 Message-Id: <1456215173-4456-9-git-send-email-hongbo.zhang@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456215173-4456-1-git-send-email-hongbo.zhang@linaro.org> References: <1456215173-4456-1-git-send-email-hongbo.zhang@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v4 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");