Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1318885ybg; Fri, 18 Oct 2019 15:52:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxB/5B6t6si1Yxjlk4K5mjeKTnNBc0XpjS7pqXVVF/7zgGZ/7SRs6j40ULeVw049N4KYfLt X-Received: by 2002:a17:906:46c3:: with SMTP id k3mr11056549ejs.70.1571439146447; Fri, 18 Oct 2019 15:52:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571439146; cv=none; d=google.com; s=arc-20160816; b=a7BG6X3GZnHPHJB9YZJ6lBMIl1M7ivqUu0YtCgWz2o5QrVSx1dew1HeHLn09i9ki+T VKaHJkfh3Yc5VGMt4OZh7Do7rxO0AVtlZ9mv4Cay9jWdvZm0U8kAP9yz2gexnVuWhTT1 p2HZwhyYR00ulnNfQWgJNgVSRevKLpv2BuiMIFczGeQSs3djTT+yM7keDrbPBgXiHvHT OaqC6VZilt/IIrZfbQslgy4GQvwjkNHs1H2czCLAc/6bNMs4RFYIqzarBjzJiLDT1qqO daljX64zCokI6nhZJfB2Vlnm8TuSM3WSa57XceSor9Sj1ehvq5dTIfu9BAX3eeHa+lRM /QHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=veDsmjIW4lr6N43xAjmczweYgSfaJkoXjYLGt5Bz+aQ=; b=qLkECsY+cSaU22K1Z5FsR9cTNPzoslkQ19hcaDoljhUTq5XuYiBa7eJEcp4qxDX/pF j+41sgwCs15ZzRrRmM+sTvbt1oJCVEUqm7xTPt6Irh4Crx9kJPa/+GdMDT3/JX6B/SAp UT6dQS6MWlZbH58ms7e+WK22StZgi3/llRyNUX8u7hvANQdRruuVxG+FHhRiXIjBHogU NB+WFyp1XKoRlwi4PdupjJlZ0OJkVTqJLWKbt0WyjQip0JcQRnOosxmUtrWErnfrml5o iGYEeMw3oszgprwqWyzhVIlNiAVLjeWCzWN/YUxaTawM/FicursNkvV1bszzFWJXdJR3 C+Lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b56si4942056edb.418.2019.10.18.15.52.03; Fri, 18 Oct 2019 15:52:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2441981AbfJRFlU (ORCPT + 99 others); Fri, 18 Oct 2019 01:41:20 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:31112 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2389961AbfJRFlU (ORCPT ); Fri, 18 Oct 2019 01:41:20 -0400 X-UUID: 2be832a9497145dbb013a68753705429-20191018 X-UUID: 2be832a9497145dbb013a68753705429-20191018 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1470944434; Fri, 18 Oct 2019 13:41:14 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 18 Oct 2019 13:41:11 +0800 Received: from [172.21.77.33] (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 18 Oct 2019 13:41:11 +0800 Message-ID: <1571377272.11955.6.camel@mtkswgap22> Subject: Re: [PATCH v4 2/3] dt-bindings: rng: add bindings for MediaTek ARMv8 SoCs From: Neal Liu To: Rob Herring CC: Mark Rutland , "devicetree@vger.kernel.org" , Herbert Xu , wsd_upstream , Sean Wang , "linux-kernel@vger.kernel.org" , Crystal Guo =?UTF-8?Q?=28=E9=83=AD=E6=99=B6=29?= , "linux-crypto@vger.kernel.org" , Matt Mackall , Matthias Brugger , "linux-mediatek@lists.infradead.org" , "linux-arm-kernel@lists.infradead.org" , Neal Liu Date: Fri, 18 Oct 2019 13:41:12 +0800 In-Reply-To: <1570024070.4002.1.camel@mtkswgap22> References: <1561361052-13072-1-git-send-email-neal.liu@mediatek.com> <1561361052-13072-3-git-send-email-neal.liu@mediatek.com> <20190722171320.GA9806@bogus> <1563848465.31451.4.camel@mtkswgap22> <1568771054.21700.7.camel@mtkswgap22> <1570024070.4002.1.camel@mtkswgap22> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-10-02 at 21:47 +0800, Neal Liu wrote: > Dear Rob, > > Just a gentle ping. > > Neal > > On Wed, 2019-09-18 at 09:44 +0800, Neal Liu wrote: > > On Tue, 2019-07-23 at 22:35 +0800, Rob Herring wrote: > > > On Mon, Jul 22, 2019 at 8:21 PM Neal Liu wrote: > > > > > > > > > > Please don't top post to lists. > > > > > > > Dear Rob, > > > > You can check my driver for detail: > > > > http://patchwork.kernel.org/patch/11012475/ or patchset 3/3 > > > > > > I could, or you could just answer my question. > > > > > > > > > > > This driver is registered as hardware random number generator, and > > > > combines with rng-core. > > > > We want to add one rng hw based on the dts. Is this proper or do you > > > > have other suggestion to meet this requirement? > > > > > > It depends. There doesn't appear to be any resource configuration, so > > > why does it need to be in DT. DT is not the only way instantiate > > > drivers. > > > > > > Rob > > > > > > > We would like to consult more about this patch. > > We cannot figure out what method should be used instead of DT. > > The interface to access firmware is "smc" and firmware function only > > exists on certain platforms. > > Some DT has similar way, like: > > http://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts#L470 > > > > firmware { > > optee { > > compatible = "linaro,optee-tz"; > > method = "smc"; > > }; > > }; > > > > Is there any way to instantiate driver on certain platforms without DT? > > Could you give us some examples? > > Thanks > > > > > > > > > > Thanks > > > > > > > > > > > > On Tue, 2019-07-23 at 01:13 +0800, Rob Herring wrote: > > > > > On Mon, Jun 24, 2019 at 03:24:11PM +0800, Neal Liu wrote: > > > > > > Document the binding used by the MediaTek ARMv8 SoCs random > > > > > > number generator with TrustZone enabled. > > > > > > > > > > > > Signed-off-by: Neal Liu > > > > > > --- > > > > > > .../devicetree/bindings/rng/mtk-sec-rng.txt | 10 ++++++++++ > > > > > > 1 file changed, 10 insertions(+) > > > > > > create mode 100644 Documentation/devicetree/bindings/rng/mtk-sec-rng.txt > > > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt > > > > > > new file mode 100644 > > > > > > index 0000000..c04ce15 > > > > > > --- /dev/null > > > > > > +++ b/Documentation/devicetree/bindings/rng/mtk-sec-rng.txt > > > > > > @@ -0,0 +1,10 @@ > > > > > > +MediaTek random number generator with TrustZone enabled > > > > > > + > > > > > > +Required properties: > > > > > > +- compatible : Should be "mediatek,mtk-sec-rng" > > > > > > > > > > What's the interface to access this? > > > > > > > > > > A node with a 'compatible' and nothing else is a sign of something that > > > > > a parent device should instantiate and doesn't need to be in DT. IOW, > > > > > what do complete bindings for firmware functions look like? > > > > > We would like to revise our DT node as below: firmware { hwrng { compatible = "mediatek,mtk-sec-rng"; method = "smc"; }; }; And dt-bindings path would be changed because it's base on ARM TrustZone Firmware. From "Documentation/devicetree/bindings/rng/mtk-sec-rng.txt" To "Documentation/devicetree/bindings/arm/firmware/mediatek,mtk-sec-rng.txt" We found some similar examples which also provide an interface to trap to Secure State through SMC instruction. Example 1: Documentation/devicetree/bindings/arm/firmware/xxx.txt Example 2: Documentation/devicetree/bindings/arm/psci.txt Is that okay for you? Neal > > > > > > + > > > > > > +Example: > > > > > > + > > > > > > +hwrng: hwrng { > > > > > > + compatible = "mediatek,mtk-sec-rng"; > > > > > > +} > > > > > > -- > > > > > > 1.7.9.5 > > > > > > > > > > > > > > > > _______________________________________________ > > > > > Linux-mediatek mailing list > > > > > Linux-mediatek@lists.infradead.org > > > > > http://lists.infradead.org/mailman/listinfo/linux-mediatek > > > > > > > > > > >