Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2100058ybd; Mon, 24 Jun 2019 00:26:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/tP3EwvYH56rUKT3PdVAtlTcQmQAuh4LdO+e2lEfH2s2nXCbmKAMR/YupWPG1JoFv1/8Z X-Received: by 2002:a17:90a:ad93:: with SMTP id s19mr23146301pjq.36.1561361164898; Mon, 24 Jun 2019 00:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561361164; cv=none; d=google.com; s=arc-20160816; b=qXEAJp0hNX/Cj7E4QZtHY8CkI5c+DDA2+qHZQrs8n1bit/jN+4dlhrYkehG/PjiLE5 5eVnsc5kK3HxIWI9BEqu5fc+tjZYldxqgIlHTTcLiKyZgYGPI++zlCYi6YnbmZWDlkmI xxKsDmaHTptztglHwRLLf4Dspd47QOj4HSfhhzKEoW7zjSGc2YmzaLqkH941jRioJnij DQKAJFz2TabHUcwxblLVCPVvMQzq2Q5IzSyzF/sHWMFAbiXtKdVAnDGR9P0rmYu4rh/x xjjTyoruBGerOMLalwyP8Q9tO0ugnBJ+nUsx3VnaSq1QBLWF0WVJtgzndFPI+Btf7WlJ bWHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=q5RAfAAgD6A2kMX6GdkPlCTm7DHOtgJTMVpRp+fuAbQ=; b=k/uMGTng4NzoWX/mCSG9dtEFNALzRT5wlyPlfuxqFg8HCN3S7acdztp/AGdQwAkcFZ 7oXJgsFW1V2iiCJww60GWwi/mp2HQzQHgV9CciOxvrENlneOnRFsPauuDlyMXh3OrjVk S1j/zVU6LnQHF/dUo7uhbexeYupvA2lReIB7YMz2arJypxxhLZIFilIUSDwYP16KFubT dmky2USIjea8XwNptSv6HLY8AjyvfyZfB52W8zP7RUL8+1a2sJGT4MfbZBEDEccgNDnJ DfWu4DKCHc6Y9S8Z9JZ6+UCn4ywdwkcTBwvv0U9G7yNXZSWEB9KzA3bQvGZi9qIwHzJ3 fY3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k22si10518795pfi.289.2019.06.24.00.25.51; Mon, 24 Jun 2019 00:26:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727928AbfFXHYm (ORCPT + 99 others); Mon, 24 Jun 2019 03:24:42 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:46671 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726719AbfFXHYl (ORCPT ); Mon, 24 Jun 2019 03:24:41 -0400 X-UUID: a763fee8f60547f9a7d74f0d789bde4e-20190624 X-UUID: a763fee8f60547f9a7d74f0d789bde4e-20190624 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 2119492074; Mon, 24 Jun 2019 15:24:29 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 24 Jun 2019 15:24:28 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 24 Jun 2019 15:24:28 +0800 From: Neal Liu To: Matt Mackall , Herbert Xu , Rob Herring , Mark Rutland , Matthias Brugger , Sean Wang CC: Neal Liu , Crystal Guo , , , , , , Subject: [PATCH v4 0/3] MediaTek Security random number generator support Date: Mon, 24 Jun 2019 15:24:09 +0800 Message-ID: <1561361052-13072-1-git-send-email-neal.liu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org These patch series introduce a generic rng driver for Trustzone based kernel driver which would like to communicate with ATF SIP services. Patch #1 initials SMC fid table for Mediatek SIP interfaces and adds HWRNG related SMC call. Patch #2..3 adds mtk-sec-rng kernel driver for Trustzone based SoCs. For MediaTek SoCs on ARMv8 with TrustZone enabled, peripherals like entropy sources is not accessible from normal world (linux) and rather accessible from secure world (ATF/TEE) only. This driver aims to provide a generic interface to ATF rng service. changes since v1: - rename mt67xx-rng to mtk-sec-rng since all MediaTek ARMv8 SoCs can reuse this driver. - refine coding style and unnecessary check. changes since v2: - remove unused comments. - remove redundant variable. changes since v3: - add dt-bindings for MediaTek rng with TrustZone enabled - revise HWRNG SMC call fid Neal Liu (3): soc: mediatek: add SMC fid table for SIP interface dt-bindings: rng: add bindings for MediaTek ARMv8 SoCs hwrng: add mtk-sec-rng driver .../devicetree/bindings/rng/mtk-sec-rng.txt | 10 ++ drivers/char/hw_random/Kconfig | 16 +++ drivers/char/hw_random/Makefile | 1 + drivers/char/hw_random/mtk-sec-rng.c | 97 +++++++++++++++++++ include/linux/soc/mediatek/mtk_sip_svc.h | 33 +++++++ 5 files changed, 157 insertions(+) create mode 100644 Documentation/devicetree/bindings/rng/mtk-sec-rng.txt create mode 100644 drivers/char/hw_random/mtk-sec-rng.c create mode 100644 include/linux/soc/mediatek/mtk_sip_svc.h -- 2.18.0