From patchwork Tue Feb 27 14:09:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 129791 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1435963lja; Tue, 27 Feb 2018 06:09:46 -0800 (PST) X-Google-Smtp-Source: AH8x227Eqh35pa3op7KGOvM9ABhgShf8sYLYOSONG55f1YRkfTfXPB3Ga5CxeePpe2C+w9d4XywY X-Received: by 10.101.82.69 with SMTP id q5mr11275491pgp.259.1519740586386; Tue, 27 Feb 2018 06:09:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519740586; cv=none; d=google.com; s=arc-20160816; b=Kekpo8BGRRqARPB5NAY+8v3swFR4jAFqaymVfgaY85HrFNNRSEu9F/dodnXAquBX4N Fw9Jc/HPCydDwSVbXxAgOXekhDEkPc9/o1OUHJBuZX5/BEWRofd6TV1VNDqukcV9X0EV wmUdF3XIbZzputzqrdpAJYXuMm01T+Nqs7H0z6G+rjfrEfIXWhzxNGRNwR286OHNbAcJ Kqgk92sJq36+aogkbMfum0S5+t/SPFRpmIaC/dqlMl8GXyMiRm9S0JGVrozpMlwUhhJw PCDG9CAYj9g1m5EMhV6v7bHvlk6lgq/QxTVt5SJuEB4al+LwDigddHzBcUgj9JugzGrA WQug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=+NjkK8XLvLSmyF4tJWOO6EF+krqAOVVw0ra11IxP72M=; b=mMSr5WFv34skXsCLz0wXWauYBlutxvDRIkreT+lQOmH24RyqYvj6TEnwRInQbKjnaw vH2N68DbugQPHc7Lp//o8omx0je71XqL5Bfqi9rKl5JBBU3R+23IMhsT/WSZ99jjeSKU L8k+24zBRnVUTuIrgWEqriqswtvod8iwk+MbSd+EP9gGyaa0vJlla3gt3OVUb0XcF7P6 zMRDCgZ3I09QcBv5+xPloK54kVyTxEUZjKYZMsOoyV3MquPI99x1iSY2A4+UzrUDOQBC 5uy3oWq3YttllXXEf4ipi/uojUNkI5XonZ1zWmvbHF5Cf6siXQSEJ9FoWcRL5xp3jqA7 iIKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=S3HSwc98; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x87si7779128pff.17.2018.02.27.06.09.46; Tue, 27 Feb 2018 06:09:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=S3HSwc98; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753791AbeB0OJn (ORCPT + 6 others); Tue, 27 Feb 2018 09:09:43 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:53433 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753785AbeB0OJm (ORCPT ); Tue, 27 Feb 2018 09:09:42 -0500 Received: by mail-wm0-f68.google.com with SMTP id t74so24473724wme.3 for ; Tue, 27 Feb 2018 06:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=5P6rQr4UYrqvIjgnlkXSFF1Pc7pk/CuSRZQV+Xv0Mes=; b=S3HSwc981JyIevZgFhVg/8bIAPSVzAeCSo6eFkgEw7BMdGogKoyZXJO3wRc2lyCKpW jbT0OabqQlr2OyvEAhRWHPkhLHTGsedYLlPEHJRArjXJjr6+SwsM/xhjRO28ga+/tAHC Yy+n4T0b7IYqBYe1zQF8EHQ50SYjq6k41SB/E= 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=5P6rQr4UYrqvIjgnlkXSFF1Pc7pk/CuSRZQV+Xv0Mes=; b=qTKRnRMLYWRc19TAGLALxPOcqtHkGPfmJhG5FHKsTKTwXfc+T7SnzVskbvr8RwMpvE +vDtI4j7BerFkeI1xhZsEkLE6rThuLAOnzSVMaVfghTIakEpNjHZkxZU7znqQafQwy1I KE0CPBvTAQWibJfgIHCjL8IcDt38TTsRf2wDBnAxIvHgrIjp0CPjSbJj++FWS0jwArO7 kDNJwBEN1ZRji8cP+iAvmLGl+DSBSZsx/wGZImbni/pwzvEz/YM0kdCIOrIsw2T2afT3 XY5uY6D4Dl95m3EtVDUbTdUI9ISU/4nJT3ZfpxvIiqw3Cvp56BOw8UOGgzvjez/M51zL 4Jmw== X-Gm-Message-State: APf1xPAsjx3Hg/NI4LW0pM1DDuD1KlzmOjRkUkHalrBGl7h1d31EGUwJ 8Bjyl4NAYwbqyf/hzqfzkuccBA== X-Received: by 10.28.11.70 with SMTP id 67mr10419636wml.158.1519740580787; Tue, 27 Feb 2018 06:09:40 -0800 (PST) Received: from lmecxl0911.lme.st.com ([80.214.71.157]) by smtp.gmail.com with ESMTPSA id 59sm6514496wro.57.2018.02.27.06.09.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Feb 2018 06:09:40 -0800 (PST) From: Benjamin Gaignard X-Google-Original-From: Benjamin Gaignard To: gregkh@linuxfoundation.org, robh+dt@kernel.org, mark.rutland@arm.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Benjamin Gaignard Subject: [PATCH 0/3] STM32 Extended TrustZone Protection driver Date: Tue, 27 Feb 2018 15:09:23 +0100 Message-Id: <20180227140926.22996-1-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On early boot stages STM32MP1 platform is able to dedicate some hardware blocks to a secure OS running in TrustZone. We need to avoid using those hardware blocks on non-secure context (i.e. kernel) because read/write access will all be discarded. Extended TrustZone Protection driver register itself as listener of BUS_NOTIFY_BIND_DRIVER and check, given the device address, if the hardware block could be used in a Linux context. If not it returns NOTIFY_BAD to driver core to stop driver probing. NOTE: patches 2 and 3 should be applied only on git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next but until this patch: https://lkml.org/lkml/2018/2/26/386 find it way to mailine KBuild will complain about them. Benjamin Gaignard (3): driver core: check notifier_call_chain return value dt-bindings: stm32: Add bindings for Extended TrustZone Protection ARM: mach-stm32: Add Extended TrustZone Protection driver .../bindings/arm/stm32/st,stm32mp1-etzpc.txt | 13 ++ arch/arm/mach-stm32/Kconfig | 7 + arch/arm/mach-stm32/Makefile | 1 + arch/arm/mach-stm32/stm32-etzpc.c | 252 +++++++++++++++++++++ drivers/base/dd.c | 9 +- 5 files changed, 279 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/stm32/st,stm32mp1-etzpc.txt create mode 100644 arch/arm/mach-stm32/stm32-etzpc.c -- 2.15.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html