From patchwork Wed Dec 26 07:53:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pi-Hsun Shih X-Patchwork-Id: 10742857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9BF086C5 for ; Wed, 26 Dec 2018 07:54:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D0DC22A2A for ; Wed, 26 Dec 2018 07:54:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AC2D2621E; Wed, 26 Dec 2018 07:54:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EAAC22A2A for ; Wed, 26 Dec 2018 07:54:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726080AbeLZHxw (ORCPT ); Wed, 26 Dec 2018 02:53:52 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:37317 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726068AbeLZHxv (ORCPT ); Wed, 26 Dec 2018 02:53:51 -0500 Received: by mail-pl1-f194.google.com with SMTP id b5so7279627plr.4 for ; Tue, 25 Dec 2018 23:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=P6KcVI3cNP/m+Pzq7VPTxDfr/tNVCCBYar/ZL8sY5nY=; b=BHhxaS6ToMPmSSUplC5HwpdloMho11QilVm013+jJP2dh7iJGFRyDfG/L++5HApmdK AOueomkkX2Vrgjbst6+biH3dVyWE1HcL0bJeR0ac4YKqnswidbLFOOIohXy8vK/Sq3f5 IElNA8RK87/SKz8wCiB6xCuVyfJtKQOHFUVSA= 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:mime-version :content-transfer-encoding; bh=P6KcVI3cNP/m+Pzq7VPTxDfr/tNVCCBYar/ZL8sY5nY=; b=Sxh47ywj5+DVAmtGf7fSysJPWo7y2t6H+3SF91XDwU5ToW26afeBb2syKc0xmBSuWF ysWzw1j0duorAHRUoBCCJaVmn2Lz2elR9EMDR/nCpcXMqWrNZiQ6A0yg4WEQMArPsatf DwKKh21xuPbIrxBY7rzDgrtxwLjul/hQo3uTPRvRkfgpWaKCQ+8CRNwiXKawmlYleBR3 /Hfjmyt89aNHYC9+SkVyciJ8jy90G4uUc+Dw6o6fQTO/+AKp8QNtQSx3Rc4IA0egkCeQ g9C8XAIIJFve9HzHq7AgBKBbx138bmnwFpJN2RqTkDWSqOn3GvUbFY0XIqGme9+b0sNn fstw== X-Gm-Message-State: AJcUukcCRzMkfJ+rmMWlQBVF7uZRFMQFL094G72dGX6GvbURnVn0MpbV CwdqqtX0wPx/9bEcsYBBQ69J7Q== X-Google-Smtp-Source: ALg8bN54QEPfkuxduBY8t3+Ak8DMbpajQxNGG951kjbvOLaqYyatrf2rpWAr5huxlCP+e4gCbZKlig== X-Received: by 2002:a17:902:a70b:: with SMTP id w11mr18770971plq.84.1545810830966; Tue, 25 Dec 2018 23:53:50 -0800 (PST) Received: from pihsun-z840.tpe.corp.google.com ([2401:fa00:1:10:7889:7a43:f899:134c]) by smtp.googlemail.com with ESMTPSA id 84sm107392395pfa.115.2018.12.25.23.53.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Dec 2018 23:53:50 -0800 (PST) From: Pi-Hsun Shih Cc: Pi-Hsun Shih , Nicolas Boichat , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), Eddie Huang , Erin Lo , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-kernel@vger.kernel.org (open list), linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-remoteproc@vger.kernel.org (open list:REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM) Subject: [RFC,0/5] Add support for mt8183 SCP. Date: Wed, 26 Dec 2018 15:53:08 +0800 Message-Id: <20181226075330.82462-1-pihsun@chromium.org> X-Mailer: git-send-email 2.20.1.415.g653613c723-goog MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for controlling and communicating with mt8183's system control processor (SCP), using the remoteproc & rpmsg framework. And also add a cros_ec driver for CrOS EC host command over rpmsg. The overall structure of the series is: * remoteproc/mtk_scp.c: Control the start / stop of SCP (Patch 2). * remoteproc/mtk_scp_ipi.c: Communicates to SCP using inter-processor interrupt (IPI) and shared memory (Patch 2, 3). * rpmsg/mtk_rpmsg.c: Wrapper to wrap the IPI communication into a rpmsg device. Supports name service for SCP firmware to announce channels (Patch 4). * platform/chrome/cros_ec_rpmsg.c: Communicates with the SCP over the rpmsg framework (like what platform/chrome/cros_ec_{i2c,spi}.c does) (Patch 5). Since I'm not familiar with the remoteproc / rpmsg framework, and there are not much other custom rpmsg driver for reference, would like some review / comments on the overall structure of the driver. Erin Lo (2): dt-bindings: Add a binding for Mediatek SCP remoteproc/mediatek: add SCP support for mt8183 Pi-Hsun Shih (3): remoteproc: move IPI interface into separate file. rpmsg: add rpmsg support for mt8183 SCP. mfd: cros_ec: add EC host command support using rpmsg. .../bindings/remoteproc/mtk,scp.txt | 10 + drivers/mfd/cros_ec_dev.c | 10 + drivers/platform/chrome/Kconfig | 8 + drivers/platform/chrome/Makefile | 1 + drivers/platform/chrome/cros_ec_rpmsg.c | 164 +++++++ drivers/remoteproc/Kconfig | 9 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/mtk_common.h | 76 +++ drivers/remoteproc/mtk_scp.c | 441 ++++++++++++++++++ drivers/remoteproc/mtk_scp_ipi.c | 109 +++++ drivers/rpmsg/Kconfig | 5 + drivers/rpmsg/Makefile | 1 + drivers/rpmsg/mtk_rpmsg.c | 341 ++++++++++++++ include/linux/mfd/cros_ec.h | 1 + include/linux/mfd/cros_ec_commands.h | 2 + include/linux/platform_data/mtk_scp.h | 143 ++++++ include/linux/rpmsg/mtk_rpmsg.h | 34 ++ 17 files changed, 1356 insertions(+) create mode 100644 Documentation/devicetree/bindings/remoteproc/mtk,scp.txt create mode 100644 drivers/platform/chrome/cros_ec_rpmsg.c create mode 100644 drivers/remoteproc/mtk_common.h create mode 100644 drivers/remoteproc/mtk_scp.c create mode 100644 drivers/remoteproc/mtk_scp_ipi.c create mode 100644 drivers/rpmsg/mtk_rpmsg.c create mode 100644 include/linux/platform_data/mtk_scp.h create mode 100644 include/linux/rpmsg/mtk_rpmsg.h