Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3056899ybi; Mon, 10 Jun 2019 03:38:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxK8FYD+7q5gWjhG6VUFELfa+lPKku5lfgrSUtLu1z5ZUHUVS7Oh7vrWFc1nSIJ8jQFDZ4p X-Received: by 2002:aa7:8d8c:: with SMTP id i12mr46309687pfr.200.1560163131925; Mon, 10 Jun 2019 03:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560163131; cv=none; d=google.com; s=arc-20160816; b=QmyBCSGQrRMYBumX3AE/qxirNZPxxvvfmT6L4Z9e8KJ36vJmXIgvWoKsm0fnT+Nx4q dtrwNjkKEiVPLFuhM2dxkxJh4tiojyVqiHvU07L+Jc/YFJb2E6Dn7zjDdLbIsapjERIw HpA91eFbd9iUkSu8fo1LzWK9VLipeMtrxdNlrCvzB5cactGNfSMWnqa8Qfnq7eUiZQOZ RqdCD2rwhGrF79Jk2faYO+isFYo8ATO48JekGTNol1lfWTcRRfAokz3MzEEqtWafnQUz eITOQJ8+xElCZDgrBUmqYATnxdcyjwFlKurHd26fLzArn5rNzRRQkhBsMyv6JITdDWTM 0Pog== 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=CNnQes7nEzxoG1d8E6Hoba2dnBE0GOWGstoK+NOOxrc=; b=g1aWMX407C2vbKM9hs/7nN04YDW9GNy6x0zWoYpj04+BPiO62nDn4yf7JvA4SrYD6G CoesDYmZk7bYmIQEwq294Re0RVxcHmcDFGbZBAdnVz6yx7rT1DZxnGcY4UWQeiiVIHLq uqPJQCZg/Z7sNePGgzpAL5gf63pAzsaBGhW8uI44xEN3i9uJ8eNQBtqPKpXNLb03a85B o6cjiBspNVv6/9y/tJWU12ZWzrrsSnMGEnk4EeEkDLZymEZOy7iAXeeUWrL/RvswTsT0 zzbEGEeL31uAs+BzbRCQgwrGEibSgf1fP52rtJRZdOtrUksLPUWVEqc9F3L8kMqramJK ka+g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m26si9422664pgl.139.2019.06.10.03.38.35; Mon, 10 Jun 2019 03:38:51 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389507AbfFJKgn (ORCPT + 99 others); Mon, 10 Jun 2019 06:36:43 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:16561 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2389308AbfFJKgm (ORCPT ); Mon, 10 Jun 2019 06:36:42 -0400 X-UUID: c4feae6bd63740d299065c72a64fd4a0-20190610 X-UUID: c4feae6bd63740d299065c72a64fd4a0-20190610 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1785317434; Mon, 10 Jun 2019 18:36:34 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 10 Jun 2019 18:36:33 +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, 10 Jun 2019 18:36:33 +0800 From: Neal Liu To: Matt Mackall , Herbert Xu , Rob Herring , Mark Rutland , Matthias Brugger , Sean Wang CC: Neal Liu , , , , , , , Crystal Guo Subject: [PATCH v3 0/3] MediaTek Security random number generator support Date: Mon, 10 Jun 2019 18:36:21 +0800 Message-ID: <1560162984-26104-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. Neal Liu (3): soc: mediatek: add SMC fid table for SIP interface dt-bindings: rng: update bindings for MediaTek ARMv8 SoCs hwrng: add mtk-sec-rng driver .../devicetree/bindings/rng/mtk-rng.txt | 15 ++- 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, 159 insertions(+), 3 deletions(-) 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