From patchwork Mon Aug 20 10:31:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 144606 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3875247ljj; Mon, 20 Aug 2018 04:51:59 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYJPgIvqubCPLuLc15HgnBH1/YC0BtqHYD3Ym9VdZMvvzl8ZVtqE79SXuZUx7RuCReIT7KE X-Received: by 2002:aa7:c342:: with SMTP id j2-v6mr3149847edr.242.1534765919278; Mon, 20 Aug 2018 04:51:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534765919; cv=none; d=google.com; s=arc-20160816; b=gc/CvHn8fM1NYX3a7xQ3yMsuf/wlcR/ciDZK2sc1cL4Z8gjvr7DpzQtYzlREMWzdqx tH1ARlKPKM+Oz9qlYj35VbwMkPRakHZpuvxC4kayZ2+oclp9LR7kPJOwP+XZgGml5W4S dMWS2/ZzHcKr6cEatewl7sivDAQbsITjGW5cU3qksyPQqmv8knVMZN2eNjjaE8E2KtGh 3HK7EAEc9jdMQKq6VB1let/H9TXds62xywZnG3e+GuBXbkik7E2sX9bCxGtv/7OAZ3wf deVFGuX1w8wuv2oXHv/DBsEseklZoPAcbfgOrsoP1tp7mqs4wug8dtzY3b8rJs3gFL6M jb4w== 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:arc-authentication-results; bh=PosZc+LmA6qPTqKsbEsTlc0+6ASbkL4BAUp/u3lRDeo=; b=QgxV974Xk/kMnyufBquUU6mzf3cDAijwTBZ289RaeTMMICFbi4phFxTDCSMzr998E2 7+f1Jl9/uGVGtnVrOGEI36hFoSUHMpJS1LhnTzruKmGS1F1Ai2szCCiKTdPhX88xMKxS QJ0v59TdcgTZVtIlaD3kxoWhSsNxq8a+CuYkXs8hBiYtzibGnGvJ4t6xGNyyXOAMX3VA pJO7dAwegF3mhM2TS1vtrCdBoC2J7JNqysu1ZdPVQxjhV4oCAowO72PC9UE3oQQB4k1l Pj7Y5yUE5iVTncl/wUlsKGu9EJqnL6zxlSsLxr7J+vbvv4Fg6LXMqVN7/2a+D016uAOh 8/PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nxp.com header.s=selector1 header.b=R6dPOQPk; 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 b11-v6si2082685edl.369.2018.08.20.04.51.59; Mon, 20 Aug 2018 04:51:59 -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=R6dPOQPk; 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 E10DCC21E42; Mon, 20 Aug 2018 11:49:09 +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, 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 4BCCEC21DEC; Mon, 20 Aug 2018 11:47:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CF8E9C21C51; Mon, 20 Aug 2018 10:31:51 +0000 (UTC) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40056.outbound.protection.outlook.com [40.107.4.56]) by lists.denx.de (Postfix) with ESMTPS id 5E6E1C21C2F for ; Mon, 20 Aug 2018 10:31:47 +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=y1mBn0dGHabTbCbODvigLuMOjz3KFYx8hLglp75ajoQ=; b=R6dPOQPkO5tsDbGRxPNDoBLceHVc+4yDCQFnocfs/T/889/HYGzXkGTD+0lV3DHeJHxkaN7PcJuq3CBSk66ZZbra4Kk/kqjM7B3VnavNAfGWEc0KSxd6T/gT6X57ShvSdskvajziBoEs8kSShEQRtDR4mYNH3l7oA+du9Gw/XJc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.142.187.166) by VI1PR04MB4478.eurprd04.prod.outlook.com (2603:10a6:803:67::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.21; Mon, 20 Aug 2018 10:31:43 +0000 From: Nipun Gupta To: u-boot@lists.denx.de Date: Mon, 20 Aug 2018 16:01:14 +0530 Message-Id: <1534761074-19695-1-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0038.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:c::24) To VI1PR04MB4478.eurprd04.prod.outlook.com (2603:10a6:803:67::30) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1b460f4-0fe5-47ce-acc4-08d6068820c5 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB4478; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4478; 3:Ms6Pd59my1wId8oU+23PaaHUPZvpT9fKoHQOxWxflLXdv7k84GwDJJQzT+Dl2a9jN0ZTOawdGN7JmFKf4f2wCUF+gakX5pUQEsnlPSW0HWBLM51tGb2aXrRgYwB/7AGYtQ10NjRmcu9Iy4Sfgesvhl4VvbTHd2MrCM/i9UD42pZqDjR6hS7yleR7FNVCveJ5q0FfIXve4p2twe7Qm+E67LJDY9unRbxiSvNNZQYWj7gKAGaWaRXFHsjVbIL0UOOr; 25:SnOgpMCvx0nwxnrdRd2tI6tn/bRcApvoepQ5y6xsedmQJHURxIgj9z/JJPdSxZmmUo2wCxyg/52ShvnWtm6Kv5YiraTn9EdcwcfzYDyUqzpCTL3SX9FoRvFxRzOhp07iLiMkzzuhgiqdQ1u5g2mvztmenOh+MiGKq8Pudy0tEGJq8SGrwRxFa2Y/uaumquDsaXd/tA39kwm8PN0WiKWbMxulUfdlOGEcCJ5956yKtl3ddJlj4lq8MXjpb/CkncncVbUOPCrclCx4HuRaKJwEO5OntdhGKUg+hpC1g9fC9u6ST1hU2j9qNcdXwBF1WRKiu7PvtSt2mObDgWaHgAIjug==; 31:F2mCK0+OMDz1vefJcjW4P4s6kyYvrNXWplxiAfe0xOu37yaq33xA53y/O6K7sguYoIz17OKwtkTOopNrh7JF9zPSvy11SDlOURp54h4mo2EjNbiLCMBWgpUtOhNsP9xEK19BCK0Cs3D6el1Vbc4TBxYl0XbusnLVH2hHRaHKYUslmhVpxi47oLg7rGbJsaXpUcFPFrSKxCipBg7QBfOYKyzVwrYlvuD/2pLA+EcuMWo= X-MS-TrafficTypeDiagnostic: VI1PR04MB4478: X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4478; 20:RirRTxuQHSuMJ/WbilIoi7kDvZG0tJ42RkqrDhIAwJ0KnEuXyEO7HPanmvyLd1nZLrgRM+HhvEajdODHlu3LNSuZaUjIUP6H0lZb16RrQCWKklDV68Pdzqes0RY7vg/JpNOt/uMvZHVy6N56fd+isgLXFch0iAi7JAlscJnpCB9FOpErl3/czXny405PIUS1NxWSsHYlsS3zyJ+xJ3wfFs10E6dKX9fV6tYG5EDjQlq3xYc36m5jsVd0vR3LKHn2RW9MO5UqAD9vqiZ3i1a2XsHzQckurX7DI74tyhonn3NbP9zqVfHV2GxcSAGlUn6vG0rt3uDjdh6c9EeWymKkdFsESTvtKoHAhcUQAPm5/A7ia6lGNRzxs7ay9YTVaUycx1wviIQTy8Lhxe9bO/ec98HwZBq8y+rjWsPEm4yeLUXi+GaYurVjU/6jUlwONYTyKUyiraCAwsxw56Q9iszKp3TTGpING3beANDQnSSdxspH8S+6GyS/eo6rc8ATLMjn; 4:H7UaAKvE3udQCqLgfKNkQqH6SSEdp9sNntvcKDMwr0zYk3UR0VJGey/64+8kAIdQWqdOmf4nBbta8/S5iEdlGx+Frw3gCntY6s6P9ew+nCqFCWWdmRZyPWk5KInA0uKoT6IhMP9MGt8tdyIuz9diDLWbhm903kzLFzVuU5B/DqJ8tQHnZfnUOxyNKYIxd/8JaK3Ia4g6qDghVQRyvNP/nLzBN16v/j6ukLC0z1t5MHbBH4WMCIx9JHQpir9W8IMx2zq3vx1GsxF1mc3OJs+BwWoLMatW8aRIgemiIYVxQ96Jc3CZhCds78p2f85iC72e 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)(823301075)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:VI1PR04MB4478; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB4478; X-Forefront-PRVS: 0770F75EA9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(39860400002)(366004)(136003)(199004)(189003)(186003)(51416003)(966005)(97736004)(52116002)(305945005)(50466002)(26005)(7736002)(16586007)(5660300001)(2361001)(106356001)(6666003)(105586002)(5009440100003)(1857600001)(316002)(6306002)(86362001)(53936002)(16526019)(6916009)(6512007)(2351001)(575784001)(44832011)(48376002)(478600001)(486006)(4326008)(956004)(2616005)(476003)(36756003)(2906002)(386003)(6116002)(3846002)(6486002)(8936002)(8676002)(6506007)(81166006)(81156014)(66066001)(50226002)(25786009)(47776003)(68736007)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4478; H:b27504-OptiPlex-790.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR04MB4478; 23:r0CZz6ARTzPFTCXBJUwTdIOkagO5euqmgn4Uh9YpA?= M40kdbvIbSc0RG0s+NCvQRnmQV44mk3zVSz60yc1jcAF+mhV5paoQQHqXYYflXjKzb9Zh7gitiS4bhvXcyoFvr+o2KDy8ESUiHZCi0of+PbLQ6pP8p6X+Y+mtgcIm546J15obMzwQ2UvGzJKQnNnECymvzbjDMhZhm3o/j5B3g7LPUdSEUinROgvRQd4mGgfwrNtlh38Q+3a8IGTi8kuXjAgrSYid991dilwIxJrJcTvbDUm2qiETv4daN4GfdNv+uIzIAzZSnmzueSw0PksgPjUV+OpRYPvd+aSZnS0P9C/wU0rNrlAIhb9ge8PK/R7Q1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+8P9jgjONYporJqmZFRongnTvadD4vpStsbP72pwc7ba316TGxFwO/nePSDk20OT52G4IDZaYLHSBebpUypb1J7ro+yC7ZEo4LkJiSlEonbyGCrf03ZdYLWYPy3OOxCqKw8hh91MWnZJIpqY5U+rxVyy2p SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2018 10:31:43.6966 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a1b460f4-0fe5-47ce-acc4-08d6068820c5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4478 X-Mailman-Approved-At: Mon, 20 Aug 2018 11:46:54 +0000 Cc: priyanka.jain@nxp.com, alison.wang@nxp.com, joe.hershberger@ni.com, Nipun Gupta , Shaohui.Xie@nxp.com Subject: [U-Boot] [PATCH] 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.codeaurora.org/patch/569431/ The kernel series adds iommu-map property for fsl-mc devices and this patch fixes that property. The patch only prints a debug log if the property is not found in the 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