From patchwork Mon Sep 18 19:21:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jason-JH.Lin" X-Patchwork-Id: 724224 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6081727ECE for ; Mon, 18 Sep 2023 19:22:25 +0000 (UTC) Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01D4611F; Mon, 18 Sep 2023 12:22:19 -0700 (PDT) X-UUID: a8b86e8c565811ee8051498923ad61e6-20230919 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=/UOv9xZiXKefNR6q5rMt8+g3tJ4eyURnjoxNDdrYYPY=; b=qclhOeUWvzH1H0Egt7GLgJAyJrbI9L848aDHO5gSdrT6YkL2RHFiF9pRR98ni5ye6sU5yyKNjX93lEOEPLwpEIowgDdc6KUZ4s5eeT/IUZjfn1lpGrt2sCZThzNY6HACvJqptDj3VWfe1PYD3A2gFNU3XVkqdu/PciIUorn+uCg=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.31, REQID:21fafd34-8548-47c5-9548-315a8f4112a1, IP:0, U RL:0,TC:0,Content:100,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:100 X-CID-META: VersionHash:0ad78a4, CLOUDID:00dafabe-14cc-44ca-b657-2d2783296e72, B ulkID:nil,BulkQuantity:0,Recheck:0,SF:801|102,TC:nil,Content:3,EDM:-3,IP:n il,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR :NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: a8b86e8c565811ee8051498923ad61e6-20230919 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1727443107; Tue, 19 Sep 2023 03:22:08 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 19 Sep 2023 03:22:06 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 19 Sep 2023 03:22:06 +0800 From: Jason-JH.Lin To: Jassi Brar , Krzysztof Kozlowski , Rob Herring , Matthias Brugger , Chun-Kuang Hu , AngeloGioacchino Del Regno CC: Conor Dooley , Jason-ch Chen , Johnson Wang , "Elvis Wang" , "Jason-JH . Lin" , Singo Chang , Nancy Lin , Shawn Sung , , , , , , Subject: [PATCH 00/15] Add CMDQ secure driver for SVP Date: Tue, 19 Sep 2023 03:21:49 +0800 Message-ID: <20230918192204.32263-1-jason-jh.lin@mediatek.com> X-Mailer: git-send-email 2.18.0 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--1.467400-8.000000 X-TMASE-MatchedRID: 7eVHqPQV5C/JmaR8yBHGWNRZ1mKTfKthE21NSmBqEKfOxDyJFXIPjjFa TRf5dTetwavfQ6gcAlY7b3Js3F6vVGymsXpN1zOArDFtme53Kvsuhg66Itb65XyKcwQTdriqZSg PkksZfMCRWd5j2pelskrNzRlf/eAmxHJTZUnf9cgD2WXLXdz+AX9oOiiWbcZdRi9INZ1ZpGEwrA JnuG4aIS/rjK1CMnpugDLqnrRlXrZ8nn9tnqel2MZW5ai5WKlyMMz1R7/AueTvlEkaSw9lGL93v k9lpGptRcLjcbUyXX7JxRwU0I1U81K2ZEtDP2FLo548hMsDjb15pPWcZ/qZbFb8T69FNrV2jofs MjQaxVwyYjbiqIQ3CsykhtyXcigD6rVdgBjDT2oh1j2M6LiVMg== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--1.467400-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 8B037BF6E71F03E6BA839CFECE3F62CBC7C30FEDB63D7993BBFEE9AEF3E9DB932000:8 X-MTK: N X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,RDNS_NONE, SPF_HELO_PASS,T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net For the Secure Video Path (SVP) feature, inculding the memory stored secure video content, the registers of display HW pipeline and the HW configure operations are required to execute in the secure world. So using a CMDQ secure driver to make all display HW registers configuration secure DRAM access permision settings execute by GCE secure thread in the secure world. We are landing this feature on mt8188 and mt8195 currently. Jason-JH.Lin (15): dt-bindings: mailbox: Add property for CMDQ secure driver dt-bindings: gce: mt8195: Add CMDQ_SYNC_TOKEN_SECURE_THR_EOF event id soc: mailbox: Add SPR definition for GCE soc: mailbox: Add cmdq_pkt_logic_command to support math operation mailbox: mediatek: Add cmdq_pkt_write_s_reg_value to CMDQ driver mailbox: mediatek: Add cmdq_mbox_stop to disable GCE thread mailbox: mediatek: Add loop pkt flag and irq handling for loop command soc: mediatek: Add cmdq_pkt_finalize_loop to CMDQ driver mailbox: mediatek: Add secure CMDQ driver support for CMDQ driver mailbox: mediatek: Add CMDQ secure mailbox driver soc: mediatek: Add cmdq_insert_backup_cookie before EOC for secure pkt mailbox: mediatek: Add CMDQ driver support for mt8188 mailbox: mediatek: Add mt8188 support for CMDQ secure driver mailbox: mediatek: Add mt8195 support for CMDQ secure driver arm64: dts: mediatek: mt8195: Add CMDQ secure driver support for gce0 .../mailbox/mediatek,gce-mailbox.yaml | 30 +- arch/arm64/boot/dts/mediatek/mt8195.dtsi | 2 + drivers/mailbox/Makefile | 2 +- drivers/mailbox/mtk-cmdq-mailbox.c | 67 +- drivers/mailbox/mtk-cmdq-sec-mailbox.c | 1103 +++++++++++++++++ drivers/mailbox/mtk-cmdq-sec-tee.c | 202 +++ drivers/soc/mediatek/mtk-cmdq-helper.c | 81 ++ include/dt-bindings/gce/mt8195-gce.h | 6 + include/linux/mailbox/mtk-cmdq-mailbox.h | 15 + .../linux/mailbox/mtk-cmdq-sec-iwc-common.h | 293 +++++ include/linux/mailbox/mtk-cmdq-sec-mailbox.h | 83 ++ include/linux/mailbox/mtk-cmdq-sec-tee.h | 31 + include/linux/soc/mediatek/mtk-cmdq.h | 65 + 13 files changed, 1971 insertions(+), 9 deletions(-) create mode 100644 drivers/mailbox/mtk-cmdq-sec-mailbox.c create mode 100644 drivers/mailbox/mtk-cmdq-sec-tee.c create mode 100644 include/linux/mailbox/mtk-cmdq-sec-iwc-common.h create mode 100644 include/linux/mailbox/mtk-cmdq-sec-mailbox.h create mode 100644 include/linux/mailbox/mtk-cmdq-sec-tee.h