From patchwork Fri Dec 21 09:51:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 154384 Delivered-To: patches@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp712422ljp; Fri, 21 Dec 2018 01:52:20 -0800 (PST) X-Received: by 2002:a63:2586:: with SMTP id l128mr1777111pgl.104.1545385940169; Fri, 21 Dec 2018 01:52:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545385940; cv=none; d=google.com; s=arc-20160816; b=sqRnqarVcRWAFqJfKABKgfxsnDnbWRwGQYdt7F4fj5NpT36WJqaXJhrbIkIyzZoJgH xQoPGzgk/39c2ktj17RlyZ9b1BzgM8duAX+uZvIN3y/m0/VX3Jdfw9txJ1S1m5zJnveq ZRPeNVQpSW0gWaVVr8bQkiBAJlic4LII4BGczsjiJPYur4qVkRBQsphgf9dbXFx910wq 4DkpvVWXpsnGOUgKJCggWRyJpx6r4EfL2DgW2jn7LgWRgyZJ8ksr2H1d34GxMbQTxUVm iJRMv4jMQGreTatLSY+kFNGIg2PoKfsBCd2yJlkCZh33W3gAJBHBiDjer4HlyzMbJsxO unmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=WE/5lyVWjbEcyDv1RDuRWU2ncyOfpsAGtJgLuwfczTg=; b=yuyqAZT0oh4YrSk5TLzI8YNocbKsIdIjKZ4DKx+/zN0HhmxfhpIuSsG4V9JIlHYePv qyA0u+RsikjiMn3PqV2fkKfkQz5T/AvT/HqgSUD/fQMPzY7OTSspDRsOoHEflPxzhFk1 Q3d5VlNPgYNh7B8NSzmERBV8uA2h67oOgeE4gkRTu5kVfs0QSmbxUrcrRuOQNt9FFxw/ jGV8Tzn9XAOpoeYmDhweFQY5paIJumsGuxKilJxmdVvsjHLlGndaLy9FIOQtTEKHMWRy H7Vi3Kb5ztCY5NbCMa9F3QQ/CAC/lMqoqdWnuKxkDU39wqhjVCXx3F6x6PblwfEGjzWY m6Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z1BmAys6; spf=pass (google.com: domain of sumit.garg@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=sumit.garg@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id o88sor40044967pfa.41.2018.12.21.01.52.19 for (Google Transport Security); Fri, 21 Dec 2018 01:52:20 -0800 (PST) Received-SPF: pass (google.com: domain of sumit.garg@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z1BmAys6; spf=pass (google.com: domain of sumit.garg@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=sumit.garg@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=WE/5lyVWjbEcyDv1RDuRWU2ncyOfpsAGtJgLuwfczTg=; b=Z1BmAys6qsMhCTqLQBlKgvhNz9jdppd1VAirlZTdgFt7CHHTcCF1istJ0k374Ex7c9 0h4HK2uv1jVN7ZtMAS6/jYdX/iarRRhNkPs5aPP6psXQWrPATch7wMHdobx9VcBp1TEm pcsE5b8jWnCtwVHy9c4mNo/ZVEjVQS2zHPTwk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WE/5lyVWjbEcyDv1RDuRWU2ncyOfpsAGtJgLuwfczTg=; b=TC1jPrp025b69GJ9OMC2HvIp6ceaKfJVkP/vren9bzBwdtrbwEhct6106QfwYax9L1 PoGEcAb16wFElOSAASrmzBtFANXCbaP64vQsNnEPtwg1bWDquo/MlGogI14Bq++T0c9H kQXDz8eo/F/Q1dRtJ+n2KUndF+thv4AK8P+ZmMW7QyaYJYgf5X8U1Nf4qIJyPUYHaJ/A fRD0aEqSbcPf+7vj/t/cfISNpWHKTGqZRH05tgc+sgBW/dfMClqVmOw0mnhREbGjTXuB vIGSM3y7md8IDsk1MiiItujkPpPe08lJvGuxYBaP8CUleQySVM0+LJ2s4+YZYNxcxW7D INIw== X-Gm-Message-State: AJcUukdFUGOKZQ2tAH0uvfDO4qV9HUwCBtErWPTOP39Kc5SNQCADz2Ku vdin5XiJZ7F2FxXhEIeeWIq0x/uI X-Google-Smtp-Source: AFSGD/Vzo4k5Hw3wUoZROUx0XbviAEzmZlbyoKnQ1dujKFsfcNY4FYTzpDtx4D9HC+bGLBSv+HkPrg== X-Received: by 2002:a62:5c1:: with SMTP id 184mr1775467pff.165.1545385939600; Fri, 21 Dec 2018 01:52:19 -0800 (PST) Return-Path: Received: from localhost.localdomain ([117.196.232.175]) by smtp.gmail.com with ESMTPSA id u29sm30605908pgn.23.2018.12.21.01.52.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 21 Dec 2018 01:52:18 -0800 (PST) From: Sumit Garg To: daniel.thompson@linaro.org Cc: patches@linaro.org, Sumit Garg Subject: [PATCH v3 0/2] Add OP-TEE based hwrng driver Date: Fri, 21 Dec 2018 15:21:50 +0530 Message-Id: <1545385912-19068-1-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 On ARM SoC's with TrustZone enabled, peripherals like entropy sources might not be accessible to normal world (linux in this case) and rather accessible to secure world (OP-TEE in this case) only. So this driver aims to provides a generic interface to OP-TEE based random number generator service. Example case is Developerbox based on Socionext's Synquacer SoC [1] which provides 7 thermal sensors accessible from secure world only which could be used as entropy sources (thermal/measurement noise). [1] https://www.96boards.org/product/developerbox/ Changes in v3: - Remove PFX - optee_rng_read: refine to provide output in read.2 like interface - Added soft dependency on optee module Changes in v2: Instead of device tree, fetch rng infomation like data-rate and quality from op-tee rng service itself. Sumit Garg (2): dt/bindings: add bindings for optional optee rng-uuid property hwrng: add OP-TEE based rng driver .../bindings/arm/firmware/linaro,optee-tz.txt | 4 + MAINTAINERS | 5 + drivers/char/hw_random/Kconfig | 15 ++ drivers/char/hw_random/Makefile | 1 + drivers/char/hw_random/optee-rng.c | 273 +++++++++++++++++++++ 5 files changed, 298 insertions(+) create mode 100644 drivers/char/hw_random/optee-rng.c -- 2.7.4