Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp731346ybh; Sun, 12 Jul 2020 22:38:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz29+Ia7ad4TF5YADyC4rPUf8VzYA4mvaBi9TTxAR/6XMlMxI4o6VXucd+9o2OCRaEMyc04 X-Received: by 2002:a17:906:ca57:: with SMTP id jx23mr69015974ejb.256.1594618683998; Sun, 12 Jul 2020 22:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594618683; cv=none; d=google.com; s=arc-20160816; b=cYHurl8zr8axyxFrXaZrb3+raUYPrHANL148B6eO7lfaWnRNUmnMf3L0s9o+N8nWgf NDmxB+rF0bqNwiDB58zAKqVQfGrWpVVMsTqXI7YcZz6Wqu1WsoqCtp729vhRSuJnkx1s EvHCrugPdGLW2N1TlB57+NC7x1Z0mrqQJKQvOLayeaF9xjjYm3RQAlxz8rhbYwbjbSQn ntlpRe023UUao3KvGVXv49NXAjY/MHnJqbTLZYh8WyatikGwLd1AdiwW4Hxf4i5EO1JE 8oRXbBgkSPeptnF5cqYcN6rta1MegC8SF4wo7SykNk578w8srXN2gLSug7XJrO1L9bPw SXFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JZ9NBtGhK+C5WPxWTTuXRE71ybFquUFtwgSFUSFj0PQ=; b=cwzB2PMgVn5W8tZLqR2u9v4dnBxDnCTz5G57TuN9x7pGVAg1WutOW14h2N+pzeTtt1 ku753O63ChVheHxyifnwfgI/kaJAPMJLkMuxnb3WWovY50RryjF6O2ETcfVPhkEARUsA khlCIpy2unbIVggm8IX2oGbi3Fcv5ywGUpJDWuhAFEVFNYLI7I1Ow+HC13k7dWEVHHfL NpCe95mi1nCjEdezVipNFB1/VgdcrLpErYoOd8flvJlLDbyWhgYBpiLlOfoRCDzdqVYd YuDSS5aXZqlojZJndrm2YYYfWtmEbvGHVP1ButYkEuYYGWtIZuEp/nWBDPtZLafOipEw kVSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=I5mH74j0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci27si8821316ejc.199.2020.07.12.22.37.32; Sun, 12 Jul 2020 22:38:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=I5mH74j0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728118AbgGMFhX (ORCPT + 99 others); Mon, 13 Jul 2020 01:37:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbgGMFhW (ORCPT ); Mon, 13 Jul 2020 01:37:22 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EFF1C08C5DB for ; Sun, 12 Jul 2020 22:37:22 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id h28so11662340edz.0 for ; Sun, 12 Jul 2020 22:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JZ9NBtGhK+C5WPxWTTuXRE71ybFquUFtwgSFUSFj0PQ=; b=I5mH74j0x33+O0sPgotD8Ov+x9JEj3hMbYPLIByQegEOBjPBM32K858i9rvObt+Sh/ ocvxgOpfDHSlT2f0SKViMGJgJmwBjhMeEx2X7/DyjvXhGxiQnsOogzSeGX8zdJiObqsC QjQN1y7TIoO0kt9LD+VH9awYEsgIzvu62leLI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JZ9NBtGhK+C5WPxWTTuXRE71ybFquUFtwgSFUSFj0PQ=; b=OeBjZ09Mimf0XofXSRoJ7Qhz4CzNO21KBhtSQ38TmlVQRmIub0SF64FPTRwvv3W8PH rgk56crS2P8VLIpgViy9bmsQbX0346fif6ijHRhpFTVHshymfB0tfaNSNcLUJLcr2W/9 ZlPQJs/ts1lWCQV/ax+8SqW3hZEhEsLKmlFQkWT2iD28iRoltQfdrKfFqqO7uuqqA6WD Zi36mt0/b1T5ZZUrxX0CMvOBhjQLf9JK/bltVK6jW+d8Bbk7pwr4hzTo6dcOao1BvRKN 3BrP/BAI2cC+HtPbElPUS2GECdPXy018WMQ0GVt/+1arO3zbwLJkhVazhgommNSqa4Or v0DA== X-Gm-Message-State: AOAM532FKV4jbprMI/uFRdzqwdxRMwf0CbDPGNyJYg9e1G7IF3wMmK34 W8AmwuENzVaf2J89w1+ZjgOd3j7bGZWVgJ2OQUAqWg== X-Received: by 2002:a50:d908:: with SMTP id t8mr35579891edj.373.1594618640938; Sun, 12 Jul 2020 22:37:20 -0700 (PDT) MIME-Version: 1.0 References: <20200711064846.16007-1-yong.wu@mediatek.com> <20200711064846.16007-5-yong.wu@mediatek.com> In-Reply-To: <20200711064846.16007-5-yong.wu@mediatek.com> From: Pi-Hsun Shih Date: Mon, 13 Jul 2020 13:36:45 +0800 Message-ID: Subject: Re: [PATCH 04/21] dt-binding: mediatek: Add binding for mt8192 IOMMU and SMI To: Yong Wu Cc: Joerg Roedel , Matthias Brugger , Rob Herring , Robin Murphy , Will Deacon , Evan Green , Tomasz Figa , "moderated list:ARM/Mediatek SoC support" , srv_heupstream@mediatek.com, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list , "moderated list:ARM/Mediatek SoC support" , iommu@lists.linux-foundation.org, =?UTF-8?B?WW91bGluIFBlaSAo6KO05Y+L5p6XKQ==?= , Nicolas Boichat , anan.sun@mediatek.com, cui.zhang@mediatek.com, chao.hao@mediatek.com, ming-fan.chen@mediatek.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 11, 2020 at 2:50 PM Yong Wu wrote: > > This patch adds decriptions for mt8192 IOMMU and SMI. > > mt8192 also is MTK IOMMU gen2 which uses ARM Short-Descriptor translation > table format. The M4U-SMI HW diagram is as below: > > EMI > | > M4U > | > ------------ > SMI Common > ------------ > | > +-------+------+------+----------------------+-------+ > | | | | ...... | | > | | | | | | > larb0 larb1 larb2 larb4 ...... larb19 larb20 > disp0 disp1 mdp vdec IPE IPE > > All the connections are HW fixed, SW can NOT adjust it. > > mt8192 M4U support 0~16GB iova range. we preassign different engines > into different iova ranges: > > domain-id module iova-range larbs > 0 disp 0 ~ 4G larb0/1 > 1 vcodec 4G ~ 8G larb4/5/7 > 2 cam/mdp 8G ~ 12G larb2/9/11/13/14/16/17/18/19/20 > 3 CCU0 0x4000_0000 ~ 0x43ff_ffff larb13: port 9/10 > 4 CCU1 0x4400_0000 ~ 0x47ff_ffff larb14: port 4/5 > > The iova range for CCU0/1(camera control unit) is HW requirement. > > Signed-off-by: Yong Wu > --- > .../bindings/iommu/mediatek,iommu.txt | 8 +- > .../mediatek,smi-common.txt | 5 +- > .../memory-controllers/mediatek,smi-larb.txt | 3 +- > include/dt-bindings/memory/mt8192-larb-port.h | 237 ++++++++++++++++++ > 4 files changed, 247 insertions(+), 6 deletions(-) > create mode 100644 include/dt-bindings/memory/mt8192-larb-port.h > ... > diff --git a/include/dt-bindings/memory/mt8192-larb-port.h b/include/dt-bindings/memory/mt8192-larb-port.h > new file mode 100644 > index 000000000000..fbe0d5d50f1c > --- /dev/null > +++ b/include/dt-bindings/memory/mt8192-larb-port.h > ... > +/* larb7 */ > +#define M4U_PORT_L7_VENC_RCPU MTK_M4U_DOM_ID(1, 7, 0) > +#define M4U_PORT_L7_VENC_REC MTK_M4U_DOM_ID(1, 7, 1) > +#define M4U_PORT_L7_VENC_BSDMA MTK_M4U_DOM_ID(1, 7, 2) > +#define M4U_PORT_L7_VENC_SV_COMV MTK_M4U_DOM_ID(1, 7, 3) > +#define M4U_PORT_L7_VENC_RD_COMV MTK_M4U_DOM_ID(1, 7, 4) > +#define M4U_PORT_L7_VENC_CUR_LUMA MTK_M4U_DOM_ID(1, 7, 5) > +#define M4U_PORT_L7_VENC_CUR_CHROMA MTK_M4U_DOM_ID(1, 7, 6) > +#define M4U_PORT_L7_VENC_REF_LUMA MTK_M4U_DOM_ID(1, 7, 7) > +#define M4U_PORT_L7_VENC_REF_CHROMA MTK_M4U_DOM_ID(1, 7, 8) > +#define M4U_PORT_L7_JPGENC_Y_RDMA MTK_M4U_DOM_ID(1, 7, 9) > +#define M4U_PORT_L7_JPGENC_Q_RDMA MTK_M4U_DOM_ID(1, 7, 10) > +#define M4U_PORT_L7_JPGENC_C_TABLE MTK_M4U_DOM_ID(1, 7, 11) > +#define M4U_PORT_L7_JPGENC_BSDMA MTK_M4U_DOM_ID(1, 7, 12) > +#define M4U_PORT_L7_VENC_SUB_R_LUMA MTK_M4U_DOM_ID(1, 7, 13) > +#define M4U_PORT_L7_VENC_SUB_W_LUMA MTK_M4U_DOM_ID(1, 7, 14) > + Small nit, /* larb8: null */ is missing here. > +/* larb9 */ > +#define M4U_PORT_L9_IMG_IMGI_D1 MTK_M4U_DOM_ID(2, 9, 0) > +#define M4U_PORT_L9_IMG_IMGBI_D1 MTK_M4U_DOM_ID(2, 9, 1) > +#define M4U_PORT_L9_IMG_DMGI_D1 MTK_M4U_DOM_ID(2, 9, 2) > +#define M4U_PORT_L9_IMG_DEPI_D1 MTK_M4U_DOM_ID(2, 9, 3) > +#define M4U_PORT_L9_IMG_ICE_D1 MTK_M4U_DOM_ID(2, 9, 4) > +#define M4U_PORT_L9_IMG_SMTI_D1 MTK_M4U_DOM_ID(2, 9, 5) > +#define M4U_PORT_L9_IMG_SMTO_D2 MTK_M4U_DOM_ID(2, 9, 6) > +#define M4U_PORT_L9_IMG_SMTO_D1 MTK_M4U_DOM_ID(2, 9, 7) > +#define M4U_PORT_L9_IMG_CRZO_D1 MTK_M4U_DOM_ID(2, 9, 8) > +#define M4U_PORT_L9_IMG_IMG3O_D1 MTK_M4U_DOM_ID(2, 9, 9) > +#define M4U_PORT_L9_IMG_VIPI_D1 MTK_M4U_DOM_ID(2, 9, 10) > +#define M4U_PORT_L9_IMG_SMTI_D5 MTK_M4U_DOM_ID(2, 9, 11) > +#define M4U_PORT_L9_IMG_TIMGO_D1 MTK_M4U_DOM_ID(2, 9, 12) > +#define M4U_PORT_L9_IMG_UFBC_W0 MTK_M4U_DOM_ID(2, 9, 13) > +#define M4U_PORT_L9_IMG_UFBC_R0 MTK_M4U_DOM_ID(2, 9, 14) > + > ...