From patchwork Tue Sep 25 09:28:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 147427 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp589724lji; Tue, 25 Sep 2018 04:13:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV60I2CnhDZr1DyGkZ2ReNelAD3yJhN1WitK1BFIH/sPav0Pr02sHveig4Go+qmb6GfEws0T3 X-Received: by 2002:a1c:a8cd:: with SMTP id r196-v6mr224093wme.133.1537873997809; Tue, 25 Sep 2018 04:13:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537873997; cv=none; d=google.com; s=arc-20160816; b=VDUNs7SCJhfOkGwgHsUkNM7X4IOHz+tyy+m4Drks23V3fmNbgNW5O6D2Ua/KQ/YgNw ie41pRU+NVITAe/LAVRTgcDc/q+Zy17l630D+uzArRvsP5Ufn88L9OjYljJBoLo+nNu4 bHmiWhKnqEzFXGs8R4voh8eT2OMDXomGR2xmVLUE4uuVftzY5oVUfOZ7YMQGvpTP7jdp 4awYSQ+YTxNBmz5fwksO4U6XgZyAVEkImj7c36W4rUfxkueo+AGyuK5F0Pfh28durS/k lM84ytrVlWJni86NU3nICYLHNgamgGDdIArnRv/RmYCtLJ17r9pGpse8uMZ55O2CLvMt PGdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:spamdiagnosticmetadata:spamdiagnosticoutput:mime-version :message-id:date:to:from:dkim-signature; bh=5GG4PM9uvniLOqbKkn6dl/wa5JODBwTB4qlZdeY0Qcs=; b=SByjcCUaJm4sOZNjzzva+dHGWfIQKwa6niw6SkoSTi3s0jH5sG+RIjzOWRLfd6RbfP FT95cKEjaK4dsx7UwR8BBeippGEAQTJnUvpUytpRfN+/HuaSQ0njR8TqqsOY9jkbYSw7 FuTX7DHei7/YaL/k6k6mCIL5IpYBbCRMJbH2ZUq28au9BsWhgm7yGyB2UdInhi+vxQah zeqkTE/gnBYc+URKg6LYO1DDaZwyYRumKYtNF/1L9cJoQdJNA+TVpjyJc7zzR20YuLlk TRhKl1QpjDQa/XOFUNUJXRiL1cWnk+4SHS8lkNxYi1mTkGcw6C8FIsbhpR67LsLftPeg ZmHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nxp.com header.s=selector1 header.b=TMbCPq3h; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id o11-v6si343318edo.287.2018.09.25.04.13.17; Tue, 25 Sep 2018 04:13:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nxp.com header.s=selector1 header.b=TMbCPq3h; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: by lists.denx.de (Postfix, from userid 105) id 6F092C21EA2; Tue, 25 Sep 2018 11:11:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAD_ENC_HEADER, RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 23FE1C21F04; Tue, 25 Sep 2018 11:10:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8DD55C21D72; Tue, 25 Sep 2018 09:23:25 +0000 (UTC) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70080.outbound.protection.outlook.com [40.107.7.80]) by lists.denx.de (Postfix) with ESMTPS id 152A0C21CB6 for ; Tue, 25 Sep 2018 09:23:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1i11KKm4wbmZ/XMHNfisC4LUSUGFqX6JHRoG4Xlq4GE=; b=TMbCPq3hS58afekJnKZzO1VtNjVeLz8zrCYZ4DB59bIRCWCufKxdFXt70g3L7P4Ab0+TTJFQAK4GjK3lZp+hAAcAsSN1Q3ETDK6yNO3hNzc3g87IeAWo5FJqxNuv8UERtu3hA/eh8/UAs+WiZlLQ2dOOuuIqgQPQ2X7xPVF5sdM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.143.30.134) by DB7PR04MB4475.eurprd04.prod.outlook.com (2603:10a6:5:35::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Tue, 25 Sep 2018 09:23:21 +0000 From: Nipun Gupta To: u-boot@lists.denx.de Date: Tue, 25 Sep 2018 14:58:19 +0530 Message-Id: <1537867699-22737-1-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: MAXPR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:c::23) To DB7PR04MB4475.eurprd04.prod.outlook.com (2603:10a6:5:35::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ad4ee85f-ec77-4579-14bd-08d622c88ad3 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR04MB4475; X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4475; 3:WS96/BkOrA58aN3kDwBb67QKbdcF5iQ6KKHFWYAK0D3lUgCO/e0k3PE7ZchD6WxBqdNJrq5t0a/0dJJJUpgSbgB+y5YOBMP6bP77PCvJWdKlV9fVUVJloX7CwHKa7FVMjz6hHh1mun7Fc1VhWeqZceP9FWdAY1MFQ93yGpfcTp9cAnC8mugQUOhEQRXqh6gsTdDFysMf1sGow/ZbiN+Q+drs6NwLcpbG4LLDYQB/i37VnbhZo8ygaWtb242/vNj7; 25:UB/Uq9xWSs+8YWTz5ab1r8t8oFMENj2PQxK1UI7/as7sXHWPHTw7kK5LSIWp9bfesFSai5FCIc1/M/zYI0oxdrQmgTIJIESF6zeBiC41lp5dffnK6ECICL1AIG5LNZf7LFUnw44jbRKcfi4h0c5ruVLAQwqhYL+F+YQfRfQgKH+nr1TS+jUCzf1jEDBTqMC2sike/xgUsPFY8EecO7Hiy/cElK2MJzuqfbP6G69x9vixKnBDpaaKRdTTA1L41yN92jmNQMqmdGLYwmu+u6bzCXbqn8sRzoyOt6C7cd7KIhBbfbSCrJrv+ZPe0zgSx1UnjBGk3ROEEryb4ykH0Iph6A==; 31:f5xXQowWEQabwq+HE7asY3TCxoWR15LuNgh8A6MZ/9uIAF/rEMjwucApL/T6199WHdeX8LW+ir+S4yEBD1Ui3ghYxAHOKhy2A0dRmUJ74twEjA5b1o0+/FeGJOfON00s/qujYsn0Fp71NVYhjOoXiKs41/jfq3E6bWxVlLYWGbUavg+R1PYum0F7gVuC57D26IaAa5pbeFi/DFU9U+fVqZfoWxN6NOxJvmDvHjWgJgk= X-MS-TrafficTypeDiagnostic: DB7PR04MB4475: X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4475; 20:bNY9Ut5mtnTF4rJNRZCXe0lEefYziVazz+sRuO0qiLYVGKwS8bId4TgkIe4LtPNFDQi++W2bsJ4fZsYkcRkI541YpG0zBYQ/W5JWhyP5un+BRAJAqlFWAhjyT+qoN+/SXIiTX0L/O36xGUTzMUgm5YFVsPiuJcqSd+z3GUqp+2/Fg5NZX3iDMQ2Vn/7tkBBgQiLroXlW9T3z0VlEfQRjzzF4VPj5jG11STlRKYSBoHqdDEYg3CcT3ALmQtAxHm91rCUDYkO661NZtt2SWus0UgU6zltq/6oJOWRp7I7s3bqAQcKPYofWhOTYgu12F6iPmKkwXrEQ6rGaYGm7zEfhcoTrI2+FpooQHoy6CBTHnhZxdOvFALdgHzpCbz72/MVcecyfr6b75me9Fon8vtMqD3Qy/jTfEIIHncyldigk6hROplIFgB1b9daqMdZWnV29aKGf0LhpTvjzdsA9NZM0o23XiVMNq6/kB2LkcDapGKVYxNywM7xjZSxb7mYUxm7d; 4:1v8w9bf+2IxWEN8LP340QTVS7E5xEVv565AZgRRInxQdRXKkoCHpWAE12Dk3tphHVnew/TNswz3pGisthNqR4QOJGrptEMnUT/zRQgDVsYphssfoiIR14p8sjo55UV2ldOfI8lxT3tBNDYF8MrWBbTm7I/xyJxD5lEYRjFltBaagvtlc1onexd2OLs+p8b0biYCvXF/nqdxwMf2eQNeQrHGqC0yHs1yK3f3TrRhi4HuvcjA0kabdpbKjIBDKK3do/O8Akhg2hmsY53wvmu9FupXR6FbG38regBU6I+q/rO8TF6eepYuUWfv+U7Cg5mwf X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231355)(944501410)(52105095)(3002001)(93006095)(93001095)(6055026)(149066)(150027)(6041310)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:DB7PR04MB4475; BCL:0; PCL:0; RULEID:; SRVR:DB7PR04MB4475; X-Forefront-PRVS: 08062C429B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(136003)(396003)(366004)(189003)(199004)(25786009)(4326008)(6486002)(486006)(8936002)(97736004)(81166006)(81156014)(68736007)(305945005)(36756003)(50226002)(5660300001)(3846002)(6116002)(5009440100003)(2616005)(956004)(476003)(7736002)(478600001)(186003)(2351001)(2906002)(2361001)(16526019)(106356001)(8676002)(50466002)(48376002)(386003)(6506007)(52116002)(51416003)(966005)(105586002)(26005)(6306002)(6512007)(66066001)(86362001)(575784001)(53936002)(16586007)(47776003)(44832011)(6916009)(316002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4475; H:b27504-OptiPlex-790.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB7PR04MB4475; 23:7j4ywyrrDoBkRgTq5kOXHvyx2X7MgXW6yYhIpK9TV?= bjKBcbETJ/1t4tF0f+7cGsZAccTu80z9cTKqeWNQGZMJbvr3uPsH++rPuaEZJQG7l8OrR0TVTVh+abyuH0LlKq1sRsu6CSI2AYYOVZPSvXQH/dtapXiYnlMzisx3G385O69LXZmdvWNhq6dx7XSBVcTG3sy3Rau0q435H/JimHsDzp1ZwvYlADDjUfY/OMceOW6qRRGW8+kjza7ax4Wy3DJaZ/vZAD+4jVPIfS3Mf0ogyHK1bPthwtPRD2aeUX0486O/auexXh0flpoWYjPjr4nwEEWustHd7tAGs6vot7HmuO0SaRYO+ckissaIQk/KXBmbpht4b4ERIKuiutmaXcx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+nL49ipbytycQzUbpNqcEhkx8u4mIiq5+8mU5Oau6gWvhhDjjquAbZ6g8UhCp SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2018 09:23:21.0166 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ad4ee85f-ec77-4579-14bd-08d622c88ad3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4475 X-Mailman-Approved-At: Tue, 25 Sep 2018 11:10:04 +0000 Cc: priyanka.jain@nxp.com, alison.wang@nxp.com, joe.hershberger@ni.com, Nipun Gupta , Shaohui.Xie@nxp.com Subject: [U-Boot] [PATCH RESEND] u-boot: fixup the iommu-map property of fsl-mc node X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The iommu-map property in the fsl-mc node is updated by valid stream-ids by u-boot. This patch is to fixup this property for LS208x and LS1088. Signed-off-by: Nipun Gupta --- This patch fixes iommu-map property added for fsl-mc in kernel patch series: https://patchwork.kernel.org/patch/10594185/ Kernel patch series is accepted and would be available in kernel 4.20. This patch is backward compatible and have only a debug log if the property is not found in kernel. .../asm/arch-fsl-layerscape/stream_id_lsch3.h | 3 ++ board/freescale/ls1088a/ls1088a.c | 2 ++ board/freescale/ls2080a/ls2080a.c | 2 ++ board/freescale/ls2080aqds/ls2080aqds.c | 2 ++ board/freescale/ls2080ardb/ls2080ardb.c | 2 ++ drivers/net/fsl-mc/mc.c | 34 ++++++++++++++++++++++ include/fsl-mc/fsl_mc.h | 1 + 7 files changed, 46 insertions(+) diff --git a/arch/arm/include/asm/arch-fsl-layerscape/stream_id_lsch3.h b/arch/arm/include/asm/arch-fsl-layerscape/stream_id_lsch3.h index afea9b8..8d002da 100644 --- a/arch/arm/include/asm/arch-fsl-layerscape/stream_id_lsch3.h +++ b/arch/arm/include/asm/arch-fsl-layerscape/stream_id_lsch3.h @@ -35,6 +35,9 @@ * -DPAA2 * -u-boot will allocate a range of stream IDs to be used by the Management * Complex for containers and will set these values in the MC DPC image. + * -u-boot will fixup the iommu-map property in the fsl-mc node in the + * device tree (see Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt + * for more info on the msi-map definition) * -the MC is responsible for allocating and setting up 'isolation context * IDs (ICIDs) based on the allocated stream IDs for all DPAA2 devices. * diff --git a/board/freescale/ls1088a/ls1088a.c b/board/freescale/ls1088a/ls1088a.c index a0dab6f..517a8ce 100644 --- a/board/freescale/ls1088a/ls1088a.c +++ b/board/freescale/ls1088a/ls1088a.c @@ -575,6 +575,8 @@ int ft_board_setup(void *blob, bd_t *bd) fdt_fixup_memory_banks(blob, base, size, CONFIG_NR_DRAM_BANKS); + fdt_fsl_mc_fixup_iommu_map_entry(blob); + fsl_fdt_fixup_flash(blob); #ifdef CONFIG_FSL_MC_ENET diff --git a/board/freescale/ls2080a/ls2080a.c b/board/freescale/ls2080a/ls2080a.c index 75014fd..698ae1f 100644 --- a/board/freescale/ls2080a/ls2080a.c +++ b/board/freescale/ls2080a/ls2080a.c @@ -127,6 +127,8 @@ int ft_board_setup(void *blob, bd_t *bd) fdt_fixup_memory_banks(blob, base, size, 2); + fdt_fsl_mc_fixup_iommu_map_entry(blob); + #if defined(CONFIG_FSL_MC_ENET) && !defined(CONFIG_SPL_BUILD) fdt_fixup_board_enet(blob); #endif diff --git a/board/freescale/ls2080aqds/ls2080aqds.c b/board/freescale/ls2080aqds/ls2080aqds.c index c811e99..d336ef8 100644 --- a/board/freescale/ls2080aqds/ls2080aqds.c +++ b/board/freescale/ls2080aqds/ls2080aqds.c @@ -332,6 +332,8 @@ int ft_board_setup(void *blob, bd_t *bd) fdt_fixup_memory_banks(blob, base, size, 2); + fdt_fsl_mc_fixup_iommu_map_entry(blob); + fsl_fdt_fixup_dr_usb(blob, bd); #if defined(CONFIG_FSL_MC_ENET) && !defined(CONFIG_SPL_BUILD) diff --git a/board/freescale/ls2080ardb/ls2080ardb.c b/board/freescale/ls2080ardb/ls2080ardb.c index 46b18cf..cf91bc3 100644 --- a/board/freescale/ls2080ardb/ls2080ardb.c +++ b/board/freescale/ls2080ardb/ls2080ardb.c @@ -394,6 +394,8 @@ int ft_board_setup(void *blob, bd_t *bd) fdt_fixup_memory_banks(blob, base, size, 2); + fdt_fsl_mc_fixup_iommu_map_entry(blob); + fsl_fdt_fixup_dr_usb(blob, bd); fsl_fdt_fixup_flash(blob); diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index 940025a..cb2fbe9 100644 --- a/drivers/net/fsl-mc/mc.c +++ b/drivers/net/fsl-mc/mc.c @@ -278,6 +278,40 @@ static int mc_fixup_dpl_mac_addr(void *blob, int dpmac_id, MC_FIXUP_DPL); } +void fdt_fsl_mc_fixup_iommu_map_entry(void *blob) +{ + u32 *prop; + u32 iommu_map[4]; + int offset; + int lenp; + + /* find fsl-mc node */ + offset = fdt_path_offset(blob, "/soc/fsl-mc"); + if (offset < 0) + offset = fdt_path_offset(blob, "/fsl-mc"); + if (offset < 0) { + printf("%s: fsl-mc: ERR: fsl-mc node not found in DT, err %d\n", + __func__, offset); + return; + } + + prop = fdt_getprop_w(blob, offset, "iommu-map", &lenp); + if (!prop) { + debug("%s: fsl-mc: ERR: missing iommu-map in fsl-mc bus node\n", + __func__); + return; + } + + iommu_map[0] = cpu_to_fdt32(FSL_DPAA2_STREAM_ID_START); + iommu_map[1] = *++prop; + iommu_map[2] = cpu_to_fdt32(FSL_DPAA2_STREAM_ID_START); + iommu_map[3] = cpu_to_fdt32(FSL_DPAA2_STREAM_ID_END - + FSL_DPAA2_STREAM_ID_START + 1); + + fdt_setprop_inplace(blob, offset, "iommu-map", + iommu_map, sizeof(iommu_map)); +} + static int mc_fixup_dpc_mac_addr(void *blob, int dpmac_id, struct eth_device *eth_dev) { diff --git a/include/fsl-mc/fsl_mc.h b/include/fsl-mc/fsl_mc.h index 7f4859b..aef40d3 100644 --- a/include/fsl-mc/fsl_mc.h +++ b/include/fsl-mc/fsl_mc.h @@ -51,6 +51,7 @@ struct mc_ccsr_registers { u32 reg_error[]; }; +void fdt_fsl_mc_fixup_iommu_map_entry(void *blob); int get_mc_boot_status(void); int get_dpl_apply_status(void); #ifdef CONFIG_SYS_LS_MC_DRAM_AIOP_IMG_OFFSET