From patchwork Thu Feb 25 23:06:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Yoder X-Patchwork-Id: 588470 X-Patchwork-Delegate: yorksun@freescale.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id A6E2E1401B5 for ; Fri, 26 Feb 2016 10:43:04 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5B47BA773A; Fri, 26 Feb 2016 00:43:03 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sTFVASzZPI-6; Fri, 26 Feb 2016 00:43:03 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EDC80A74C3; Fri, 26 Feb 2016 00:43:02 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0D650A74C3 for ; Fri, 26 Feb 2016 00:43:00 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3nE6MrEJhIV4 for ; Fri, 26 Feb 2016 00:42:59 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0058.outbound.protection.outlook.com [157.56.110.58]) by theia.denx.de (Postfix) with ESMTPS id 1D3D2A74BA for ; Fri, 26 Feb 2016 00:42:55 +0100 (CET) Received: from CH1PR03CA010.namprd03.prod.outlook.com (10.255.156.155) by DM2PR03MB317.namprd03.prod.outlook.com (10.141.54.15) with Microsoft SMTP Server (TLS) id 15.1.415.20; Thu, 25 Feb 2016 23:27:15 +0000 Received: from BN1BFFO11FD050.protection.gbl (10.255.156.132) by CH1PR03CA010.outlook.office365.com (10.255.156.155) with Microsoft SMTP Server (TLS) id 15.1.409.15 via Frontend Transport; Thu, 25 Feb 2016 23:27:15 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD050.mail.protection.outlook.com (10.58.145.5) with Microsoft SMTP Server (TLS) id 15.1.422.5 via Frontend Transport; Thu, 25 Feb 2016 23:27:14 +0000 Received: from right.am.freescale.net (right.am.freescale.net [10.81.116.70]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u1PNQq53001286; Thu, 25 Feb 2016 16:26:53 -0700 From: Stuart Yoder To: Date: Thu, 25 Feb 2016 17:06:17 -0600 Message-ID: <1456441583-20932-2-git-send-email-stuart.yoder@nxp.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1456441583-20932-1-git-send-email-stuart.yoder@nxp.com> References: <1456441583-20932-1-git-send-email-stuart.yoder@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131009164353668621; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD050; 1:WezaIQGC9d9Ff2f15cpVVpf2E9tfX0IINogLjWVU4J8xce4xET4bvs+kR6DS+eRWN6M6Yy9B0ugmkQVMt79epq3h3p2vfR1raHlVrEVe5civeLAMtGben9TZEtgEuREAvsz2sss1Kl54xRwFZvBEVPdEGQkE9y5fY6EDz6FBH4XzE+7z5Nwk5JDDtR4km+CuRirQhlvdiJhX1och0giiY/o4BIQhodeLIrmQTEyML3gH/GhgoteSUokioECEOILfsXR0uue7Fr6hDMWvTdz9Z6eDynUVsObFa+TtMj23lN3psbLY7cxcLxVfenRz/KnCR2YEJRxCXR+t99oEsle7/QY3W5D5fTDcmRWEC8+eZZcSMcIA4a8QSupB/+btk/v5NtMZBia0a4vafHQ23GoU86xJpsJ1xBTSYMqANdHjlk6lJOhW8JjNhnym2Ca0d5tb+hayOvrAGYbIRjuxdQ+b71RfNfii7H6s5mLT428jvjO1nr4OID7Q7Q4ZOa/cikWg4K0M0MT4L2heiGVmCiQEqEPs6MP13LdUDQgFcDxrv01bo0tJe9jSUN1+i1QcWKqoBv0YOGTo1fp412MfDmS9rIj01SDWBgatSm8sZkW4Vbg= X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(36756003)(50226001)(5003940100001)(11100500001)(5008740100001)(6806005)(50986999)(77096005)(2950100001)(76176999)(48376002)(50466002)(104016004)(19580405001)(19580395003)(1220700001)(110136002)(33646002)(85426001)(1096002)(5001960100002)(105606002)(2906002)(106466001)(229853001)(2351001)(4326007)(86362001)(189998001)(586003)(87936001)(47776003)(92566002)(7059030)(4720700001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR03MB317; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 437d04ab-631f-40fe-a4af-08d33e3b3213 X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB317; 2:mU8WH65ylP6N6f4LTjnPdQ4l4EI5428yxtPCS4DVV/tLuGcYBhhE/92Tuup1MYIl30zXPwsUI844Bob1FIi26lhYuKEqUQDJuRC1m2x34bL2sdXWDUXWHHTchelM/C24dmrBNnaexijWftA5/TLpAKbo/SnwUF8DsAdAmKPxKocrSniDxyCHG1Cl+kpR3Lhp; 3:kxhVHN3EGEy2pnV1VxyYcB/kDTKPyDwCzAZEMGZ/mf8qzI0c95Uxb5LMd9NuER/EfGj7FXbC241uN7hLHepH1lEma7735I5ujWH63/CiPtQMCQPjyXInoW4gTdJYX2QnSJuINEPNCd24SEAmEFt96F21K3DESs/7kDRH2lmnvZhnMZi3t6PRWcnKpy+YP27U8CYXMyGjGTcdl6Dqj9vOxQHws0GI+DOtw3/3MI7kJnM=; 25:8MpSeMr9wHv+bQUyAeFB/GYiCc6lmBxFvxg7uwDiOqUbBEorvMJ+giYd6Q7ccpCtM4z62TVt3F7R96l4QeNZvPCZiO1JZHZNLcM3Ui8RXat34ne67SqXMgpqGfZOJPIt5jzOiM6FC2p7QHOuhmkqQ5b6ynXS+vf0JwkZ6KTVkdyj/GhTnk0W9gL7xvy4CiCkBf5KjKmChRNNrjQYOKhGZERIxIStr8WpcveMnFzxqy6+xXMI6it3hzUv2gZWCI0qFg1RZfMSNRREgZhpFicA2Fl+B2qvntEgND6APPowQ0iguRP15J8jtSDlAWd1fNKpj3LVWj4/VMGgsArEqLFTGg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB317; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(13023025)(13017025)(13015025)(13024025)(13018025)(8121501046)(3002001)(10201501046); SRVR:DM2PR03MB317; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR03MB317; X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB317; 4:1b3ggJ9cJDUgZ25lxfAf1QHqmgmOc07c9x1bgWCtvOTlFj8+ZmqEeE4DulZOOEgGXM1DlAlm2xXyIV3DvFkRruwtjVwwFJ13UTXV+1imaruaWdJNkx4OcJc7GNz9C3+GJSArxXYz4du/lOvT/4a3Aczx+WuUAAIDqUaC2br1Y0Y82SGa/nkl2SVtjH0ScyldpdA43GvXxy0e4bBhFyxdEio8KMvN9xXBOX/KMIBnOmxBiSPr9ZVZbH1QEZ0ICj10dCu4V1MxJDBFhBaHaqdiFhxCa5CVHKjliZnxUCf4X2zV/bdw8JZPsbolODwS4yXr3WT5VyHDI1Wm/Uilc3pCHrV59OsLDtimlMulbmu+s/cWe408uCuBXZqyCj24DkUwkSGTCeT6b5lwu4Ous7pLVh4nDr4EbdZoWSXY23cR3JKcc2vvN+tXsKow7OAa8mIyohY5uq29BiwSGF56IBvNRbkb6I5kVHOfm8GKhZjllyTSuP5ee6LkoJD8UsofQOqz X-Forefront-PRVS: 08635C03D4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR03MB317; 23:wR40oMPlSvhp71hWGSrbRJc/rY3y1hpYIkU74UNMpw?= =?us-ascii?Q?X5nxbCXWWEegiGEIjH23QZeSL3rPy9MpLpyg3vD+k2eSR4GvAECX4PzdL6YL?= =?us-ascii?Q?U4SHhiKETY8Gy1iQd3qBDtEROG/WQgiBYz0PrERM8DGVQboPk4d+Va5tGwGx?= =?us-ascii?Q?ybHztcoRqPD9BjpvdzH/9NIqn8NcaRij6Cv/CnfPCP4QiwurySXraEvi2zei?= =?us-ascii?Q?MIwV8Qw6fRkM2AvdBoFoo6/xxGe66MjI51TRdVA8LlyyGXFMtC/PBaVn8HPj?= =?us-ascii?Q?lemrZgWLKTYeBdcFURWvrBjIVQ5ieXTEUXamhJt/oLIqExoHJvx3qFvztpP3?= =?us-ascii?Q?r1GkYB4Y3VpJSDnym4cLbjgbsmOPEtS/Rfp2SmDauhMevZ07rRWvU1vQesIf?= =?us-ascii?Q?VbR/uTbIBOoXLdVBPs8H04B2exENu5G0dHCG9j8Y+nDSgjpJf4rigF6FMLTP?= =?us-ascii?Q?rhjxBe9cSz7WaK2LowbGB7hBBUek23DJF0abVbFNk5jxHlemP5SUb0++11ib?= =?us-ascii?Q?fB8KiJp6sg6iQsXAmNO+UA2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-CrossTenant-OriginalArrivalTime: 25 Feb 2016 23:27:14.7116 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR03MB317 Cc: marc.zyngier@arm.com, leoyang.li@nxp.com, mingkai.hu@nxp.com Subject: [U-Boot] [PATCH 1/7 v2] armv8: ls2080a: remove obsolete stream ID partitioning support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" From: Stuart Yoder Remove stream ID partitioning support that has been made obsolete by upstream device tree bindings that specify how representing how PCI requester IDs are mapped to MSI specifiers and SMMU stream IDs. Signed-off-by: Stuart Yoder --- -v2 -no changes arch/arm/cpu/armv8/fsl-layerscape/fdt.c | 113 ------------------------------- drivers/pci/pcie_layerscape.c | 70 ------------------- 2 files changed, 183 deletions(-) diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c index 4e4861d..7a64f41 100644 --- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c +++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c @@ -70,115 +70,6 @@ void ft_fixup_cpu(void *blob) } #endif -/* - * the burden is on the the caller to not request a count - * exceeding the bounds of the stream_ids[] array - */ -void alloc_stream_ids(int start_id, int count, u32 *stream_ids, int max_cnt) -{ - int i; - - if (count > max_cnt) { - printf("\n%s: ERROR: max per-device stream ID count exceed\n", - __func__); - return; - } - - for (i = 0; i < count; i++) - stream_ids[i] = start_id++; -} - -/* - * This function updates the mmu-masters property on the SMMU - * node as per the SMMU binding-- phandle and list of stream IDs - * for each MMU master. - */ -void append_mmu_masters(void *blob, const char *smmu_path, - const char *master_name, u32 *stream_ids, int count) -{ - u32 phandle; - int smmu_nodeoffset; - int master_nodeoffset; - int i; - - /* get phandle of mmu master device */ - master_nodeoffset = fdt_path_offset(blob, master_name); - if (master_nodeoffset < 0) { - printf("\n%s: ERROR: master not found\n", __func__); - return; - } - phandle = fdt_get_phandle(blob, master_nodeoffset); - if (!phandle) { /* if master has no phandle, create one */ - phandle = fdt_create_phandle(blob, master_nodeoffset); - if (!phandle) { - printf("\n%s: ERROR: unable to create phandle\n", - __func__); - return; - } - } - - /* append it to mmu-masters */ - smmu_nodeoffset = fdt_path_offset(blob, smmu_path); - if (fdt_appendprop_u32(blob, smmu_nodeoffset, "mmu-masters", - phandle) < 0) { - printf("\n%s: ERROR: unable to update SMMU node\n", __func__); - return; - } - - /* for each stream ID, append to mmu-masters */ - for (i = 0; i < count; i++) { - fdt_appendprop_u32(blob, smmu_nodeoffset, "mmu-masters", - stream_ids[i]); - } - - /* fix up #stream-id-cells with stream ID count */ - if (fdt_setprop_u32(blob, master_nodeoffset, "#stream-id-cells", - count) < 0) - printf("\n%s: ERROR: unable to update #stream-id-cells\n", - __func__); -} - - -/* - * The info below summarizes how streamID partitioning works - * for ls2080a and how it is conveyed to the OS via the device tree. - * - * -non-PCI legacy, platform devices (USB, SD/MMC, SATA, DMA) - * -all legacy devices get a unique ICID assigned and programmed in - * their AMQR registers by u-boot - * -u-boot updates the hardware device tree with streamID properties - * for each platform/legacy device (smmu-masters property) - * - * -PCIe - * -for each PCI controller that is active (as per RCW settings), - * u-boot will allocate a range of ICID and convey that to Linux via - * the device tree (smmu-masters property) - * - * -DPAA2 - * -u-boot will allocate a range of ICIDs to be used by the Management - * Complex for containers and will set these values in the MC DPC image. - * -the MC is responsible for allocating and setting up ICIDs - * for all DPAA2 devices. - * - */ -#ifdef CONFIG_FSL_LSCH3 -static void fdt_fixup_smmu(void *blob) -{ - int nodeoffset; - - nodeoffset = fdt_path_offset(blob, "/iommu@5000000"); - if (nodeoffset < 0) { - printf("\n%s: WARNING: no SMMU node found\n", __func__); - return; - } - - /* fixup for all PCI controllers */ -#ifdef CONFIG_PCI - fdt_fixup_smmu_pcie(blob); -#endif -} -#endif - void ft_cpu_setup(void *blob, bd_t *bd) { #ifdef CONFIG_MP @@ -200,8 +91,4 @@ void ft_cpu_setup(void *blob, bd_t *bd) #ifdef CONFIG_FSL_ESDHC fdt_fixup_esdhc(blob, bd); #endif - -#ifdef CONFIG_FSL_LSCH3 - fdt_fixup_smmu(blob); -#endif } diff --git a/drivers/pci/pcie_layerscape.c b/drivers/pci/pcie_layerscape.c index 99f9c83..bb29222 100644 --- a/drivers/pci/pcie_layerscape.c +++ b/drivers/pci/pcie_layerscape.c @@ -664,73 +664,3 @@ void ft_pci_setup(void *blob, bd_t *bd) { } #endif - -#if defined(CONFIG_LS2080A) || defined(CONFIG_LS2085A) - -void pcie_set_available_streamids(void *blob, const char *pcie_path, - u32 *stream_ids, int count) -{ - int nodeoffset; - int i; - - nodeoffset = fdt_path_offset(blob, pcie_path); - if (nodeoffset < 0) { - printf("\n%s: ERROR: unable to update PCIe node\n", __func__); - return; - } - - /* for each stream ID, append to mmu-masters */ - for (i = 0; i < count; i++) { - fdt_appendprop_u32(blob, nodeoffset, "available-stream-ids", - stream_ids[i]); - } -} - -#define MAX_STREAM_IDS 4 -void fdt_fixup_smmu_pcie(void *blob) -{ - int count; - u32 stream_ids[MAX_STREAM_IDS]; - u32 ctlr_streamid = 0x300; - - #ifdef CONFIG_PCIE1 - /* PEX1 stream ID fixup */ - count = FSL_PEX1_STREAM_ID_END - FSL_PEX1_STREAM_ID_START + 1; - alloc_stream_ids(FSL_PEX1_STREAM_ID_START, count, stream_ids, - MAX_STREAM_IDS); - pcie_set_available_streamids(blob, "/pcie@3400000", stream_ids, count); - append_mmu_masters(blob, "/iommu@5000000", "/pcie@3400000", - &ctlr_streamid, 1); - #endif - - #ifdef CONFIG_PCIE2 - /* PEX2 stream ID fixup */ - count = FSL_PEX2_STREAM_ID_END - FSL_PEX2_STREAM_ID_START + 1; - alloc_stream_ids(FSL_PEX2_STREAM_ID_START, count, stream_ids, - MAX_STREAM_IDS); - pcie_set_available_streamids(blob, "/pcie@3500000", stream_ids, count); - append_mmu_masters(blob, "/iommu@5000000", "/pcie@3500000", - &ctlr_streamid, 1); - #endif - - #ifdef CONFIG_PCIE3 - /* PEX3 stream ID fixup */ - count = FSL_PEX3_STREAM_ID_END - FSL_PEX3_STREAM_ID_START + 1; - alloc_stream_ids(FSL_PEX3_STREAM_ID_START, count, stream_ids, - MAX_STREAM_IDS); - pcie_set_available_streamids(blob, "/pcie@3600000", stream_ids, count); - append_mmu_masters(blob, "/iommu@5000000", "/pcie@3600000", - &ctlr_streamid, 1); - #endif - - #ifdef CONFIG_PCIE4 - /* PEX4 stream ID fixup */ - count = FSL_PEX4_STREAM_ID_END - FSL_PEX4_STREAM_ID_START + 1; - alloc_stream_ids(FSL_PEX4_STREAM_ID_START, count, stream_ids, - MAX_STREAM_IDS); - pcie_set_available_streamids(blob, "/pcie@3700000", stream_ids, count); - append_mmu_masters(blob, "/iommu@5000000", "/pcie@3700000", - &ctlr_streamid, 1); - #endif -} -#endif