Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp158228ybz; Tue, 21 Apr 2020 06:40:57 -0700 (PDT) X-Google-Smtp-Source: APiQypKqRecFSSmRWzxhKXfGDWMUIW0IYLJx9JaNGkwt04C1rS/yEwQ99aaoshQODT2fpE7HVAPU X-Received: by 2002:a17:907:11de:: with SMTP id va30mr21326217ejb.121.1587476457362; Tue, 21 Apr 2020 06:40:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587476457; cv=none; d=google.com; s=arc-20160816; b=HLF5PWOHGLqQ6FnqVkMjTdY9P4kwsI0ik1i2/ZWHNwc5mrvbLG1RmSBiFjGCyll0Y9 qeIEoRRJZY6GWm6apNoh+mKH4zSrFSY/vbepVYTvoNIgZAkPFzGuSELfnirFvSzIxS6J fzbWhVyNPspH5GAjIAEm6Db2+tHKcljbhzYgotxniMeb2yhBTZa1ReGt73p7kVVVaJ4i UplnHPNLS+aOhUuMQymhKMnYdU+MKcxAhaB7xao0MvAQCdmFyNAD4BjOUkR39ZrKd4Q2 uLv5a52J7X/8Q3RcPOdHa8Evs/Huwb2X/XWSyVMzGbJPVMYE5zsNAAAW2w2wVpddMh7S NBZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=wTHT3hNFoOmYtNID8BTO1GUpG3gALHzloGVP2G+/T6U=; b=tKP7BZM9WDYH6zb0QH8qCieX8wWN8Jfrlhg7AeDRBfc4kJ7bjFGfFhpKTa+S3iTvyC 8jeGSmFTcVPhLmA6mLF59hu5gty/s+NwX2I9yDHKHoxHkD7fnizkqRqPzf0tkhyRy84K J2CEGsJXuoi8UhtR968p9ugZyWhjc4WHgujVHoyUjMHIkEAzDo61KBZCnu/I2WMpaLfv 1JElrXyWyVxLuHZEpMdslfu9Fofv6DaVyyTwA7+nGTlglMhMTJDje6BKzWz81HnzXLXE euTXtNoC/1IEFo2mliMLi1sY0msVQvSPUE3Jfaig+tnCRXIQgzMO3db+eo1Z47kNSm8+ FYbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n25si1695513ejl.342.2020.04.21.06.40.25; Tue, 21 Apr 2020 06:40:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728802AbgDUNkF convert rfc822-to-8bit (ORCPT + 99 others); Tue, 21 Apr 2020 09:40:05 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:46112 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728391AbgDUNkE (ORCPT ); Tue, 21 Apr 2020 09:40:04 -0400 Received: by mail-oi1-f195.google.com with SMTP id q204so11970165oia.13; Tue, 21 Apr 2020 06:40:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=3/1l4+L7c32gnSlR+jJxwn2uHEoI18nOZn1jAcK8+9Q=; b=qVWO7oiIChojoNCxQH8rGnO1CVw0zz2QrOO4Z+nt2O0mUtAoNVX7jlgmRi6ZJbdUYz EXPDych6FonQIco66FjGYP6BxiD4JVFLFaf94W2WgFDv2gMgjdASu4h+5MJyjXtZDsoK FUz00XV5Qyafy5bJG2Bt5iKZAfc39fTje+zGPn/aKXr7U+Btq9l9KdQRuFEXSSvsPJM4 Q+FesvCsm4C4ud5j3bIRVit2YRPQDbRFren53Ujq10nLU1M4j29NGVa2dpnPLIUBKgXp RtUgeQvRcwFed5NZsTm2Q4xPDskRaJAAc3ct1Vb6rvg1+WXVyQs4F01ORfV0+RRr8Hv/ 4F4w== X-Gm-Message-State: AGi0PuaPvH/9AoSKN/8xJVXF02dUkl2zQWvVO6Sc6HXrETsq2hWEju0D heJTnyzIKhn/qCfJXhoV48thCE8TKovN0GR2FfA= X-Received: by 2002:aca:f541:: with SMTP id t62mr3020719oih.148.1587476402149; Tue, 21 Apr 2020 06:40:02 -0700 (PDT) MIME-Version: 1.0 References: <1585289423-18440-1-git-send-email-hadar.gat@arm.com> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 21 Apr 2020 15:39:50 +0200 Message-ID: Subject: Re: [PATCH v7 0/3] hw_random: introduce Arm CryptoCell TRNG driver To: Hadar Gat Cc: Matt Mackall , Herbert Xu , Rob Herring , Mark Rutland , Arnd Bergmann , Greg Kroah-Hartman , Krzysztof Kozlowski , Florian Fainelli , Alexander Sverdlin , Thomas Gleixner , Tomer Maimon , Randy Dunlap , Zaibo Xu , Daniel Thompson , Mauro Carvalho Chehab , "David S. Miller" , Jonathan Cameron , Linux Crypto Mailing List , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , Gilad Ben-Yossef , Ofir Drang , nd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Hadar (and Gilad), On Tue, Apr 21, 2020 at 3:13 PM Hadar Gat wrote: > To better explain the relationship between ccree and cctrng drivers, here an description of the underlying hardware and the relationship to the two drivers: > > Arm TrustZone CryptoCell is a hardware block that implements two separate and discreet, although related, interfaces: one for the Rich Execution Environment (read: Linux) and the other for the Trusted Execution Environment (e.g. Trusty, Op-TEE). > > The ccree driver exposes the REE interface of CryptoCell to Linux. Where a SoC vendor implements both REE and TEE in their design, that is all that is needed. > > However, we have some customers that make use CryptoCell but never implement a Trusted Execution Environment. This is a design decision taken when the SoC hardware is being designed and not a software controlled configuration, as it involves how the buses are laid out. Some of these customers have requested from us to allow making use in Linux of the TRNG resources which are normally associated with the TEE side when it is not in use. For these customers, the cctrng driver allows making use in Linux the TRNG which is normally part of the TEE side of CryptoCell. Thank you, that is the part I was missing. BTW, there seems to be no mention of CryptoCell 630 on arm.com; it covers only CC-300 and CC-700. But from the (very limited) information about the crypto engine on R-Car Gen3 SoCs, it looks like the RNG is indeed only present in the secure (trusted) part. > > -----Original Message----- > > From: Geert Uytterhoeven > > On Mon, Apr 20, 2020 at 2:27 PM Hadar Gat wrote: > > > > From: Geert Uytterhoeven > > > > Sent: Monday, 20 April 2020 12:35 > > > > > > > > On Fri, Mar 27, 2020 at 7:11 AM Hadar Gat wrote: > > > > > The Arm CryptoCell is a hardware security engine. > > > > > This patch introduces driver for its TRNG (True Random Number > > > > > Generator) engine. > > > > > > > > Thanks for your series! > > > > > > > > I am wondering what is the relation between this and > > > > Documentation/devicetree/bindings/crypto/arm-cryptocell.txt? > > > > > > Arm TrustZone CryptoCell hardware contains both cryptographic engine > > (ccree) and true random number generator engine (cctrng). > > > > OK. > > > > > These are separate engines with some sharing in logic and interface. > > > > Do they share the same register block? > > > > > cctrng engine may not always be present. > > > > I assume that applies to e.g. the older 630p? > > > > > The devicetree documentation is in: > > > For ccree - > > > Documentation/devicetree/bindings/crypto/arm-cryptocell.txt > > > For cctrng - Documentation/devicetree/bindings/rng/arm-cctrng.yaml > > > > Thank you, I had already read both documents. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds