From patchwork Thu Apr 23 13:19:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 201605 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 92662C55186 for ; Thu, 23 Apr 2020 13:19:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B8442084D for ; Thu, 23 Apr 2020 13:19:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=st.com header.i=@st.com header.b="OcnclZ5z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727888AbgDWNTh (ORCPT ); Thu, 23 Apr 2020 09:19:37 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:58500 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727125AbgDWNTh (ORCPT ); Thu, 23 Apr 2020 09:19:37 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03NDCX7d009209; Thu, 23 Apr 2020 15:19:17 +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=bWGyr2OPFEYipJzOCA9+YhEVp9WsPMm5ikLMe52JeBI=; b=OcnclZ5z23GMDRx2jxDE77tYL+3KyB7ULU6zbJVk+ODxzl2RIpuYZxLSTwfQW72mP+Zs fGEnZ3gMmU6LNVLbfDdKbXaPnULH5gFLYzqFLoPACdGSkSmvEEkJ5bsisogv1B3lyO9B V9XGiCbX5M67WC4RLphKcy0RIcf3fUqzBTugugm4h4U2wDF6afHcrUixz0sauP4HjVS2 Wast7SAT3yknAb338UrRaSck5keScWktkU7SfSsEi6xOocTDXuTNQisXuLplHIO+bgAD fqcTNJqFm899pTwkhYfFmDstax/ojn5j0dBmYc/aduLwoY9eGxnAa7toD/PAVcigc4Zo ng== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 30fregw0k5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Apr 2020 15:19:17 +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 968E010002A; Thu, 23 Apr 2020 15:19:16 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node3.st.com [10.75.127.9]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 86B4020758D; Thu, 23 Apr 2020 15:19:16 +0200 (CEST) Received: from localhost (10.75.127.46) by SFHDAG3NODE3.st.com (10.75.127.9) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 23 Apr 2020 15:19:15 +0200 From: Benjamin Gaignard To: , , , , , CC: , , , , Benjamin Gaignard Subject: [PATCH v2 0/5] STM32 ETZPC bus controller Date: Thu, 23 Apr 2020 15:19:08 +0200 Message-ID: <20200423131913.30786-1-benjamin.gaignard@st.com> X-Mailer: git-send-email 2.15.0 MIME-Version: 1.0 X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG3NODE1.st.com (10.75.127.7) 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-04-23_10:2020-04-23,2020-04-23 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 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 | 25 ++ .../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, 702 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