From patchwork Thu Feb 18 13:46:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 62176 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp595987lbl; Thu, 18 Feb 2016 05:48:18 -0800 (PST) X-Received: by 10.67.12.175 with SMTP id er15mr10091010pad.70.1455803297992; Thu, 18 Feb 2016 05:48:17 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id f2si9585711pas.32.2016.02.18.05.48.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Feb 2016 05:48:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aWOvV-00050k-7l; Thu, 18 Feb 2016 13:47:25 +0000 Received: from mail-lf0-x233.google.com ([2a00:1450:4010:c07::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aWOvD-0004hI-8i for linux-arm-kernel@lists.infradead.org; Thu, 18 Feb 2016 13:47:08 +0000 Received: by mail-lf0-x233.google.com with SMTP id 78so32634492lfy.3 for ; Thu, 18 Feb 2016 05:46:45 -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; bh=NY8Gc6v2nhyGXScYcsYN7OgXo6oWkYtzxgaf+QbN81I=; b=Zd0e7OxVqDFlo6TFmlsvBfkstD6EbOY5/VOjwD5EusdeBc0dUV/GmSUfJvY3sBgyyZ 0oL1GK/MpbqcQu2L/z/U3ibSnRwk13HduAIxTkOyYTQ6DilyyyfdQCJLY4PrCgo59MXy DKerqaFUP/+oxoOQ3Lz0a70vRGKilFZ989/hI= 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; bh=NY8Gc6v2nhyGXScYcsYN7OgXo6oWkYtzxgaf+QbN81I=; b=K8aHRezeoj8VjYZAmZCK3sGBSEYeqZKArY6Z1TWoJkiNlhGNktXzmQ2WzlW3vETTQz p42FWp+bJSFwS7WoAzShQeQNHs6I3rwDP2gmAM2US4gLXANLl7SM6aHQp65ion4wJWNl Iaf0ognnTIv+d7oJ2oVkd0zXcIKw3uT2EczoTuNKqvJXKI9vh23rNZulX/vSBK2zIuQW ktWcNlxWigH6N8TYVq0LTKg1HMdIaJPxUsEJCmuV/jgAwGYgSOqK+eJxyl8tWJUV51Ba 6bF3DySZhptCbLhBdc3UfPyGz9Zu5N9egFvnnro0prASu4dugHCpSgufh6JGy3K6M8k7 o71Q== X-Gm-Message-State: AG10YOT+cINS3Z+s66Hv0UWc9A/1OKfeTdW8tyUqayWbRRr0cXiB8SjQBPquiuBmE9M7P4VD X-Received: by 10.25.156.196 with SMTP id f187mr3225389lfe.150.1455803204100; Thu, 18 Feb 2016 05:46:44 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id aa9sm951028lbc.16.2016.02.18.05.46.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Feb 2016 05:46:43 -0800 (PST) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, Arnd Bergmann Subject: [PATCH 2/3] soc: versatile: dynamically detect RealView HBI numbers Date: Thu, 18 Feb 2016 14:46:40 +0100 Message-Id: <1455803200-22797-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160218_054707_726236_0CF8EAE7 X-CRM114-Status: GOOD ( 15.23 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c07:0:0:0:233 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Russell King , Pawel Moll , Marc Zyngier , Linus Walleij , Will Deacon MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org We cannot pile all numbers on this list, just print the three hex digits representing the board ID so we can handle all the new RealView boards. Cc: Arnd Bergmann Signed-off-by: Linus Walleij --- drivers/soc/versatile/soc-realview.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) -- 2.4.3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/soc/versatile/soc-realview.c b/drivers/soc/versatile/soc-realview.c index c337764de867..282e371378ce 100644 --- a/drivers/soc/versatile/soc-realview.c +++ b/drivers/soc/versatile/soc-realview.c @@ -31,18 +31,6 @@ static const struct of_device_id realview_soc_of_match[] = { static u32 realview_coreid; -static const char *realview_board_str(u32 id) -{ - switch ((id >> 16) & 0xfff) { - case 0x0147: - return "HBI-0147"; - case 0x0159: - return "HBI-0159"; - default: - return "Unknown"; - } -} - static const char *realview_arch_str(u32 id) { switch ((id >> 8) & 0xf) { @@ -69,7 +57,7 @@ static ssize_t realview_get_board(struct device *dev, struct device_attribute *attr, char *buf) { - return sprintf(buf, "%s\n", realview_board_str(realview_coreid)); + return sprintf(buf, "HBI-%03x\n", ((realview_coreid >> 16) & 0xfff)); } static struct device_attribute realview_board_attr = @@ -133,8 +121,9 @@ static int realview_soc_probe(struct platform_device *pdev) device_create_file(soc_device_to_device(soc_dev), &realview_arch_attr); device_create_file(soc_device_to_device(soc_dev), &realview_build_attr); - dev_info(&pdev->dev, "RealView Syscon Core ID: 0x%08x\n", - realview_coreid); + dev_info(&pdev->dev, "RealView Syscon Core ID: 0x%08x, HBI-%03x\n", + realview_coreid, + ((realview_coreid >> 16) & 0xfff)); /* FIXME: add attributes for SoC to sysfs */ return 0; }