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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80F07C433EF for ; Thu, 7 Jul 2022 17:36:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236386AbiGGRgo (ORCPT ); Thu, 7 Jul 2022 13:36:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235347AbiGGRgl (ORCPT ); Thu, 7 Jul 2022 13:36:41 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA29A564E8; Thu, 7 Jul 2022 10:36:40 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 267HaWiY062098; Thu, 7 Jul 2022 12:36:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1657215392; bh=qYVY9Gxafsnq05WKymYLW9Fr3MB+6Vq7oGpUA/5zkZ8=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=VPQvyIHVGbD4hJAk19WNqPHo92znslCuYFspAMZ6TPq9bMMpYRn62tT14VkoAPThV gdK0PvTm9u2ksJ4MEij60FulNSVjNtjl5tFyJ65DROYr94N3BRYNHhpQFkwM4yYbbu XTKkaL10XQyyXWn/DYDkdQ7ZpcdELW1U7/Z6OMFY= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 267HaWwV000652 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 7 Jul 2022 12:36:32 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 7 Jul 2022 12:36:32 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Thu, 7 Jul 2022 12:36:32 -0500 Received: from [10.250.33.129] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 267HaVJg073255; Thu, 7 Jul 2022 12:36:31 -0500 Message-ID: <1d6d171f-3c91-530a-27a5-c93153cb2378@ti.com> Date: Thu, 7 Jul 2022 12:36:31 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v2 1/4] arm64: dts: ti: k3-am65-main: Disable RNG node Content-Language: en-US To: Nishanth Menon CC: Bryan Brattlof , Vignesh Raghavendra , Tero Kristo , Rob Herring , Krzysztof Kozlowski , , , References: <20220706190838.26074-1-afd@ti.com> <20220707144400.tk3wmpeijdhuxpzv@bryanbrattlof.com> <20220707171734.e22t5rx5ux7k5kcr@magnetize> From: Andrew Davis In-Reply-To: <20220707171734.e22t5rx5ux7k5kcr@magnetize> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/7/22 12:17 PM, Nishanth Menon wrote: > On 10:01-20220707, Andrew Davis wrote: >> On 7/7/22 9:44 AM, Bryan Brattlof wrote: >>> Hi Andrew >>> >>> On July 6, 2022 thus sayeth Andrew Davis: >>>> The hardware random number generator is used by OP-TEE and is access is >>>> denied to other users with SoC level bus firewalls. Any access to this >>>> device from Linux will result in firewall errors. Disable this node. >>>> >>>> Signed-off-by: Andrew Davis >>>> --- >>>> >>>> Changes from v1: >>>> - Added comment in dtsi file >>>> >>>> arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 1 + >>>> 1 file changed, 1 insertion(+) >>>> >>>> diff --git a/arch/arm64/boot/dts/ti/k3-am65-main.dtsi b/arch/arm64/boot/dts/ti/k3-am65-main.dtsi >>>> index e749343accedd..9de5a8294acd6 100644 >>>> --- a/arch/arm64/boot/dts/ti/k3-am65-main.dtsi >>>> +++ b/arch/arm64/boot/dts/ti/k3-am65-main.dtsi >>>> @@ -127,6 +127,7 @@ rng: rng@4e10000 { >>>> reg = <0x0 0x4e10000 0x0 0x7d>; >>>> interrupts = ; >>>> clocks = <&k3_clks 136 1>; >>>> + status = "disabled"; /* Used by OP-TEE */ >>> >>> Just curious about how we should document disabling nodes. I was >>> assuming the reasoning should be described in the bindings? >>> >>> I would like to start disabling nodes by default in our dtsi files and >>> enabling them in our top dts file, making it easier for others to use >>> our device tree for a more focused purpose than our dev boards. I just >>> didn't know where I should document why I disabled the nodes :) >>> >> >> This got push-back last time this was suggested, I'll have to lookup >> the history. IIRC we landed on the other way around, all things should >> be described by default, then the specific board can enable/disable >> what is not used as needed. > > See thread https://lore.kernel.org/linux-arm-kernel/YiizsYnKB0X9bDY2@atomide.com/ > >> >> I was worried this topic would come up with this patch series and was >> almost just going to delete the whole RNG node instead of disabling it >> to avoid that. My reasoning for disabling here anyway is that this device >> *cannot* be used by *any* board, it is not just a board level configuration >> decision like disabling I2C nodes by default or similar that was proposed >> last time we had the "nodes disabled by default" discussion. > > Hmm.. If that is the case, then why even have it in dts - is that > because of cases where OPTEE is'nt the TEE and users may want to > directly use it? OR is it because OPTEE can potentially use device tree > itself and discover the rng location from dt? > Hadn't thought about the second case, but it could also be valid if we started using DT in our OPTEE. The intention was for the first case, this node has valid hardware description, didn't feel right to delete it due to it being unusable by Linux. Andrew 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE321C433EF for ; Thu, 7 Jul 2022 17:37:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HKaQVYaIhZjRdkO5l7WthPLbKkjkcDL049l22mGkcNs=; b=m8PZiTJzIySdW2 FCuKSS2pjuelWPZRYfRh8CutWBlHCcNI3EOJHwcasBDl92oH3RGY8vdLcmAjdrtYVoSKb2SzC8xtV ahOSshIEFhmPiqTG8Ciosp/G/TNfJg7bdTYvYxqzwseWzwfKJEUpWJIKDQUie9/VeW2zi3WdSDXLd NqvXqgYSUH0niT2HsfMK5wsTn1VHW+z2Kbmclmfi1p3CIxD3c5RmI2A5m3U7M/5N4PuoPEQK+npAj j/1V/edIIvPENi5EvSmtlsfWojzOonTaxDSNN/DG9p50quRbNXPER71RnzW8N8/UnBnJ+cOG6MuSm fj23nlh82/6pcs+af5vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9VQg-00HEkC-6f; Thu, 07 Jul 2022 17:36:42 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9VQc-00HEha-Ha for linux-arm-kernel@lists.infradead.org; Thu, 07 Jul 2022 17:36:40 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 267HaWiY062098; Thu, 7 Jul 2022 12:36:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1657215392; bh=qYVY9Gxafsnq05WKymYLW9Fr3MB+6Vq7oGpUA/5zkZ8=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=VPQvyIHVGbD4hJAk19WNqPHo92znslCuYFspAMZ6TPq9bMMpYRn62tT14VkoAPThV gdK0PvTm9u2ksJ4MEij60FulNSVjNtjl5tFyJ65DROYr94N3BRYNHhpQFkwM4yYbbu XTKkaL10XQyyXWn/DYDkdQ7ZpcdELW1U7/Z6OMFY= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 267HaWwV000652 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 7 Jul 2022 12:36:32 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 7 Jul 2022 12:36:32 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Thu, 7 Jul 2022 12:36:32 -0500 Received: from [10.250.33.129] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 267HaVJg073255; Thu, 7 Jul 2022 12:36:31 -0500 Message-ID: <1d6d171f-3c91-530a-27a5-c93153cb2378@ti.com> Date: Thu, 7 Jul 2022 12:36:31 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v2 1/4] arm64: dts: ti: k3-am65-main: Disable RNG node Content-Language: en-US To: Nishanth Menon CC: Bryan Brattlof , Vignesh Raghavendra , Tero Kristo , Rob Herring , Krzysztof Kozlowski , , , References: <20220706190838.26074-1-afd@ti.com> <20220707144400.tk3wmpeijdhuxpzv@bryanbrattlof.com> <20220707171734.e22t5rx5ux7k5kcr@magnetize> From: Andrew Davis In-Reply-To: <20220707171734.e22t5rx5ux7k5kcr@magnetize> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220707_103638_709146_5845ECCA X-CRM114-Status: GOOD ( 26.30 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 7/7/22 12:17 PM, Nishanth Menon wrote: > On 10:01-20220707, Andrew Davis wrote: >> On 7/7/22 9:44 AM, Bryan Brattlof wrote: >>> Hi Andrew >>> >>> On July 6, 2022 thus sayeth Andrew Davis: >>>> The hardware random number generator is used by OP-TEE and is access is >>>> denied to other users with SoC level bus firewalls. Any access to this >>>> device from Linux will result in firewall errors. Disable this node. >>>> >>>> Signed-off-by: Andrew Davis >>>> --- >>>> >>>> Changes from v1: >>>> - Added comment in dtsi file >>>> >>>> arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 1 + >>>> 1 file changed, 1 insertion(+) >>>> >>>> diff --git a/arch/arm64/boot/dts/ti/k3-am65-main.dtsi b/arch/arm64/boot/dts/ti/k3-am65-main.dtsi >>>> index e749343accedd..9de5a8294acd6 100644 >>>> --- a/arch/arm64/boot/dts/ti/k3-am65-main.dtsi >>>> +++ b/arch/arm64/boot/dts/ti/k3-am65-main.dtsi >>>> @@ -127,6 +127,7 @@ rng: rng@4e10000 { >>>> reg = <0x0 0x4e10000 0x0 0x7d>; >>>> interrupts = ; >>>> clocks = <&k3_clks 136 1>; >>>> + status = "disabled"; /* Used by OP-TEE */ >>> >>> Just curious about how we should document disabling nodes. I was >>> assuming the reasoning should be described in the bindings? >>> >>> I would like to start disabling nodes by default in our dtsi files and >>> enabling them in our top dts file, making it easier for others to use >>> our device tree for a more focused purpose than our dev boards. I just >>> didn't know where I should document why I disabled the nodes :) >>> >> >> This got push-back last time this was suggested, I'll have to lookup >> the history. IIRC we landed on the other way around, all things should >> be described by default, then the specific board can enable/disable >> what is not used as needed. > > See thread https://lore.kernel.org/linux-arm-kernel/YiizsYnKB0X9bDY2@atomide.com/ > >> >> I was worried this topic would come up with this patch series and was >> almost just going to delete the whole RNG node instead of disabling it >> to avoid that. My reasoning for disabling here anyway is that this device >> *cannot* be used by *any* board, it is not just a board level configuration >> decision like disabling I2C nodes by default or similar that was proposed >> last time we had the "nodes disabled by default" discussion. > > Hmm.. If that is the case, then why even have it in dts - is that > because of cases where OPTEE is'nt the TEE and users may want to > directly use it? OR is it because OPTEE can potentially use device tree > itself and discover the rng location from dt? > Hadn't thought about the second case, but it could also be valid if we started using DT in our OPTEE. The intention was for the first case, this node has valid hardware description, didn't feel right to delete it due to it being unusable by Linux. Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel