From patchwork Tue Nov 19 11:11:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1197379 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47HNSH1qD2z9sPn; Tue, 19 Nov 2019 22:11:43 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iX1Q3-000652-8m; Tue, 19 Nov 2019 11:11:39 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iX1Pz-00064l-WC for kernel-team@lists.ubuntu.com; Tue, 19 Nov 2019 11:11:35 +0000 Received: from mail-wm1-f69.google.com ([209.85.128.69]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iX1Pz-0004Ua-RI for kernel-team@lists.ubuntu.com; Tue, 19 Nov 2019 11:11:35 +0000 Received: by mail-wm1-f69.google.com with SMTP id g14so2217874wmk.9 for ; Tue, 19 Nov 2019 03:11:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=vxPDmy5pOOW4u6wnSmW0oRqRDJMNySMgZr4AWOoi4iE=; b=AX9gct9IIRKIyF2fq8lVhtCdMHzaVbS5Dvh9tYO7H1rdfmr+9uX//LcMzaM+gXy+hU uxri1jvdIneIYhEDrpInOkfX/nYTtESrQVTDEc8cp9CQTK7mZWGVdl1OWI31jDYoC+7K E4nApcUuF92zalPrS7XZECLZ6QryxkWArugHSih9yoJDznz+ttJ1WinwS8wU6o19V8Bf uLdckf94tSrfP87wqtY6WSxdloDaW6yyzvywqI9y19eeHKNG8PfV1FBGuebKspgzM/oc EzCEbOqDg+iuFkllZjGL2gs4vEV5IOmXpOsiL1ogeq3OkyXY34PV3qYrrAixY33ErPT8 Z0xg== X-Gm-Message-State: APjAAAV722eEmCXeZlYWqkB/b8E1L/h9VpEDPcoONUPCNsaB1Va8XOFh 7Kvt+NW6EOkCkEvJK4XArdozbCi0tUewI5YXJ1efKmWq3gU7rTyLsZgxf7p4QqklCfef3usSttj NHe5SwpRfJAmNUBHNyNNW6N+uVBlGqoXyHTqU+iYLCQ== X-Received: by 2002:adf:ab41:: with SMTP id r1mr38762858wrc.281.1574161895336; Tue, 19 Nov 2019 03:11:35 -0800 (PST) X-Google-Smtp-Source: APXvYqyZSZ8ztW+0s4zumH2V7hVit3SRZWl4jLhZONGMSFK0FeH/RZ8svLwFEKMouDxrNWcp2xYzfA== X-Received: by 2002:adf:ab41:: with SMTP id r1mr38762831wrc.281.1574161895098; Tue, 19 Nov 2019 03:11:35 -0800 (PST) Received: from gollum.fritz.box ([194.191.228.147]) by smtp.gmail.com with ESMTPSA id m15sm13630177wrj.52.2019.11.19.03.11.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2019 03:11:34 -0800 (PST) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [SRU][Bionic/raspi2][PATCH] arch/arm64: Add Revision, Serial, Model to cpuinfo Date: Tue, 19 Nov 2019 12:11:33 +0100 Message-Id: <20191119111133.10601-1-juergh@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Phil Elwell BugLink: https://bugs.launchpad.net/bugs/1823151 Signed-off-by: Phil Elwell (cherry picked from commit 935eb6f9a31971ef5537ac5d1b62148f8bcbad2f rpi-4.19.y) Signed-off-by: Juerg Haefliger Acked-by: Paolo Pisati Acked-By: You-Sheng Yang --- arch/arm64/kernel/cpuinfo.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index 1e2554543506..fe810a2e4738 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -120,6 +121,10 @@ static int c_show(struct seq_file *m, void *v) { int i, j; bool compat = personality(current->personality) == PER_LINUX32; + struct device_node *np; + const char *model; + const char *serial; + u32 revision; for_each_online_cpu(i) { struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i); @@ -171,6 +176,26 @@ static int c_show(struct seq_file *m, void *v) seq_printf(m, "CPU revision\t: %d\n\n", MIDR_REVISION(midr)); } + seq_printf(m, "Hardware\t: BCM2835\n"); + + np = of_find_node_by_path("/system"); + if (np) { + if (!of_property_read_u32(np, "linux,revision", &revision)) + seq_printf(m, "Revision\t: %04x\n", revision); + of_node_put(np); + } + + np = of_find_node_by_path("/"); + if (np) { + if (!of_property_read_string(np, "serial-number", + &serial)) + seq_printf(m, "Serial\t\t: %s\n", serial); + if (!of_property_read_string(np, "model", + &model)) + seq_printf(m, "Model\t\t: %s\n", model); + of_node_put(np); + } + return 0; }