From patchwork Thu Oct 19 02:48:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ming qian X-Patchwork-Id: 96015 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1qtJ5S-0026x7-U2; Thu, 19 Oct 2023 02:48:39 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232465AbjJSCsh (ORCPT + 1 other); Wed, 18 Oct 2023 22:48:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjJSCsf (ORCPT ); Wed, 18 Oct 2023 22:48:35 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2049.outbound.protection.outlook.com [40.107.15.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1671C138; Wed, 18 Oct 2023 19:48:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=npakqqRpS+dM5gAOuhsNxonZxMkG7UtPIP+3gGsg4cnep34vbpacROm8xHqt864jhNlqU/RKI3FKvVT11ptnIANCL8RFro15UFKyVZtmxrnuF6hA1FkGcskhAAcjXqfJUunbvlEIh1IRuNB/15GOQZBxvzeoL5Nw2GCXk9dk6pddcUKT0mf+Ifdxzv4xtGkRqnPLE9sQhuycxhDf5N5p0pSupp+j+DJruXT0sabY2nrF/7O/z9LNp7LKcv4Tq0zCRbwsdw5wvFlubhdKB5qjMDKbnIQMdQ0mMA72I0SI0JFqFAQKarnfmy8AnDWCAPt0EDC56VVLjUwNZDi3drI4Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sDkbFghCYRIxXLS77RafNyTXHs8bWVMebLyp4TESW+Y=; b=k0RgNyyfrDKL04ae8EV1RMZKzfjK+4wYPVLhNToyU08MQc7bOAen+M6KDpchpfHDZcTvhXV9sKyTmaTBWZ2mBuuuAWiZTPY62AyDOsbGg/Gp9fG3EIdeY5zflAX2uFQDwgbKgicaLCA92xw2TrWrtRxU3IgjfnKb44R2OZpFFK7LKFBeTvfaxCHP765oyvyr1J7xhXxwEkDC+SLs9iBX2oV4i0mKp2NOfCgZqay/w4VBKi8S24b7noajsSDfhKLKfFYGL7W4W+LP0tq13XkH7OSinOMUjO7/7Jn0Wrv21fzJz8dAWeHXWzjUK8J87FKCbdajeTSUe0qJ+3BW6i1oRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sDkbFghCYRIxXLS77RafNyTXHs8bWVMebLyp4TESW+Y=; b=SqVn62fhKJ4z4x39dX2nKENY7kpx7iSl4fx7BCRqTeM+rRghsDARknzO+SLkyTLolQAr0hjzNdO6K2k/MuquP4pXiFWUR/SM+TePtNiUr9SGpjcESyyQ0g7meaZvCX8OicOxTUcZNh7uw+NiHy+m+N3Xsh1vpnjZsDtAglrM/zA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) by AS5PR04MB10000.eurprd04.prod.outlook.com (2603:10a6:20b:682::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.46; Thu, 19 Oct 2023 02:48:27 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::6e53:39fc:f010:30d5]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::6e53:39fc:f010:30d5%4]) with mapi id 15.20.6907.021; Thu, 19 Oct 2023 02:48:27 +0000 From: "Ming Qian (OSS)" To: mirela.rabulea@oss.nxp.com, robh+dt@kernel.org, shawnguo@kernel.org Cc: krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, mchehab@kernel.org, hverkuil-cisco@xs4all.nl, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, xiahong.bao@nxp.com, eagle.zhou@nxp.com, tao.jiang_2@nxp.com, ming.qian@nxp.com, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 1/3] dt-bindings: media: imx-jpeg: Assign slot for imx jpeg encoder/decoder Date: Thu, 19 Oct 2023 10:48:00 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR01CA0165.apcprd01.prod.exchangelabs.com (2603:1096:4:28::21) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|AS5PR04MB10000:EE_ X-MS-Office365-Filtering-Correlation-Id: 40c46a79-31cc-4fa5-1503-08dbd04ddee3 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oxaAzVpTSeyE0psmEMAs2O48BThD/m3vdf13CJwZxK9PlvFuZtwxDOkx8ZmvKQMavljgka7DhIblJAmiLrURz51UTKZxvICzLh4kEvJi7cIQx59ngxH+IvWZ1Hg9ztCQCPaaLwi3gncMwzVNqP4U6Mvnj1HpQQxWFrkuZLeGWRoAONZNHnk2LLxOCGrzHoMpR+j3RmONW9J9rJ6KDHTxZcY8OlzZFD2HQh/yKhqyeXwz5YY4KyQuKCXIgCpG9jik2BTcFnv4AJ0vyy/7J8Ivm5eLM1wZLGasgpgWh5g7srOkKD9vdCqT40iBFukfox2j/6Rhj/1xDVA1rk5tl4o5kErqv3L3CGxbQwoHSNDNVEn+QNCL0Y2/1SvnRT6dkA8iHi+A8pyDkAXFryVrk2L3IhE89imGzVbMtFDLChAa1yTrzt8uGAirvSk/xFdg0PtT4DFaiHfs2voxRoH+WFImvTyjl6KDn/4Pa2yiKGhOqQp1RD5JveHBpcUwWWB9TpdIIqNrfxNvDThD/rkB4Zq+teEVIjHNM12lCfccxF6DzmYLjFL6uYhS5Oa1pnForRxsgHEEgInvHtUjft1Qko5i66PyYYJT8ErV6g2dJTnl1nVaiGgjfRXP1AD3SlexVgD/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB6341.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(39860400002)(376002)(136003)(366004)(396003)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(38350700005)(6512007)(86362001)(36756003)(9686003)(8676002)(66476007)(66946007)(38100700002)(316002)(83380400001)(52116002)(6506007)(6666004)(66556008)(41300700001)(6486002)(478600001)(8936002)(7416002)(5660300002)(4326008)(2906002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Qnpto59hkfTOxNbb09MM+GDmjVzJgyed5YfqHVmlzs1STsOcBK4VWpKWFnbeTjBdA1xEw4cp5D/VMkzDxuSQGKpIITI2lWptOoX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UuZUeUXYN0FJzFzDcxDDchq7wV2i4fgMuYLLWfPNKTGVJ1IhjrAJEHWrpRub6HYHO1MykKmj+z+Y9sidDVmQe8kTQF2Diw72AYF54iqteYuqcHUSIl3KBV2Lr9qKNlW0IMJakLMh0cFsjqoNbl8UqvJVaPGroa5Hj7ymU5bpMkvnUSMRZaCLwQYAAsRzvA5ysKeeuDFq5J0SIyWRhWwyZAy8AYgbcEkxyoxJHW+M6cHN/93sdMO7Kyk1nsNRVmod0Zam4MbRQCdCvhXNDP6RC9cYp5AcR+UadZyNmXD+4chaAEqTSUwtCrtfnv92m3mkoBOq6eI4V6bM2u50b8mcydwLMnLBnV/mNd76gCLWSk5YgF9DRKTt4aviHo+I+3KkzcadEFoATRUSsviMfACkrNXx4tlYreH/JfnaTGK X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40c46a79-31cc-4fa5-1503-08dbd04ddee3 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2023 02:48:27.6523 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Sw00ZjvIflnSull+7kd7fN2GOrk1LEyrou2RL54OsJ7gaLWLOzgZ04aME47bUwhPdEEks3HnFL2PDLJxRcxl1w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB10000 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -4.7 (----) X-LSpam-Report: No, score=-4.7 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_MED=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no From: Ming Qian This IP includes a jpeg wrapper and a jpeg engine, the wrapper is working on descriptor based manner. It supports up to 4 slots, each slot can have its own chained descriptors. Host won't configure the engine directly, but fill some descriptors to encode or decode one jpeg picture. Then configure the descriptors to certain slot register. The jpeg wrapper will schedule between different slots. When some slot is finished, the slot interrupt will be triggered. The purpose of slot is that engine can be shared across multiple VMS and os. Currently, power domains and interrupts are enabled for all 4 slots, but only one slot is used. There is no benefit in using more that one slot from within the same OS, as the slots are scheduled in round-robin manner and not executed in parallel. Use the property "nxp,slot" to assign a single slot, and just expose the parts of the h/w for the assigned slot. For example, only put slot 1's power-domains entry in the DT when slot 1 is assigned. If not specified, 0 is used by default. Signed-off-by: Ming Qian --- v5 - improve commit message - improve property description v4 - improve commit message - drop line making the property required, to avoid ABI break v3 - add vender prefix, change property slot to nxp,slot - add type for property slot v2 - add a new property in bindings document .../bindings/media/nxp,imx8-jpeg.yaml | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/Documentation/devicetree/bindings/media/nxp,imx8-jpeg.yaml b/Documentation/devicetree/bindings/media/nxp,imx8-jpeg.yaml index 3d9d1db37040..0961856bdcab 100644 --- a/Documentation/devicetree/bindings/media/nxp,imx8-jpeg.yaml +++ b/Documentation/devicetree/bindings/media/nxp,imx8-jpeg.yaml @@ -32,19 +32,27 @@ properties: maxItems: 1 interrupts: - description: | - There are 4 slots available in the IP, which the driver may use - If a certain slot is used, it should have an associated interrupt - The interrupt with index i is assumed to be for slot i - minItems: 1 # At least one slot is needed by the driver - maxItems: 4 # The IP has 4 slots available for use + description: + Interrupt number for slot + maxItems: 1 power-domains: description: List of phandle and PM domain specifier as documented in Documentation/devicetree/bindings/power/power_domain.txt - minItems: 2 # Wrapper and 1 slot - maxItems: 5 # Wrapper and 4 slots + minItems: 1 # Mixed power domain + maxItems: 2 # Wrapper and 1 slot + + nxp,slot: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Integer number of slot index used. This IP includes a jpeg wrapper, the + wrapper is working on descriptor based manner. It supports up to 4 slots, + each slot can have its own chained descriptors. The purpose is to share + the jpeg engine across multiple VMS and os. We use this property to + assign a single slot. If not specified, 0 is used by default. + minimum: 0 + maximum: 3 required: - compatible @@ -62,28 +70,18 @@ examples: jpegdec: jpegdec@58400000 { compatible = "nxp,imx8qxp-jpgdec"; reg = <0x58400000 0x00050000 >; - interrupts = , - , - , - ; + interrupts = ; power-domains = <&pd IMX_SC_R_MJPEG_DEC_MP>, - <&pd IMX_SC_R_MJPEG_DEC_S0>, - <&pd IMX_SC_R_MJPEG_DEC_S1>, - <&pd IMX_SC_R_MJPEG_DEC_S2>, - <&pd IMX_SC_R_MJPEG_DEC_S3>; + <&pd IMX_SC_R_MJPEG_DEC_S0>; + nxp,slot = <0>; }; jpegenc: jpegenc@58450000 { compatible = "nxp,imx8qm-jpgenc", "nxp,imx8qxp-jpgenc"; reg = <0x58450000 0x00050000 >; - interrupts = , - , - , - ; + interrupts = ; power-domains = <&pd IMX_SC_R_MJPEG_ENC_MP>, - <&pd IMX_SC_R_MJPEG_ENC_S0>, - <&pd IMX_SC_R_MJPEG_ENC_S1>, - <&pd IMX_SC_R_MJPEG_ENC_S2>, - <&pd IMX_SC_R_MJPEG_ENC_S3>; + <&pd IMX_SC_R_MJPEG_ENC_S0>; + nxp,slot = <0>; }; ...