From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9870C433ED for ; Fri, 14 May 2021 19:27:02 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 98F8F61454 for ; Fri, 14 May 2021 19:27:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98F8F61454 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bp.renesas.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uMMGIhc8P59GAljFYf7qqj0f71X3l9ZJIa1Um+MQSKY=; b=FeieNxht9yVJQcljKwsRknegme 58nAyKYmkAiDQ95hi86xYHAqHi9otrolZADWSRNr5IDsxL1eakrW3+u+9fCNMUOxK+WJO0q9a8Cqu eUoP9LBSjuPrP5dA3vZO4wax94BMtYjqtZ+e8PglVNjDmfcuweNf4kIimW+oyaRZFwRUDolFWYxgq EuMuWLzImwL6g/V9Ue6AkCbwcZ0QGTcfamIAOdPYFIyGeBJEOE3C6FvhLHgL9+KBqGIPQRPzMXT/m dQRMwvoR3C7Wk4S0kVRr1sKwic3LhriyvGLtUOww+RkoOxwClcBJv5g88kGzRvpTAcPeWAZkaeVXT X5/+aw7Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhdQn-008nZw-SW; Fri, 14 May 2021 19:25:06 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhdPO-008n7T-SL for linux-arm-kernel@desiato.infradead.org; Fri, 14 May 2021 19:23:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=7rHb/FyiIqIAlm3NN5ckt01VJY9u741CERRsdTugVT8=; b=pF12FnLf1l4xDLS53rM7ewh16s hSLiztspHT9sklHZMvsvCuZ5wz9Wod6TuoNHk66iXU/sltLWQK3jrj55i8qQ+c+Wj8BtBJWn189qX llBiE3gF1AsJ4JIW8Vtz2TdyF+7671xGfNbU0xOKpL2t3LK7hKB/bsmpg6bj6sFXPrBYT+Jx/1piU sHv8TX8L7R4WuCAUayKr+pcL3+upBTd3P6InsxMDLNrO03POdhgBqgAHhPJTb44NnCrD/vq8viTIy UgDtuNDLhS/IVLK5qumnLv817xYQOu+c6kVYjXHXJiUOHNocSUJA2rfvi3mlA1IxAtzEy2MQq8/Nj skexmQRw==; Received: from relmlor2.renesas.com ([210.160.252.172] helo=relmlie6.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhdPM-00CCdG-DN for linux-arm-kernel@lists.infradead.org; Fri, 14 May 2021 19:23:37 +0000 X-IronPort-AV: E=Sophos;i="5.82,300,1613401200"; d="scan'208";a="81147966" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 15 May 2021 04:23:36 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 611F44010906; Sat, 15 May 2021 04:23:32 +0900 (JST) From: Lad Prabhakar To: Geert Uytterhoeven , Rob Herring , Magnus Damm , Michael Turquette , Stephen Boyd , Greg Kroah-Hartman , Catalin Marinas , Will Deacon , Jiri Slaby , Philipp Zabel , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Biju Das , Lad Prabhakar , Prabhakar Subject: [PATCH 07/16] soc: renesas: Add support to read LSI DEVID register Date: Fri, 14 May 2021 20:22:09 +0100 Message-Id: <20210514192218.13022-8-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210514192218.13022-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20210514192218.13022-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210514_122336_576238_1EE1B779 X-CRM114-Status: GOOD ( 12.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for reading the LSI DEVID register which is present on RZ/G2{L,LC,UL} SoC's. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das --- drivers/soc/renesas/renesas-soc.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/soc/renesas/renesas-soc.c b/drivers/soc/renesas/renesas-soc.c index 0f8eff4a641a..d73389670eef 100644 --- a/drivers/soc/renesas/renesas-soc.c +++ b/drivers/soc/renesas/renesas-soc.c @@ -64,7 +64,7 @@ static const struct renesas_family fam_shmobile __initconst __maybe_unused = { struct renesas_soc { const struct renesas_family *family; - u8 id; + u32 id; }; static const struct renesas_soc soc_rz_a1h __initconst __maybe_unused = { @@ -348,6 +348,25 @@ static int __init renesas_soc_init(void) goto done; } + np = of_find_compatible_node(NULL, NULL, "renesas,devid"); + if (np) { + chipid = of_iomap(np, 0); + of_node_put(np); + + if (chipid) { + product = readl(chipid); + iounmap(chipid); + + if (soc->id && (product & 0xfffffff) != soc->id) { + pr_warn("SoC mismatch (product = 0x%x)\n", + product); + return -ENODEV; + } + } + + goto done; + } + /* Try PRR first, then hardcoded fallback */ np = of_find_compatible_node(NULL, NULL, "renesas,prr"); if (np) { -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel