Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3869950ybi; Mon, 3 Jun 2019 01:29:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6uNhLRlxlgdrrYurmFlK2Rgs2jvsjf7Jvx1vu9C/k1QScW4J34BepVAc/Bm/kX6MHO8zz X-Received: by 2002:a17:902:b691:: with SMTP id c17mr6030802pls.107.1559550594497; Mon, 03 Jun 2019 01:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559550594; cv=none; d=google.com; s=arc-20160816; b=soFsMDqze4CGky8AlNrSAIOp83CVLvX7eeprrOWbTJUq4/iut8/upQobfhIhAUWpZR kDJ7Ehq5PfMGaeODxzrQdSV7ks71OdnxBeYTKObulHXSUmOJVfxk5CWIa6Cn6K5IYvYH xa13GOFEa/hvyM9u5TlGnQXQus4QitsSWB+2qcL0HWYEpOkP3JOsdebzvOR8igdqn35w G6wI160AdzkT09J+f71DJXz8qyG9iWjdpHIAV+crT5RuhcJl3+ySrRNMKg9H93bOE1Dt cIWpUdV0aXghAu9ATmzp0Y5pZXfmIBYPlZvo7kko82IcFGUtVCmKe52t6JlLKVzcuz3f EN9w== 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; bh=BhoDO5m4YUUTUpZPOvnKErxJbh1cTWLthhoUYIIDeTA=; b=ORN9NEIZJih8e/LWkvqQH28t6KjuNGG2X7HXuVTbheh3Up2v1UsKD+SkSmY5F1nVpT C18N94dFC3TnALipZbi7sQIwzyzKUTeazIJ03emBy/SIhUL+HZFriCOZKNl1FTyU6qRg 31MjSEq800g/I1VQhc0MeMz5gHMbHkqk19Li+iIN6vE+BPRcSkLwLbgrQ3eX15LnKH+n 00OlpI5guJ1VbVPzu5z/76UhBhepuNkCUlNSr3bKq6n0fs6PCYKTMsiLayZ2b+NlEiPU Jg2pJ1UCtlssiBMoOoPBA3TJxe0bkK/EveWgBfs0RGw7m+4qR+z6V6VOf1w/mZTy+yDw +OwA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u126si13931023pgu.117.2019.06.03.01.29.37; Mon, 03 Jun 2019 01:29:54 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727701AbfFCI2a (ORCPT + 99 others); Mon, 3 Jun 2019 04:28:30 -0400 Received: from inva020.nxp.com ([92.121.34.13]:50576 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfFCI2a (ORCPT ); Mon, 3 Jun 2019 04:28:30 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 538DE1A03AD; Mon, 3 Jun 2019 10:28:27 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 9E7BD1A03A5; Mon, 3 Jun 2019 10:28:20 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 70820402D5; Mon, 3 Jun 2019 16:28:12 +0800 (SGT) From: peng.fan@nxp.com To: robh+dt@kernel.org, mark.rutland@arm.com, jassisinghbrar@gmail.com, sudeep.holla@arm.com, f.fainelli@gmail.com Cc: kernel@pengutronix.de, linux-imx@nxp.com, shawnguo@kernel.org, festevam@gmail.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, andre.przywara@arm.com, van.freenix@gmail.com, Peng Fan Subject: [PATCH V2 0/2] mailbox: arm: introduce smc triggered mailbox Date: Mon, 3 Jun 2019 16:30:03 +0800 Message-Id: <20190603083005.4304-1-peng.fan@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Fan This is a modified version from Andre Przywara's patch series https://lore.kernel.org/patchwork/cover/812997/. The modification are mostly: Introduce arm,num-chans Introduce arm_smccc_mbox_cmd txdone_poll and txdone_irq are both set to false arm,func-ids are kept, but as an optional property. Rewords SCPI to SCMI, because I am trying SCMI over SMC, not SCPI. Introduce interrupts notification. [1] is a draft implementation of i.MX8MM SCMI ATF implementation that use smc as mailbox, power/clk is included, but only part of clk has been implemented to work with hardware, power domain only supports get name for now. The traditional Linux mailbox mechanism uses some kind of dedicated hardware IP to signal a condition to some other processing unit, typically a dedicated management processor. This mailbox feature is used for instance by the SCMI protocol to signal a request for some action to be taken by the management processor. However some SoCs does not have a dedicated management core to provide those services. In order to service TEE and to avoid linux shutdown power and clock that used by TEE, need let firmware to handle power and clock, the firmware here is ARM Trusted Firmware that could also run SCMI service. The existing SCMI implementation uses a rather flexible shared memory region to communicate commands and their parameters, it still requires a mailbox to actually trigger the action. This patch series provides a Linux mailbox compatible service which uses smc calls to invoke firmware code, for instance taking care of SCMI requests. The actual requests are still communicated using the standard SCMI way of shared memory regions, but a dedicated mailbox hardware IP can be replaced via this new driver. This simple driver uses the architected SMC calling convention to trigger firmware services, also allows for using "HVC" calls to call into hypervisors or firmware layers running in the EL2 exception level. Patch 1 contains the device tree binding documentation, patch 2 introduces the actual mailbox driver. Please note that this driver just provides a generic mailbox mechanism, It could support synchronous TX/RX, or synchronous TX with asynchronous RX. And while providing SCMI services was the reason for this exercise, this driver is in no way bound to this use case, but can be used generically where the OS wants to signal a mailbox condition to firmware or a hypervisor. Also the driver is in no way meant to replace any existing firmware interface, but actually to complement existing interfaces. [1] https://github.com/MrVan/arm-trusted-firmware/tree/scmi Peng Fan (2): DT: mailbox: add binding doc for the ARM SMC mailbox mailbox: introduce ARM SMC based mailbox .../devicetree/bindings/mailbox/arm-smc.txt | 101 +++++++++++ drivers/mailbox/Kconfig | 7 + drivers/mailbox/Makefile | 2 + drivers/mailbox/arm-smc-mailbox.c | 190 +++++++++++++++++++++ include/linux/mailbox/arm-smc-mailbox.h | 10 ++ 5 files changed, 310 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/arm-smc.txt create mode 100644 drivers/mailbox/arm-smc-mailbox.c create mode 100644 include/linux/mailbox/arm-smc-mailbox.h -- 2.16.4