From patchwork Tue May 5 07:33:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 201104 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8900C47256 for ; Tue, 5 May 2020 07:33:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82EDF20663 for ; Tue, 5 May 2020 07:33:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=st.com header.i=@st.com header.b="EnZBydwF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726129AbgEEHdi (ORCPT ); Tue, 5 May 2020 03:33:38 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:25898 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725320AbgEEHdi (ORCPT ); Tue, 5 May 2020 03:33:38 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0457XAhh004115; Tue, 5 May 2020 09:33:25 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=0rDxJMTTj6STEhB4ZRJ2M8Lot9vO0d8RML+Y0Wg+4Fs=; b=EnZBydwFWdLSaXw0UjFA2QTDeJ3UbIogQFm9cnfED8s9xBPxr0emLyhc9it8a5Ke6f2l 1DbnnttiAylS1Jm/BzBTdF0ZLvYhMv1j/kQtI+DfUmpyAuPCRwU9EnQRMF0FbahsU2yF Jhk4sTOlKmr2DmEQ5MlQJ7ZF4C8eBmng9uQAjpmePbVp6QhI8RrIxSHuJLSd8Om4mJGc k+FRoWBYVm+Q9bsjdovfLG6ovZtgdfEJfFPqPGBtXUKl6MHgAo3SIk0xq6xqecBUynzU wZFDAzHWHcDXOTpdogT4bwWVhH6BN6b3I7SeULXJJ3Hxf74kO8gBEB/11FkMq4oyvIa1 pA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 30rxb1xgq8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 05 May 2020 09:33:25 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E54D710002A; Tue, 5 May 2020 09:33:24 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node3.st.com [10.75.127.9]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id D60162A4929; Tue, 5 May 2020 09:33:24 +0200 (CEST) Received: from localhost (10.75.127.50) by SFHDAG3NODE3.st.com (10.75.127.9) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Tue, 5 May 2020 09:33:24 +0200 From: Benjamin Gaignard To: , , , , , CC: , , , , Benjamin Gaignard Subject: [PATCH v3 0/5] STM32 ETZPC bus controller Date: Tue, 5 May 2020 09:33:03 +0200 Message-ID: <20200505073308.22914-1-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 MIME-Version: 1.0 X-Originating-IP: [10.75.127.50] X-ClientProxiedBy: SFHDAG3NODE2.st.com (10.75.127.8) To SFHDAG3NODE3.st.com (10.75.127.9) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-05-05_04:2020-05-04,2020-05-05 signatures=0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org STM32 Extended TrustZone Protection controller act like a firewall on the platform bus. Depending of its configuration devices could be accessible by the TrustZone, the co-processor or the non-secure world. ETZPC configuration could evolve at runtime for example to switch a device from non-secure world to co-processor. The series introduce 'firewall' helpers to handle the new devices-tree properties. These properties are not dedicated to ETZPC and will be reused for STM32 next generation of bus controller. version 3: - add description in firewall consumer bindings - add Linus reviewed-by tag version 2: - fix unit name into st,stm32-etzpc.yaml example and DT Benjamin Gaignard (5): dt-bindings: bus: Add firewall bindings bus: stm32: Introduce firewall controller helpers dt-bindings: bus: Add STM32 ETZPC firewall controller bus: stm32: Add stm32 ETZPC firewall bus controller ARM: dts: stm32: Use ETZPC firewall bus .../bindings/bus/stm32/firewall-consumer.yaml | 36 +++ .../bindings/bus/stm32/firewall-provider.yaml | 18 ++ .../bindings/bus/stm32/st,stm32-etzpc.yaml | 46 ++++ arch/arm/boot/dts/stm32mp151.dtsi | 7 +- drivers/bus/Kconfig | 2 + drivers/bus/Makefile | 2 + drivers/bus/stm32/Kconfig | 11 + drivers/bus/stm32/Makefile | 2 + drivers/bus/stm32/firewall.c | 266 +++++++++++++++++++++ drivers/bus/stm32/firewall.h | 75 ++++++ drivers/bus/stm32/stm32-etzpc.c | 160 +++++++++++++ include/dt-bindings/bus/stm32/stm32-etzpc.h | 90 +++++++ 12 files changed, 713 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/bus/stm32/firewall-consumer.yaml create mode 100644 Documentation/devicetree/bindings/bus/stm32/firewall-provider.yaml create mode 100644 Documentation/devicetree/bindings/bus/stm32/st,stm32-etzpc.yaml create mode 100644 drivers/bus/stm32/Kconfig create mode 100644 drivers/bus/stm32/Makefile create mode 100644 drivers/bus/stm32/firewall.c create mode 100644 drivers/bus/stm32/firewall.h create mode 100644 drivers/bus/stm32/stm32-etzpc.c create mode 100644 include/dt-bindings/bus/stm32/stm32-etzpc.h