From patchwork Thu May 6 09:07:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 12241883 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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 D8A45C433B4 for ; Thu, 6 May 2021 09:11:47 +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 429B86100A for ; Thu, 6 May 2021 09:11:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 429B86100A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=UEx9QsgRFKQg2fI1hRFokzCL7xti7eLiH5MEcErUyJE=; b=Cl3pTzpbeG767TFqqTi6D35Wz I+WKBOZIy0rTZxmsssmOPc9CZ/QBTwOLYxQvcMgGraBSAh361/O6pFh6274CQ1J7xwVr2l9M0T0YK NgCuSgufhtsv92CuRJs/I/zTXbRsh0oL+lO7uXQ+fG9nLHHc5ZbwjosHxmG+lf6iZHa6/C6BDv8l8 Na8fOwsnmxyVJpPYItcr07UtGSii6w1yy8vo55lngiX6mQqBp1zGwqH8uEBSkzrDYJhULx9PTeI0D GGnUFglL2dFAB/Mmtw7QVf1eIZ+yvQmFsfv5OjMhWVZ3gZNffMLWjOq3PbY84HYG6XZ7hXEBtn9wt JGTD+dW6g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1leZzt-003kpH-L4; Thu, 06 May 2021 09:08:41 +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 1leZzi-003koU-NY for linux-arm-kernel@desiato.infradead.org; Thu, 06 May 2021 09:08:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=ESvRdpTeQZPcmmP68F2OVHIKrRjYZRm9K3JMn8lTZPU=; b=cGmz9+39PH1FxGsTTxxfR+eGKP gxLS0SxsZHxNPX6t89P2fSweAcLsnhX5qSPhTc2WDBrsfs8VJsK15QVcwFAYEPoGyHKhXwAQjoUmy iv/L8tCvHtusBdpRxV/SLFQK66MzaOdvuL1xm8hkJxS7QiusyuuN2kBwKEzh1viYGA7S7vbJ0cMUI MmgWJZWHA0Dpfh/Qbuz7rPQARsl9UNojncT/+Bkz1kGUF2fNURAA5J55JeSS4BUk7j9uRJ+a6OQSP qrVOw3xHHMLE6su6xSRWGpB7h89pGdrh4px2wzKzoE3MhD3cOEBDZlRWBfgiryt4Vn3zFC6Bz1uFG HAFLI1pQ==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leZzg-005tQZ-9g for linux-arm-kernel@lists.infradead.org; Thu, 06 May 2021 09:08:29 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6618360FEE; Thu, 6 May 2021 09:08:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620292107; bh=ORxyAXfPiELuOuNTDJqT+1syYGZTiHj3MDbntawW8/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GGL9D2IBAelQF9B7swdwg/1sg3Mx5qW14puHFL3uwBHHCT2umIdS2bWBPZZU5CYWt mNREd4nWAXphE6uFpiyt430ukAYgyCfFujEEeA8VOXhGslpVvQIlieT3Q17V0wu3nj b9dxwKOwWJTze6xx3vtZOBR3dvPqxRn/mZ3G8FYadYp+wEavaWD7G5nnQQUc0t1KHb 2mpAj9tFODF1G6R/hL3q4bsJoZAvyGlsoKTSR0xfkjgK33EVaNJvZ720lRi0TsoOyL KMa4o+hWU1ChpP1yzX6xNDj8XSp4HltiUxBLOG3arZFFZ3PEy4d8UyZqWC+gf5dZC7 fTngHZhTSZQ5g== Received: by pali.im (Postfix) id DAC3A732; Thu, 6 May 2021 11:08:24 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Gregory CLEMENT , Andrew Lunn Cc: =?utf-8?q?Marek_Beh=C3=BAn?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 mvebu + mvebu/dt64 1/6] firmware: turris-mox-rwtm: fix reply status decoding function Date: Thu, 6 May 2021 11:07:57 +0200 Message-Id: <20210506090802.14268-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308153703.23097-1-kabel@kernel.org> References: <20210308153703.23097-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_020828_392124_EDD9CD50 X-CRM114-Status: GOOD ( 11.76 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Marek Behún The status decoding function mox_get_status() currently contains an incorrect check: if the error status is not MBOX_STS_SUCCESS, it always returns -EIO, so the comparison to MBOX_STS_FAIL is never executed and we don't get the actual error code sent by the firmware. Fix this. Signed-off-by: Marek Behún Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver") Reviewed-by: Andrew Lunn --- drivers/firmware/turris-mox-rwtm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c index 62f0d1a5dd32..f85acdb3130c 100644 --- a/drivers/firmware/turris-mox-rwtm.c +++ b/drivers/firmware/turris-mox-rwtm.c @@ -147,11 +147,14 @@ MOX_ATTR_RO(pubkey, "%s\n", pubkey); static int mox_get_status(enum mbox_cmd cmd, u32 retval) { - if (MBOX_STS_CMD(retval) != cmd || - MBOX_STS_ERROR(retval) != MBOX_STS_SUCCESS) + if (MBOX_STS_CMD(retval) != cmd) return -EIO; else if (MBOX_STS_ERROR(retval) == MBOX_STS_FAIL) return -(int)MBOX_STS_VALUE(retval); + else if (MBOX_STS_ERROR(retval) == MBOX_STS_BADCMD) + return -ENOSYS; + else if (MBOX_STS_ERROR(retval) != MBOX_STS_SUCCESS) + return -EIO; else return MBOX_STS_VALUE(retval); } From patchwork Thu May 6 09:07:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 12241887 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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 659C7C433B4 for ; Thu, 6 May 2021 09:11:57 +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 C79326100A for ; Thu, 6 May 2021 09:11:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C79326100A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=X692JUFgjtG6gdFC3apVjirsrsABb5UuTS0RL+oIxA0=; b=SYRCH0xoqTw9VbYvHcBaa0CZe 2VGBy/pB2AHigGUgHBcgVMM4yEDgsGShNmX+FYGRe62mr7Zoals5+08SQ3i/Wut4VYnbXD3LIVSLz bu2xfrrpgkhGekQxkNNrWSBTv0yheoFgkZ+I/RtphP8XbEi+880F8DbcZ7htK2y8spyht2iMoBxEX oFJ9aPML6gY/rVnvxsLMzQSS9wwwbnztBYFa5KRDLbEAjSNR9pAo4kzmIgf1zMyEfLN7mxYZxDgGe sCJ301NmANgnlKTMbtw001nwmUjmgDetu6FE/8Pkx9fm0yssVlh4i1izdytmVTSOUf3p3XP9o4e3X q83YYAZuA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lea0C-003krj-VZ; Thu, 06 May 2021 09:09:01 +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 1leZzi-003koV-RJ for linux-arm-kernel@desiato.infradead.org; Thu, 06 May 2021 09:08:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=pd9ug0/iBbRhIbfZpZwiccfCmUnYf+oX0lPztqVLGZ4=; b=YF74W7+jqRC85Pzd+cjUhjfaGH ycXrTEua0PazzHG8x0KAlgTdGcvt9pSNAaW1ljkdkChuPabBKxEIpHUTdgWD6DAwKd2Ve+f64qGGk ierZeHd7oNC6mcSwysS2IpefWWxBlVJ+j5DOVGO/9QVFRdAFvWXRPjM0CvXGP5UCryIb6FvvLBhXe fL5ZjpDieygP0LYWxNOcamZRltrzniCO41let98uIxOxPRst9BlOq/JFbrBqpaFDJa5fvzUG+ALUv VJ11gIws249L3bTSM4eJQyV7udTdmJb6U2615ih6FpsESqCbdLoLI0HYvmD81c8Yv8RQSSAZaS7Qa X2t0XgAA==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leZzg-005tQc-Bj for linux-arm-kernel@lists.infradead.org; Thu, 06 May 2021 09:08:29 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id DBD5F611EE; Thu, 6 May 2021 09:08:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620292108; bh=MeLEsLw6D27yIvjQ/kVD7YJHUqg3HKZl6KtwqpCreNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ppFfWfUXBpLxfS3Ih6t60uqrk/ob2Ir4lUbuZFoJzDt9EtUW5oXm5z0PFXMfmRq8k Z+PrrJ5sHZAHtqS+JpZ4hvZbQhhN2Rc7qpkxw+/PYPw1GdaTEVUyrkf+dRRIr+9Yag RQAhz4ZON8p/Djxx1/tQDsSVgNbEDXqHl+rj7aGJ9o7fAhhbeqVSzlnpYdiAXl9Vxb fCKoHMnTsPkm1Jnsf0gqfDj8kSJWoQ5JNL4rxz2X19Pd+Mu2vLmVXofKeKYIq1AqQz xFE2dzXJaEoyp1L7UjOVJIGGnThIFcu/VrTIsiTi7Kx5SayJBpW7T/mrjQjubGb4DT aehTpB1ItdVvg== Received: by pali.im (Postfix) id EFC977DF; Thu, 6 May 2021 11:08:25 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Gregory CLEMENT , Andrew Lunn Cc: =?utf-8?q?Marek_Beh=C3=BAn?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 mvebu + mvebu/dt64 2/6] firmware: turris-mox-rwtm: report failures better Date: Thu, 6 May 2021 11:07:58 +0200 Message-Id: <20210506090802.14268-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210506090802.14268-1-pali@kernel.org> References: <20210308153703.23097-1-kabel@kernel.org> <20210506090802.14268-1-pali@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_020828_452126_96309804 X-CRM114-Status: GOOD ( 13.68 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Marek Behún Report a notice level message if a command is not supported by the rWTM firmware. This should not be an error, merely a notice, because the firmware can be used on non-CZ.NIC boards that do not have manufacturing information burned. Signed-off-by: Marek Behún Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver") --- drivers/firmware/turris-mox-rwtm.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c index f85acdb3130c..d7e3489e4bf2 100644 --- a/drivers/firmware/turris-mox-rwtm.c +++ b/drivers/firmware/turris-mox-rwtm.c @@ -204,11 +204,14 @@ static int mox_get_board_info(struct mox_rwtm *rwtm) return ret; ret = mox_get_status(MBOX_CMD_BOARD_INFO, reply->retval); - if (ret < 0 && ret != -ENODATA) { - return ret; - } else if (ret == -ENODATA) { + if (ret == -ENODATA) { dev_warn(rwtm->dev, "Board does not have manufacturing information burned!\n"); + } else if (ret == -ENOSYS) { + dev_notice(rwtm->dev, + "Firmware does not support the BOARD_INFO command\n"); + } else if (ret < 0) { + return ret; } else { rwtm->serial_number = reply->status[1]; rwtm->serial_number <<= 32; @@ -237,10 +240,13 @@ static int mox_get_board_info(struct mox_rwtm *rwtm) return ret; ret = mox_get_status(MBOX_CMD_ECDSA_PUB_KEY, reply->retval); - if (ret < 0 && ret != -ENODATA) { - return ret; - } else if (ret == -ENODATA) { + if (ret == -ENODATA) { dev_warn(rwtm->dev, "Board has no public key burned!\n"); + } else if (ret == -ENOSYS) { + dev_notice(rwtm->dev, + "Firmware does not support the ECDSA_PUB_KEY command\n"); + } else if (ret < 0) { + return ret; } else { u32 *s = reply->status; From patchwork Thu May 6 09:07:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 12241891 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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 CD727C433ED for ; Thu, 6 May 2021 09:12:12 +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 3946561041 for ; Thu, 6 May 2021 09:12:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3946561041 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=HiUL0s3NFVMgkXKINyLc7BxOgRW7xtuluoVj0Sm2yFY=; b=fiQFmBnM8kI6lL7Rv1/MBLsou 9ABP0JS46DUWSwQsWviFDmgKh+Husrhe47YBIqpifvSFmUyI0X2C94wz0EI8iPZwDoozbJ45IyBJg SomtX9hOZhcvPJkouYjNUiNtysLyLGtGWPCYn6fpALlgydSO4ZVHDdiqZ0HYRmAVgesWYyTDx+12m JOP4pzGnIzhyNr+SqNCOEnGzzjsPizolNhs8bIyk7XZLggMq/gOXH5On3t0lBrI/LfIykpqtTZolH yp7V5AK1nQxeYUq8UUr130r3ZT1azW4ypuixIa++2gPpcg1zPHdhffGf+eP4ij8mh1BSgrbWaKp8C IsLmVB4AQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lea0e-003kwB-Ov; Thu, 06 May 2021 09:09:28 +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 1leZzk-003koZ-5L for linux-arm-kernel@desiato.infradead.org; Thu, 06 May 2021 09:08:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=FLlvs6ovGZfb8w0iuNcZbBcfcNUF7mpFvitEWswOGNY=; b=PCfGhjYGsRY/kfM3lJwsxXNMgG eP7uplcRumLjT4tQuOTh4E39v3fj8yluBDP42Hk6BxjkTwbs3aKOuAMsUr8ifTuY+Kdmx0iugwp7r FAN40/R+uJpNPMnoYcekhyFBkb9Z5CMBvM8L/vlfcVOYNZ1h8tf2HVMWOKPrGQafHdhvc6Zzql7DE LgVTrnnal8+jbUmV0AMczhivovGkH0/AIRThyj0cIbD0QkaxIFl/abgztAriU5Lnw6GAcaj3Vat3W tg+LiQG9t3hPYwZvHa3WB09IuCIoKkSaLTIS6vGmDMewmVNXGRBIxgl/WfjSp7smjH0DnwoL3apx1 uQI/K6Ig==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leZzh-005tRH-JF for linux-arm-kernel@lists.infradead.org; Thu, 06 May 2021 09:08:30 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0A36F613B5; Thu, 6 May 2021 09:08:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620292109; bh=2qAnuZ0glq7AD0WdQxX0rOeTrE+qvGfHUxQ2lCXNL8s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=InnKih16wgbo7uvL8fVAgljGJ7Fuq274vMkcZmlj5XQ2kIIFHn0o4IMz6Zi2Y0vY7 PbbX+4+6Mv5ayp+Rr1zMeopl/R588ZwD9VX0Pm0toZj+21PA72keO0kAhCmZ6T58vK S4CG69a/e8WiwITj6Gc34DN5RtDUMFhHOhO5EtAaVm6bqmhFBok73DKr1iyhX39BYH IT4aT249gdHfyR+ZTO2sXoz1JfV262R9fZ6Ulwii0O7uTCC+QUn+VF10pZujRvqQC+ Tf+/n876A7NyixeAnshMoIDIBqWc3BKHyvUTQz1jN2w+r5aP31Zfnvd8enKSGGTkBz R3LKi4fFoR2Hg== Received: by pali.im (Postfix) id 16F96865; Thu, 6 May 2021 11:08:27 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Gregory CLEMENT , Andrew Lunn Cc: =?utf-8?q?Marek_Beh=C3=BAn?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 mvebu + mvebu/dt64 3/6] firmware: turris-mox-rwtm: fail probing when firmware does not support hwrng Date: Thu, 6 May 2021 11:07:59 +0200 Message-Id: <20210506090802.14268-3-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210506090802.14268-1-pali@kernel.org> References: <20210308153703.23097-1-kabel@kernel.org> <20210506090802.14268-1-pali@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_020829_695475_F276A8D3 X-CRM114-Status: GOOD ( 14.64 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When Marvell's rWTM firmware, which does not support the GET_RANDOM command, is used, kernel prints an error message hwrng: no data available every 10 seconds. Fail probing of this driver if the rWTM firmware does not support the GET_RANDOM command. This makes it possible to put this driver's compatible into generic armada-37xx device tree, to be available for other Armada 3720 devices besides Turris MOX. If they use the rWTM firmware from CZ.NIC, they will have HWRNG available, and if not, the driver won't be complaining. Signed-off-by: Pali Rohár Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver") Signed-off-by: Marek Behún --- drivers/firmware/turris-mox-rwtm.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c index d7e3489e4bf2..3ef9687dddca 100644 --- a/drivers/firmware/turris-mox-rwtm.c +++ b/drivers/firmware/turris-mox-rwtm.c @@ -260,6 +260,27 @@ static int mox_get_board_info(struct mox_rwtm *rwtm) return 0; } +static int check_get_random_support(struct mox_rwtm *rwtm) +{ + struct armada_37xx_rwtm_tx_msg msg; + int ret; + + msg.command = MBOX_CMD_GET_RANDOM; + msg.args[0] = 1; + msg.args[1] = rwtm->buf_phys; + msg.args[2] = 4; + + ret = mbox_send_message(rwtm->mbox, &msg); + if (ret < 0) + return ret; + + ret = wait_for_completion_timeout(&rwtm->cmd_done, HZ / 2); + if (ret < 0) + return ret; + + return mox_get_status(MBOX_CMD_GET_RANDOM, rwtm->reply.retval); +} + static int mox_hwrng_read(struct hwrng *rng, void *data, size_t max, bool wait) { struct mox_rwtm *rwtm = (struct mox_rwtm *) rng->priv; @@ -497,6 +518,13 @@ static int turris_mox_rwtm_probe(struct platform_device *pdev) if (ret < 0) dev_warn(dev, "Cannot read board information: %i\n", ret); + ret = check_get_random_support(rwtm); + if (ret < 0) { + dev_notice(dev, + "Firmware does not support the GET_RANDOM command\n"); + goto free_channel; + } + rwtm->hwrng.name = DRIVER_NAME "_hwrng"; rwtm->hwrng.read = mox_hwrng_read; rwtm->hwrng.priv = (unsigned long) rwtm; From patchwork Thu May 6 09:08:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 12241889 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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 C9289C433ED for ; Thu, 6 May 2021 09:12:07 +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 80957610C8 for ; Thu, 6 May 2021 09:12:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80957610C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=QUq2MzDeDQXJt73c+eDPu1rNSOy9/yXfg/LrzWYrRYY=; b=RGIS22Tq7xN2u6ZlgrrfDyZz+ eRm2OHxYWn8Abn0DrYLXJjoZK17dAZctjMfs5AWi1D7TY2I8wT6KHd5qMEM+Kb1cAYWiddq4ULmKt 5/yw+9WJDxWOIHoilhN8XK8A/jU1jIV9/qf4EwR24TEcUvBlFswV0gIqGYTFGMlnqtOV9GxE1e63u aEDvlk26UWV6GRhRpK11QQOQx5AcuEPq/0GyxQbgjo7l8ifURr165ylqChGuKKr0O2oqKfPufnlhb DYCAbK/hecKM1QLorGbX4zP0poO5KuVqoi+uAxBf+CP4rditINL/EvnqqN9SQ2I2xeX265ohdhYG8 MruUgHE5Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lea0U-003kuN-R9; Thu, 06 May 2021 09:09:18 +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 1leZzj-003koY-Qe for linux-arm-kernel@desiato.infradead.org; Thu, 06 May 2021 09:08:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=8NZnA7V+z/EHW9keu1iVSVZG84qryZ9Vb6MgLmI5Xdk=; b=BYulTgcHn/BT6RT7hEXxFoFaVR Sr6ZaylPxJW492+z35YN20jN5gM4n2NcEMwMh8b32ZbKgNM+qwtFO5eoR1uKbQPHUJM1YC0g9PDpE R3T700SqY0K6BEBEC40noIZUdopKZA8uQa85fAiOPRANecKQLpa4QrcZrnBOTbp/P3Un7SXRN4vmS mB5trUX3WK8UbtKuqVyBs9DxmhSBypm6Jg5orWKOSEpdM9wMJZ2Dd2RwTY2d98vkVc8GDryCp7nsr xVvPNhvcK8s7rUbMUWLA6evD9a61OqkMsI85QtBGr9C8ythhM/h7ntdIS0w7edoaUUOCDkALWsdyZ DCpX/Iqw==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leZzg-005tR4-VG for linux-arm-kernel@lists.infradead.org; Thu, 06 May 2021 09:08:30 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 68F6861378; Thu, 6 May 2021 09:08:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620292108; bh=+OylOm4Xj8hBbMUtVil2h9pLATRR6MkYlmUTGrTyvwk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OSwtFYhbtp+nn8QhfWN1UuMceplu/ZIR5t0I4DQrzHlefkT/sHW68U/gBo+r/TceQ gYDl3BaOMu3yWm/TWqILzc6sMBEGXjyho4ek4PPPUSYxphsLO7J7PIfjVr/gmg5EDj wvB00Xh8vQHKuu4tjoGAGX2dA5Ur/dwIusYex2OW5jliXVh1LzGhZ3eH5u93sTYS60 fBKdkGQXvU4n/UCOQvKo1qva1bMaT1d/BOzrxQsnzfJg9M+6WNzNozvp2raj7z2/HI OFr3V+dGJUqhqtuyJ08ngRPiySudMGEvJ2++YkP5f23J8RJTDu7zD54odtPB6hJlWc ftB1HF7mWVT4w== Received: by pali.im (Postfix) id 27D88732; Thu, 6 May 2021 11:08:28 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Gregory CLEMENT , Andrew Lunn Cc: =?utf-8?q?Marek_Beh=C3=BAn?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 mvebu + mvebu/dt64 4/6] firmware: turris-mox-rwtm: show message about HWRNG registration Date: Thu, 6 May 2021 11:08:00 +0200 Message-Id: <20210506090802.14268-4-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210506090802.14268-1-pali@kernel.org> References: <20210308153703.23097-1-kabel@kernel.org> <20210506090802.14268-1-pali@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_020829_050551_17EF0A08 X-CRM114-Status: UNSURE ( 9.99 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently it is hard to determinate if on Armada 3720 device is HWRNG by running kernel accessible or not. So print information message into dmesg when HWRNG is available and registration was successful. Signed-off-by: Pali Rohár Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver") --- drivers/firmware/turris-mox-rwtm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c index 3ef9687dddca..1cf4f1087492 100644 --- a/drivers/firmware/turris-mox-rwtm.c +++ b/drivers/firmware/turris-mox-rwtm.c @@ -542,6 +542,8 @@ static int turris_mox_rwtm_probe(struct platform_device *pdev) goto free_channel; } + dev_info(dev, "HWRNG successfully registered\n"); + return 0; free_channel: From patchwork Thu May 6 09:08:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 12241885 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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 A8A94C433ED for ; Thu, 6 May 2021 09:11:48 +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 5A17B6100A for ; Thu, 6 May 2021 09:11:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A17B6100A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=Y0x2PGL4X92TcV/+ZIbelGttoe/nk72BPEEBGwuNtGE=; b=ZKh1oc0XxJwJ4fp07woONheUK Mb4q+uNJt3vSe5CqGL2VktunMeRiJHMo4WB9RRylnedLfCCLRkyeddrWcfhMjXhOqITdhCuYz7OZX T/a4pNof4zePXO5bmyIRuCXQYbaUTDMhRTY6JjfKEaqsDpr+okZdRkiUzETO+8f8yAmTZrt3zxJDV dBBiC/UqXeeWYSm0hrjnHn87H6zXwTctmyuBX7LE6HqGJhmtbok06CLO6C8DwFgvE1vEZctT17CTu m/+s4dxQsH6WYeWlh3i+EIE91FNoeE2qMMgD+dVVOipF+PPCszUKN3zWXXUbhPiDs8ksoZP3twl0O 6eSmzA/CA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lea02-003kqT-Kc; Thu, 06 May 2021 09:08:50 +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 1leZzk-003koa-H3 for linux-arm-kernel@desiato.infradead.org; Thu, 06 May 2021 09:08:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=Xi4gcxr07Z2fqZn/n6VFBWXZX6ZNrFmE9ap6PKkWJIg=; b=HGQU0S4P9wMFa+5KZm4eAp2qlk Gq48gEt9OunlCf0Px3iut+oAfTOmPG7yfb71K7mhD4HsNZPh1A3m8DUkr40sxr4Yz7/R/TwcWj7Iw H45tQAwpX9Ux0SIZWSmleIEHvriI++NN0Uw7SdpOnvPfkZKPh0ZCSXXfLgoKUs6bR45wmkDXRqwwB zqnnIOrUWuJuHnA+IR5gPRiS4rUtVmee7WLFeCfZAhV4ebCjRHxU/UZ9tlQhqWSp4GgtK2dmH6g3l NWb08vSqfErOVypsiXiO9qNVf2WS3vJ5bmLB9evQJzdMPRkhfEUt7y+z04SRTobdkn+J9PAtrvcLx NupUcfFw==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leZzi-005tRb-1g for linux-arm-kernel@lists.infradead.org; Thu, 06 May 2021 09:08:31 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7D5FB613BA; Thu, 6 May 2021 09:08:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620292109; bh=J5vHzzxX2VNER+zka6PEWkClrD68ro+cEjhzakb7mic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jl68ZHPzHp69/VBzzo+viUX2tfWeKoenhWdHPbM0lMCb1vd4LaNv50fHjAqNdVPEt 7YY15+ZbvaDV8nQFlWszQI0EMbBDHW/DnudHAY9aVuwWOrlv8RN1xGgLiSW1a9z3Wc ItdWI7HbY7f2hBbMafTj04865PbcSPMVSPi/BJQdzW3+z2H3imIC9MuRZ4bXS/d9Xk jjaKXLS3sLrUOrQvTRfQKJgOK7cI0i7Otv825Syi4Wsdom6HvEDCt3uVDwb8eJHS8o 37BP28rtIuPWy3uh/9Q96V6Uz6BK8bcXC07GJcUiMx/O10LYDDKBjcSV7cUtuxq85t 0DseSDrPs2jYw== Received: by pali.im (Postfix) id 3BE76732; Thu, 6 May 2021 11:08:29 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Gregory CLEMENT , Andrew Lunn Cc: =?utf-8?q?Marek_Beh=C3=BAn?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 mvebu + mvebu/dt64 5/6] firmware: turris-mox-rwtm: add marvell, armada-3700-rwtm-firmware compatible string Date: Thu, 6 May 2021 11:08:01 +0200 Message-Id: <20210506090802.14268-5-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210506090802.14268-1-pali@kernel.org> References: <20210308153703.23097-1-kabel@kernel.org> <20210506090802.14268-1-pali@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_020830_138812_18EAB927 X-CRM114-Status: GOOD ( 11.56 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add more generic compatible string 'marvell,armada-3700-rwtm-firmware' for this driver, since it can also be used on other Armada 3720 devices. Current compatible string 'cznic,turris-mox-rwtm' is kept for backward compatibility. Signed-off-by: Pali Rohár Fixes: 389711b37493 ("firmware: Add Turris Mox rWTM firmware driver") --- We are also planning to work on extending this driver to support accessing OTP, which will also work with Marvell's default WTMI firmware. --- drivers/firmware/turris-mox-rwtm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c index 1cf4f1087492..c2d34dc8ba46 100644 --- a/drivers/firmware/turris-mox-rwtm.c +++ b/drivers/firmware/turris-mox-rwtm.c @@ -569,6 +569,7 @@ static int turris_mox_rwtm_remove(struct platform_device *pdev) static const struct of_device_id turris_mox_rwtm_match[] = { { .compatible = "cznic,turris-mox-rwtm", }, + { .compatible = "marvell,armada-3700-rwtm-firmware", }, { }, }; From patchwork Thu May 6 09:08:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 12241893 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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 64F50C433ED for ; Thu, 6 May 2021 09:12:15 +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 C6C35610C8 for ; Thu, 6 May 2021 09:12:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6C35610C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=ErTYoBYR5Fn/49pxg9kMJhlr/gvqpXlms9EwffxkBEY=; b=dwWj9VnhVWf2lKwu2BkLAJcg8 Ppkk4A26Wu1uAcmHwhIdgFRNDjKjtheCu2+QUT7kAsZ+AUcnRGA17Id7TU5VFh/M0ec+1Dtk7mdNV ZvLfhCJV31eeC88haYzielytibDCjF9G3JjC5bRkS+4u61bVbvVR0PFVlnpq0eq5z+/m1dXkh88Lq 7y6tRLEMbSDxDv8Lgll3Qkry9/g4mmdXZqbfd1DxiDsGzBnBok3vK/LJzxamuoaxa/vr48VrF2zwx Qe+h3lcam7k9Orc+NYkgXqHODc+RUoByf2wken6G21Ay80sNjqLtHmdyGjfvpflgLQ5yen1h3SzcV fTdju0a0g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lea0x-003l1Q-KF; Thu, 06 May 2021 09:09:47 +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 1lea0J-003kt2-72 for linux-arm-kernel@desiato.infradead.org; Thu, 06 May 2021 09:09:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=QAs0VKDf2DS+kHVA7k/n+0JwJhlXpIcQsC7I+/kBXa0=; b=43W8E9SU/bW69oB1LubV+0TA2k iOyvAmBK0Sg69Y19jgtX/BaqCEZ4Cjgp0SueeW+J3i2udW5WbQHvIKEHM3Dwu2lUG67B5F+1nraCM i/aPoRBha9izDEhDaHSTH2gwjCdaozCyNv67VWCDxveJnlqXVnVBHAc4KENwv+OmUoyuO8qYNzM4q Ti7d5K078n9oXA0BwAc7tajLIdXQng34llaGAiLvoPXUZm64ta86C3vYjoo3WQUfidJTAkuHJ9lVL e9bSBJG34XsQyAEyZFL6ZKnI3hIIO0tt06ZlFRdIgQJcds50iGQ/Xl9VIePQP3XnF2x9E3izdMBAI 4tidqe3Q==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lea0G-005tTr-Nl for linux-arm-kernel@lists.infradead.org; Thu, 06 May 2021 09:09:06 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2B7A360FEE; Thu, 6 May 2021 09:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620292144; bh=HaAfWtOAafkNSsvz88e84TAEk52kR7zNGm+Hs1lufVE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kbz3ZT3czmDTPiEHofA2omrUzRRbVbZvQ9cVWU+5hyYE80BUTfKlHHMNOvyP3clN5 wD4qvnDOoWcmLh0KNq4IwcLF+u0Z7KOeE24Ah09aOzzOrv6SIx9q4/VzcVZZSLdEtL ve60187F0+KLqVy5q61j4peVs0JD4Jz/+GSF+gGLs6ajNcSMxmTE5a6EooyLpaZv9p BKoCjDR4KA4dNuCt3YfB15hcTeXTTbVUPf5v4XzylVVDCrAXt7iFQTt0zckNSnaooI pG6ov8gbmdsEdt7T06f+Amae9J+ZJRJI+OGJQv2bN9KqDI3PDijh+G1C/1scduatgB uPKU8ld7JmWOQ== Received: by pali.im (Postfix) id 5F565732; Thu, 6 May 2021 11:09:02 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Gregory CLEMENT , Andrew Lunn Cc: =?utf-8?q?Marek_Beh=C3=BAn?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 mvebu + mvebu/dt64 6/6] arm64: dts: marvell: armada-37xx: move firmware node to generic dtsi file Date: Thu, 6 May 2021 11:08:02 +0200 Message-Id: <20210506090802.14268-6-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210506090802.14268-1-pali@kernel.org> References: <20210308153703.23097-1-kabel@kernel.org> <20210506090802.14268-1-pali@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_020904_822987_A49A2FF4 X-CRM114-Status: GOOD ( 14.21 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Move the turris-mox-rwtm firmware node from Turris MOX' device tree into the generic armada-37xx.dtsi file and use the generic compatible string 'marvell,armada-3700-rwtm-firmware' instead of the current one. The Turris MOX rWTM firmware can be used on any Armada 37xx device, giving them access to the rWTM hardware random number generator, which is otherwise unavailable. This change allows Linux to load the turris-mox-rwtm.ko module on these boards. Tested on ESPRESSObin v5 with both default Marvell WTMI firmware and CZ.NIC's firmware. With default WTMI firmware the turris-mox-rwtm fails to probe, while with CZ.NIC's firmware it registers the HW random number generator. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Cc: # 5.4+: 46d2f6d0c99f ("arm64: dts: armada-3720-turris-mox: add firmware node") --- arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts | 8 -------- arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts index 0753cc489638..ebb0ddf8d306 100644 --- a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts +++ b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts @@ -107,14 +107,6 @@ /* enabled by U-Boot if SFP module is present */ status = "disabled"; }; - - firmware { - turris-mox-rwtm { - compatible = "cznic,turris-mox-rwtm"; - mboxes = <&rwtm 0>; - status = "okay"; - }; - }; }; &i2c0 { diff --git a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi index 1b7f43e27589..847a2d12a4be 100644 --- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi +++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi @@ -505,4 +505,12 @@ }; }; }; + + firmware { + armada-3700-rwtm { + compatible = "marvell,armada-3700-rwtm-firmware"; + mboxes = <&rwtm 0>; + status = "okay"; + }; + }; };