From patchwork Mon Mar 11 09:30:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43432139A for ; Mon, 11 Mar 2019 09:30:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AA5728E61 for ; Mon, 11 Mar 2019 09:30:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28D3D28E7B; Mon, 11 Mar 2019 09:30:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6E67D28E72 for ; Mon, 11 Mar 2019 09:30:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=b6MDa3pjMhpamZPWjqXDQB5p2aOJkFKQwPpG9/BMeE4=; b=My0Ap4y/BYsy5p 47hXg0BHNf9AX06a0CnoL+Qs4wtsuliB9Xhiv5RBbUwl/OqK2nEL1OGLpNpAP6hiXyYoViqxupaIZ tVtiaUcd+tKN1SSvqO6LHi3KTh8xYnhPKnNvFKk9GjIURKZ7tdmvNF2o1P2CqJiNSvAlwFK0bc7Cv 37EJgwwMfH38vIg3sHY3UQOIbQlhDekgpSIbTlBf61DiAX+LebdaUlPxC2EtFCoGiNL25xu+lPeqE LD3fnI02a4AiBZHzZeNhBJ4H+qciuRMX8FjujVFkhkpY/rTBm4keb59dgBTZfAamGUSxlYUyDwrDi bz7WODCZ1O1fOrr+7J6w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HGE-0008UW-Oq; Mon, 11 Mar 2019 09:30:18 +0000 Received: from mail-eopbgr80072.outbound.protection.outlook.com ([40.107.8.72] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HG2-0007YU-Gn for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:30:12 +0000 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=3RSAuVkNn/zVbKLUCGcd3ScczKOu00U6apr5JWzRqZw=; b=agUWIVEIUYjcM63+/kNIjsLKXWaRHfz2f6JPdElLc2M7dsXlCrzme1f2vRBG2ib5Ee+4j1TDZUYZyF/0VGLPPhut/eXos2SH8pTZON3CMLQLf8uwiYZWmjAQg9q6JJmERk2grQR5BvCA2Goj4GVOOPPa0xoFiAA/u+sclCSnhC4= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6566.eurprd04.prod.outlook.com (20.179.246.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Mon, 11 Mar 2019 09:30:02 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:30:02 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 01/28] PCI: mobiveil: uniform the register accessors Thread-Topic: [PATCHv4 01/28] PCI: mobiveil: uniform the register accessors Thread-Index: AQHU1+0BBNORWVrUZ0+v4hE1WHV25w== Date: Mon, 11 Mar 2019 09:30:02 +0000 Message-ID: <20190311093130.7209-2-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b160cbb3-cc92-4377-378d-08d6a6042359 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6566; x-ms-traffictypediagnostic: AM6PR04MB6566: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6566; 23:BAxY8B1hVHXDu4RX92CDP7ISAIYVjdYs/RP34tE?= =?iso-8859-1?q?BTtt8i/5uYDFfNk?= =?iso-8859-1?q?0TQyVdb6Su9cMAh+Rf8jrbkpkEERM3JkQidnxgepfQ4oZNq8mzlt1cCVDcWh?= =?iso-8859-1?q?RC5Ua06dkX603dxbPRwFe9FEsGa0sn9czWXvMN10hTmRfC/JIeEI/i/rDLzg?= =?iso-8859-1?q?XIbB1F21qTLauPY1CvENVy1xHd/t8NUQZlTBzkcskmF0cJ+HbsDWawUm8upJ?= =?iso-8859-1?q?l9c30HIXdSobUXdLby2Z59+ztQeAx0339ao0zLzUPL07B3ECXF/bQhrPSeTs?= =?iso-8859-1?q?ZlJeCY8OtDIRLkTfnQ3V944RsX98CPPw8ABAXh/wFsG0C1RbLLHEMx74+L4c?= =?iso-8859-1?q?UMpnrCU+BWoD5JU90I6J17+tVfnc3aE8G+VC52pXAu/ZLMKiGocqhRXAwAno?= =?iso-8859-1?q?Vgfi7LHvkYUBEYReAX0xFmZMU9moJsi1Soxz827ml84E9V0uHtlfYpotzmcO?= =?iso-8859-1?q?FQUkEoLCd61TdS9I+v0ghYnpUDq3Zi1WqCdqWOlBPxeIuiSkoUutIlbOeYYH?= =?iso-8859-1?q?aFKSGlZrSOM5H68E/Cl9egTb1jJxkL6M7GXsh8SBurdTkd7YUoSNsK1JELRd?= =?iso-8859-1?q?iw8ZbX6+sNRcxEphqpd5sjmgo4qFEicX7Dse9YCmE3KVi7SUCEJwJyM72qdJ?= =?iso-8859-1?q?pz5zIJPal0SRBr0y9TBdEmNDDnieYFZxOx1juXlbleWR/pKm9HOozr1Jgv/1?= =?iso-8859-1?q?soOcejgOriYP/64NIpjrhJSzowyDfafQSE2oRN+23tkoJcM1vtS6yTmLa7mo?= =?iso-8859-1?q?rn3+fiLCdrNInct+8wf1vMqMSITuu1mRsn2j0N1JEg6DZT3ztFc6YTHCjyvj?= =?iso-8859-1?q?r+FiZy3Nc6lg++lALowkVKGYbzWbJiNd32rH+DiXkIrsO5S10hnHg0lfe8Jq?= =?iso-8859-1?q?4psfJjY4NqevDwE/r0noJyr/l0RvsZKAx0H72RYTkBJy2Amsu/h+yUL1UAWh?= =?iso-8859-1?q?cVKwFdb0+TpX2vvyE+5fStTaKTizu0J9TVijuWm7G86rmOWKCBuazjbkNf5f?= =?iso-8859-1?q?OPVJLU5hOb929EiLJwKsy+cpRt8ftYp4w4luZ9NsnujXSJyxbf1ocRv8t1K9?= =?iso-8859-1?q?5vWBO5vCFoWfI6MVr7RuRbIx07YuQp1rkbkIFTfEwxyOMqGTiM5WUQXFnoei?= =?iso-8859-1?q?7ESsTAEjzY7y1uOViB3zHfG+/q/JfHNgok9Gpt8L3nq0FG6hm2bIT0vdT7ev?= =?iso-8859-1?q?+vGfuXIGu+7ZAezE+wZb9HlWHXTK3zeaRrcoJe9Zg84o36dS4+wQDRW6H/So?= =?iso-8859-1?q?KzmgwoKFPDqMPWnFdKdh66eFRNegj5cbKRMoU1xJ10hPn3FwlePaRyp0su2R?= =?iso-8859-1?q?9WQ30K5SA=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39860400002)(346002)(376002)(136003)(199004)(189003)(6436002)(478600001)(25786009)(99286004)(11346002)(2616005)(476003)(76176011)(3846002)(6116002)(81166006)(81156014)(486006)(71190400001)(71200400001)(2906002)(8676002)(2201001)(5660300002)(97736004)(6486002)(446003)(7416002)(2501003)(86362001)(14444005)(256004)(14454004)(316002)(68736007)(26005)(8936002)(6512007)(53936002)(1076003)(66066001)(386003)(54906003)(50226002)(110136005)(102836004)(6506007)(36756003)(105586002)(4326008)(106356001)(186003)(305945005)(52116002)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6566; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: n8OeOsNT5K1phIae9yygYskLi5M9R7DQppw+NpDD1bc21te6Tn4HM2vwIJPp7iBeIxA36l50tU6bcGXSn9pTr06CFjxnDjEmxkO+qt1SCKX7Jm0FTFvizI/BfRbmF4HRVPYBMWLyMuMq6+w1B+Aqa6mfbUrCwWLSjfzBHUWLdizRFRX3KCrkrABWGcfg7I3MXv35u18aaptAo/SheYj0gJtjdBOKmskz2IOMw/ntWmOtXcrsAGkRhp8qtXgT/r8KJvnEGH6FfUudxOzzRM8LAEAJN+Owqbl3BcTcVc/y2tN8ARI17TEuxsJMHCBkdU78u/qxU2I5yPj20cf5nUC2zPG/W8FgEZ0S+tqA5DHXHzE/6l54ikgO1E9AtRrSOH3B3D4WGIV4j7ujLc51WCOcTn6JdOiY7Mq6Z8DcVR8GvwQ= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b160cbb3-cc92-4377-378d-08d6a6042359 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:30:02.6626 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023006_717638_A9F90994 X-CRM114-Status: GOOD ( 15.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang It's confused that R/W some registers by csr_readl()/csr_writel(), while others by read_paged_register()/write_paged_register(). Actually the low 3KB of 4KB PCIe configure space can be accessed directly and high 1KB is paging area. So this patch uniformed the register accessors to csr_readl() and csr_writel() by comparing the register offset with page access boundary 3KB in the accessor internal. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 179 +++++++++++++++++-------- 1 file changed, 124 insertions(+), 55 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index 77052a0712d0..d55c7e780c6e 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -47,7 +47,6 @@ #define PAGE_SEL_SHIFT 13 #define PAGE_SEL_MASK 0x3f #define PAGE_LO_MASK 0x3ff -#define PAGE_SEL_EN 0xc00 #define PAGE_SEL_OFFSET_SHIFT 10 #define PAB_AXI_PIO_CTRL 0x0840 @@ -117,6 +116,12 @@ #define LINK_WAIT_MIN 90000 #define LINK_WAIT_MAX 100000 +#define PAGED_ADDR_BNDRY 0xc00 +#define OFFSET_TO_PAGE_ADDR(off) \ + ((off & PAGE_LO_MASK) | PAGED_ADDR_BNDRY) +#define OFFSET_TO_PAGE_IDX(off) \ + ((off >> PAGE_SEL_OFFSET_SHIFT) & PAGE_SEL_MASK) + struct mobiveil_msi { /* MSI information */ struct mutex lock; /* protect bitmap variable */ struct irq_domain *msi_domain; @@ -145,15 +150,119 @@ struct mobiveil_pcie { struct mobiveil_msi msi; }; -static inline void csr_writel(struct mobiveil_pcie *pcie, const u32 value, - const u32 reg) +/* + * mobiveil_pcie_sel_page - routine to access paged register + * + * Registers whose address greater than PAGED_ADDR_BNDRY (0xc00) are paged, + * for this scheme to work extracted higher 6 bits of the offset will be + * written to pg_sel field of PAB_CTRL register and rest of the lower 10 + * bits enabled with PAGED_ADDR_BNDRY are used as offset of the register. + */ +static void mobiveil_pcie_sel_page(struct mobiveil_pcie *pcie, u8 pg_idx) { - writel_relaxed(value, pcie->csr_axi_slave_base + reg); + u32 val; + + val = readl(pcie->csr_axi_slave_base + PAB_CTRL); + val &= ~(PAGE_SEL_MASK << PAGE_SEL_SHIFT); + val |= (pg_idx & PAGE_SEL_MASK) << PAGE_SEL_SHIFT; + + writel(val, pcie->csr_axi_slave_base + PAB_CTRL); } -static inline u32 csr_readl(struct mobiveil_pcie *pcie, const u32 reg) +static void *mobiveil_pcie_comp_addr(struct mobiveil_pcie *pcie, u32 off) { - return readl_relaxed(pcie->csr_axi_slave_base + reg); + if (off < PAGED_ADDR_BNDRY) { + /* For directly accessed registers, clear the pg_sel field */ + mobiveil_pcie_sel_page(pcie, 0); + return pcie->csr_axi_slave_base + off; + } + + mobiveil_pcie_sel_page(pcie, OFFSET_TO_PAGE_IDX(off)); + return pcie->csr_axi_slave_base + OFFSET_TO_PAGE_ADDR(off); +} + +static int mobiveil_pcie_read(void __iomem *addr, int size, u32 *val) +{ + if ((uintptr_t)addr & (size - 1)) { + *val = 0; + return PCIBIOS_BAD_REGISTER_NUMBER; + } + + switch (size) { + case 4: + *val = readl(addr); + break; + case 2: + *val = readw(addr); + break; + case 1: + *val = readb(addr); + break; + default: + *val = 0; + return PCIBIOS_BAD_REGISTER_NUMBER; + } + + return PCIBIOS_SUCCESSFUL; +} + +static int mobiveil_pcie_write(void __iomem *addr, int size, u32 val) +{ + if ((uintptr_t)addr & (size - 1)) + return PCIBIOS_BAD_REGISTER_NUMBER; + + switch (size) { + case 4: + writel(val, addr); + break; + case 2: + writew(val, addr); + break; + case 1: + writeb(val, addr); + break; + default: + return PCIBIOS_BAD_REGISTER_NUMBER; + } + + return PCIBIOS_SUCCESSFUL; +} + +static u32 csr_read(struct mobiveil_pcie *pcie, u32 off, size_t size) +{ + void *addr; + u32 val; + int ret; + + addr = mobiveil_pcie_comp_addr(pcie, off); + + ret = mobiveil_pcie_read(addr, size, &val); + if (ret) + dev_err(&pcie->pdev->dev, "read CSR address failed\n"); + + return val; +} + +static void csr_write(struct mobiveil_pcie *pcie, u32 val, u32 off, size_t size) +{ + void *addr; + int ret; + + addr = mobiveil_pcie_comp_addr(pcie, off); + + ret = mobiveil_pcie_write(addr, size, val); + if (ret) + dev_err(&pcie->pdev->dev, "write CSR address failed\n"); +} + +static u32 csr_readl(struct mobiveil_pcie *pcie, u32 off) +{ + return csr_read(pcie, off, 0x4); +} + +static void csr_writel(struct mobiveil_pcie *pcie, u32 val, u32 off) +{ + csr_write(pcie, val, off, 0x4); } static bool mobiveil_pcie_link_up(struct mobiveil_pcie *pcie) @@ -342,45 +451,6 @@ static int mobiveil_pcie_parse_dt(struct mobiveil_pcie *pcie) return 0; } -/* - * select_paged_register - routine to access paged register of root complex - * - * registers of RC are paged, for this scheme to work - * extracted higher 6 bits of the offset will be written to pg_sel - * field of PAB_CTRL register and rest of the lower 10 bits enabled with - * PAGE_SEL_EN are used as offset of the register. - */ -static void select_paged_register(struct mobiveil_pcie *pcie, u32 offset) -{ - int pab_ctrl_dw, pg_sel; - - /* clear pg_sel field */ - pab_ctrl_dw = csr_readl(pcie, PAB_CTRL); - pab_ctrl_dw = (pab_ctrl_dw & ~(PAGE_SEL_MASK << PAGE_SEL_SHIFT)); - - /* set pg_sel field */ - pg_sel = (offset >> PAGE_SEL_OFFSET_SHIFT) & PAGE_SEL_MASK; - pab_ctrl_dw |= ((pg_sel << PAGE_SEL_SHIFT)); - csr_writel(pcie, pab_ctrl_dw, PAB_CTRL); -} - -static void write_paged_register(struct mobiveil_pcie *pcie, - u32 val, u32 offset) -{ - u32 off = (offset & PAGE_LO_MASK) | PAGE_SEL_EN; - - select_paged_register(pcie, offset); - csr_writel(pcie, val, off); -} - -static u32 read_paged_register(struct mobiveil_pcie *pcie, u32 offset) -{ - u32 off = (offset & PAGE_LO_MASK) | PAGE_SEL_EN; - - select_paged_register(pcie, offset); - return csr_readl(pcie, off); -} - static void program_ib_windows(struct mobiveil_pcie *pcie, int win_num, int pci_addr, u32 type, u64 size) { @@ -397,19 +467,19 @@ static void program_ib_windows(struct mobiveil_pcie *pcie, int win_num, pio_ctrl_val = csr_readl(pcie, PAB_PEX_PIO_CTRL); csr_writel(pcie, pio_ctrl_val | (1 << PIO_ENABLE_SHIFT), PAB_PEX_PIO_CTRL); - amap_ctrl_dw = read_paged_register(pcie, PAB_PEX_AMAP_CTRL(win_num)); + amap_ctrl_dw = csr_readl(pcie, PAB_PEX_AMAP_CTRL(win_num)); amap_ctrl_dw = (amap_ctrl_dw | (type << AMAP_CTRL_TYPE_SHIFT)); amap_ctrl_dw = (amap_ctrl_dw | (1 << AMAP_CTRL_EN_SHIFT)); - write_paged_register(pcie, amap_ctrl_dw | lower_32_bits(size64), - PAB_PEX_AMAP_CTRL(win_num)); + csr_writel(pcie, amap_ctrl_dw | lower_32_bits(size64), + PAB_PEX_AMAP_CTRL(win_num)); - write_paged_register(pcie, upper_32_bits(size64), - PAB_EXT_PEX_AMAP_SIZEN(win_num)); + csr_writel(pcie, upper_32_bits(size64), + PAB_EXT_PEX_AMAP_SIZEN(win_num)); - write_paged_register(pcie, pci_addr, PAB_PEX_AMAP_AXI_WIN(win_num)); - write_paged_register(pcie, pci_addr, PAB_PEX_AMAP_PEX_WIN_L(win_num)); - write_paged_register(pcie, 0, PAB_PEX_AMAP_PEX_WIN_H(win_num)); + csr_writel(pcie, pci_addr, PAB_PEX_AMAP_AXI_WIN(win_num)); + csr_writel(pcie, pci_addr, PAB_PEX_AMAP_PEX_WIN_L(win_num)); + csr_writel(pcie, 0, PAB_PEX_AMAP_PEX_WIN_H(win_num)); } /* @@ -437,8 +507,7 @@ static void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, csr_writel(pcie, 1 << WIN_ENABLE_SHIFT | type << WIN_TYPE_SHIFT | lower_32_bits(size64), PAB_AXI_AMAP_CTRL(win_num)); - write_paged_register(pcie, upper_32_bits(size64), - PAB_EXT_AXI_AMAP_SIZE(win_num)); + csr_writel(pcie, upper_32_bits(size64), PAB_EXT_AXI_AMAP_SIZE(win_num)); /* * program AXI window base with appropriate value in From patchwork Mon Mar 11 09:30:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CBBCB139A for ; Mon, 11 Mar 2019 09:30:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B052928E98 for ; Mon, 11 Mar 2019 09:30:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A29A028E96; Mon, 11 Mar 2019 09:30:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6DD8E28FB6 for ; Mon, 11 Mar 2019 09:30:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1STLu8Qn2DdTQs/PA8vjOUWdS20q49/j/ApBBLzeF34=; b=HsmRJHG5NGdr39 qtbFNtbGX8oKZT1QUR0pRDAOJXmRbz8Lk8TaeMjGkXHACr3BcH4JBZWixn5kRRDBX2MbjdFiBm+01 ypMnLRAdVREWem+LtJkQwsUF52zH05Xw54IUPg+cKj99cGTmODsrBHBgd8ptIKq/+iZ/iy+WW19wD 1zfA8jFrRoWkJCHBz9yF2qqczvIeGPy1+2j1Ei4s5biiVn7B58UlBf6zF035Pwo+U06hToRNJM80s 5zJ4UOB6B1VDmBSmhIdEhFCDU3XUIUknKjA9NqTwdjzlOA8uzkrdNWCia0LCJm1uv+SfPHDDmbpVA ekdv8gLhu5GNcpnVXJxA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HGW-0000QC-OA; Mon, 11 Mar 2019 09:30:36 +0000 Received: from mail-he1eur01on0629.outbound.protection.outlook.com ([2a01:111:f400:fe1e::629] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HGC-0008Px-Dg for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:30:26 +0000 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=cezUt4WeCfbYhipGj2NEot4mc4h1ZS+wGxlICJH4nhw=; b=NW2LyKvBtcrEDC4h87du3xu3Sunp2z3Yt/C+tcsMZSQS57nzEWq3h2H6TjMRdcfo/obXRxEeiy+pZsiMCojfw5PwZwIyEwajkUwqkm/WE2eqynFPI2hwM8nGIZJWswdIseb9UY94a9SZkb8mXS6s09+vOsfWo6OA8OS8UjZU+uE= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB5592.eurprd04.prod.outlook.com (20.178.87.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Mon, 11 Mar 2019 09:30:12 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:30:12 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 02/28] PCI: mobiveil: format the code without function change Thread-Topic: [PATCHv4 02/28] PCI: mobiveil: format the code without function change Thread-Index: AQHU1+0GtNDXcg9tSEi+CjVKim1H0Q== Date: Mon, 11 Mar 2019 09:30:12 +0000 Message-ID: <20190311093130.7209-3-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: feaaea6d-ba08-481a-fac8-08d6a604276d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB5592; x-ms-traffictypediagnostic: AM6PR04MB5592: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB5592; 23:t+BH8e9V5HiMFmu4qKsWVMJsZ7VRcWEetyp84ti?= =?iso-8859-1?q?XUiOB5dvDbdp/d6?= =?iso-8859-1?q?x2uODF1/enOMHjk+oEBQa7GWmQoRNb8LGnOFQ+Ref26P/WERA8JrFe5rcTog?= =?iso-8859-1?q?zpapNr3A7/N+hVf/h6fQalrGfHlSeQkZF158blzVlJe4oE5JPIB/FEUmnJST?= =?iso-8859-1?q?rdmMOKxgjBcbIeT4IxhHK/rbzArzia5T2Va3ijn99/EUzCBC1v/pZ1ONMYeG?= =?iso-8859-1?q?nTwRhikbUSAvexnjgWwMY6TbDdPIyYfR3k4Fcw7f/GGBKCUjt+/VeiA0bPZ9?= =?iso-8859-1?q?7X5ROPsbFumPvmyLUqV+82bTOmE0v3GAtPFm+jwPiHxwrKbphXZcfQczcKQm?= =?iso-8859-1?q?vViO+wDHuN0saZ7GVlPY/akj3241ZGFLejrE3LTl+vBi3bKkAi0hmdOtoSKp?= =?iso-8859-1?q?qDf5R5YLsXiCRtZPRVGe2A5K/iA/hdR0o/omSyMNCmm0MwDju1hxaBfkzyrB?= =?iso-8859-1?q?S3O4OkAYynR07DZJ4E62Wa7Vj+7tC27szeIFnasmrmkAvDVUjzEeeGBERogQ?= =?iso-8859-1?q?RAOI89ZvfE02dmDMyOHicNa5mLvGntxngylOG/aiCxzlhjcQ0nLkPRJzI5We?= =?iso-8859-1?q?T5/wIYFsLs3U+aID9+Au6HSVl9CIhZqDvWX7Unt8plwk8i3ydKfrawgg/E0V?= =?iso-8859-1?q?9UYL/W4vaoTJsJNw08JHrNQt/UnDrvV8o3+0gSfFlt+uLH1xiTW68GhhXkJH?= =?iso-8859-1?q?KebRCVEXV7DE7X94cGQTwiGE6JYsJ6SwwpwA3aLojR1HxoOJYDLsFxlZjW7r?= =?iso-8859-1?q?OKcQNjkLoUtgZOjaa/DAIuasWtyKqVx6tS0qO+Pkbd7U7CRBTPiAQtkGebNu?= =?iso-8859-1?q?HUgFkg2CScgSucj7AtOCgCiI24fbN07txklTYcMzlm8zmyEVIKyoZKWn088T?= =?iso-8859-1?q?3QhI5S7hxHKIo6km3V5TrqUOIVBzvh6Ksd169wkWKGvqUiW2+n7AvuQWF6dn?= =?iso-8859-1?q?eFEBexpIxkELyFh9pzN071Ciolm1/BzUyJ1QQeSrwjaCg34MixhmnRvC6TGu?= =?iso-8859-1?q?mT9eCBXjhpdjvIAC5jp8miA8MMk1lPzPx9keu03c7IYSnAmONCN2GVaOFxpK?= =?iso-8859-1?q?cQ7eQxIU9bfK6etESNsey6ewzYNYQd9OcY6Jnu1BtUySbWrC2/5u+Xlp5aDG?= =?iso-8859-1?q?HITW8g3Iy4cDLxiffdp43+vWsffLtUjCEFe7Lrko//yLqLRYSeIQZL8U35mu?= =?iso-8859-1?q?RHedfap9yInbyTF7ac08o1IDEbW5bUGnRnIXZ2mIlCWwAyAfE5Oa65POjOnN?= =?iso-8859-1?q?oiNTv1rbCTmpvyqn/NeAgQU4w/QrV+cTQaNFp0eRQXv1rUTQk/CYB73V1uw5?= =?iso-8859-1?q?vANGn+ClM/fVwbkSbW/BW4JaSVCcaDhOlXP/xJ/dbMQb1ygazfaNfD5qfkEf?= =?iso-8859-1?q?vu/SkpdziaAGo=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(376002)(136003)(39860400002)(199004)(189003)(5660300002)(30864003)(4326008)(2201001)(8676002)(478600001)(81166006)(81156014)(14454004)(86362001)(8936002)(50226002)(7416002)(14444005)(256004)(1076003)(71200400001)(71190400001)(2616005)(476003)(486006)(11346002)(446003)(186003)(305945005)(7736002)(97736004)(68736007)(66066001)(36756003)(6486002)(105586002)(53946003)(106356001)(6436002)(6512007)(110136005)(76176011)(54906003)(52116002)(99286004)(26005)(386003)(6506007)(3846002)(316002)(6116002)(102836004)(6346003)(25786009)(53936002)(2906002)(2501003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB5592; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 9Y5QrI+BPC3laxZF9uXHiCHTGr+FDtljSYKK2ItIK+dWuxMzbvBfGzFV9o0lrhWC3hcptxy5BL+tpXtUHrQz40to1033FtcFxHxS24knVzq73qZDJq1IQXYTG6NqS7B4Hzu28AoEYHQVEmD+sfx2PMr/W/0k3wZJ+jo7UHUmp7m2KAzzV4SMQOSF4tkux4bN0/qujJ5P6FCtgCBih6d1wNLjTekQDA+ZSFu0I5gBfoVPIKlqKnGDoq6tuzeVJKZqAvRvcHLEvFWWb3maEY3GovqGAFZ+3X4Ud8pEKP+FNXR72+yQGCWIo1d5QwIqQ6wKNIj962pzsvDk+IwWK2CTC08/itFTiNNYPHu7UuWcnySAL1O5/2gnJlzdDRAUMZnsPEG9bHl0xMeJCqMNDYvAwza7VJiHIZnhQPEpnuuCjO8= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: feaaea6d-ba08-481a-fac8-08d6a604276d X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:30:12.3006 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB5592 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023016_901501_BC0ED324 X-CRM114-Status: GOOD ( 14.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang Just format the code without functionality change. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 261 +++++++++++++------------ 1 file changed, 137 insertions(+), 124 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index d55c7e780c6e..b87471f08a40 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -31,38 +31,40 @@ * translation tables are grouped into windows, each window registers are * grouped into blocks of 4 or 16 registers each */ -#define PAB_REG_BLOCK_SIZE 16 -#define PAB_EXT_REG_BLOCK_SIZE 4 +#define PAB_REG_BLOCK_SIZE 16 +#define PAB_EXT_REG_BLOCK_SIZE 4 -#define PAB_REG_ADDR(offset, win) (offset + (win * PAB_REG_BLOCK_SIZE)) -#define PAB_EXT_REG_ADDR(offset, win) (offset + (win * PAB_EXT_REG_BLOCK_SIZE)) +#define PAB_REG_ADDR(offset, win) \ + (offset + (win * PAB_REG_BLOCK_SIZE)) +#define PAB_EXT_REG_ADDR(offset, win) \ + (offset + (win * PAB_EXT_REG_BLOCK_SIZE)) -#define LTSSM_STATUS 0x0404 -#define LTSSM_STATUS_L0_MASK 0x3f -#define LTSSM_STATUS_L0 0x2d +#define LTSSM_STATUS 0x0404 +#define LTSSM_STATUS_L0_MASK 0x3f +#define LTSSM_STATUS_L0 0x2d -#define PAB_CTRL 0x0808 -#define AMBA_PIO_ENABLE_SHIFT 0 -#define PEX_PIO_ENABLE_SHIFT 1 -#define PAGE_SEL_SHIFT 13 -#define PAGE_SEL_MASK 0x3f -#define PAGE_LO_MASK 0x3ff -#define PAGE_SEL_OFFSET_SHIFT 10 +#define PAB_CTRL 0x0808 +#define AMBA_PIO_ENABLE_SHIFT 0 +#define PEX_PIO_ENABLE_SHIFT 1 +#define PAGE_SEL_SHIFT 13 +#define PAGE_SEL_MASK 0x3f +#define PAGE_LO_MASK 0x3ff +#define PAGE_SEL_OFFSET_SHIFT 10 -#define PAB_AXI_PIO_CTRL 0x0840 -#define APIO_EN_MASK 0xf +#define PAB_AXI_PIO_CTRL 0x0840 +#define APIO_EN_MASK 0xf -#define PAB_PEX_PIO_CTRL 0x08c0 -#define PIO_ENABLE_SHIFT 0 +#define PAB_PEX_PIO_CTRL 0x08c0 +#define PIO_ENABLE_SHIFT 0 #define PAB_INTP_AMBA_MISC_ENB 0x0b0c -#define PAB_INTP_AMBA_MISC_STAT 0x0b1c +#define PAB_INTP_AMBA_MISC_STAT 0x0b1c #define PAB_INTP_INTX_MASK 0x01e0 #define PAB_INTP_MSI_MASK 0x8 -#define PAB_AXI_AMAP_CTRL(win) PAB_REG_ADDR(0x0ba0, win) -#define WIN_ENABLE_SHIFT 0 -#define WIN_TYPE_SHIFT 1 +#define PAB_AXI_AMAP_CTRL(win) PAB_REG_ADDR(0x0ba0, win) +#define WIN_ENABLE_SHIFT 0 +#define WIN_TYPE_SHIFT 1 #define PAB_EXT_AXI_AMAP_SIZE(win) PAB_EXT_REG_ADDR(0xbaf0, win) @@ -70,16 +72,16 @@ #define AXI_WINDOW_ALIGN_MASK 3 #define PAB_AXI_AMAP_PEX_WIN_L(win) PAB_REG_ADDR(0x0ba8, win) -#define PAB_BUS_SHIFT 24 -#define PAB_DEVICE_SHIFT 19 -#define PAB_FUNCTION_SHIFT 16 +#define PAB_BUS_SHIFT 24 +#define PAB_DEVICE_SHIFT 19 +#define PAB_FUNCTION_SHIFT 16 #define PAB_AXI_AMAP_PEX_WIN_H(win) PAB_REG_ADDR(0x0bac, win) #define PAB_INTP_AXI_PIO_CLASS 0x474 -#define PAB_PEX_AMAP_CTRL(win) PAB_REG_ADDR(0x4ba0, win) -#define AMAP_CTRL_EN_SHIFT 0 -#define AMAP_CTRL_TYPE_SHIFT 1 +#define PAB_PEX_AMAP_CTRL(win) PAB_REG_ADDR(0x4ba0, win) +#define AMAP_CTRL_EN_SHIFT 0 +#define AMAP_CTRL_TYPE_SHIFT 1 #define PAB_EXT_PEX_AMAP_SIZEN(win) PAB_EXT_REG_ADDR(0xbef0, win) #define PAB_PEX_AMAP_AXI_WIN(win) PAB_REG_ADDR(0x4ba4, win) @@ -87,39 +89,39 @@ #define PAB_PEX_AMAP_PEX_WIN_H(win) PAB_REG_ADDR(0x4bac, win) /* starting offset of INTX bits in status register */ -#define PAB_INTX_START 5 +#define PAB_INTX_START 5 /* supported number of MSI interrupts */ -#define PCI_NUM_MSI 16 +#define PCI_NUM_MSI 16 /* MSI registers */ -#define MSI_BASE_LO_OFFSET 0x04 -#define MSI_BASE_HI_OFFSET 0x08 -#define MSI_SIZE_OFFSET 0x0c -#define MSI_ENABLE_OFFSET 0x14 -#define MSI_STATUS_OFFSET 0x18 -#define MSI_DATA_OFFSET 0x20 -#define MSI_ADDR_L_OFFSET 0x24 -#define MSI_ADDR_H_OFFSET 0x28 +#define MSI_BASE_LO_OFFSET 0x04 +#define MSI_BASE_HI_OFFSET 0x08 +#define MSI_SIZE_OFFSET 0x0c +#define MSI_ENABLE_OFFSET 0x14 +#define MSI_STATUS_OFFSET 0x18 +#define MSI_DATA_OFFSET 0x20 +#define MSI_ADDR_L_OFFSET 0x24 +#define MSI_ADDR_H_OFFSET 0x28 /* outbound and inbound window definitions */ -#define WIN_NUM_0 0 -#define WIN_NUM_1 1 -#define CFG_WINDOW_TYPE 0 -#define IO_WINDOW_TYPE 1 -#define MEM_WINDOW_TYPE 2 -#define IB_WIN_SIZE ((u64)256 * 1024 * 1024 * 1024) -#define MAX_PIO_WINDOWS 8 +#define WIN_NUM_0 0 +#define WIN_NUM_1 1 +#define CFG_WINDOW_TYPE 0 +#define IO_WINDOW_TYPE 1 +#define MEM_WINDOW_TYPE 2 +#define IB_WIN_SIZE ((u64)256 * 1024 * 1024 * 1024) +#define MAX_PIO_WINDOWS 8 /* Parameters for the waiting for link up routine */ -#define LINK_WAIT_MAX_RETRIES 10 -#define LINK_WAIT_MIN 90000 -#define LINK_WAIT_MAX 100000 +#define LINK_WAIT_MAX_RETRIES 10 +#define LINK_WAIT_MIN 90000 +#define LINK_WAIT_MAX 100000 -#define PAGED_ADDR_BNDRY 0xc00 -#define OFFSET_TO_PAGE_ADDR(off) \ +#define PAGED_ADDR_BNDRY 0xc00 +#define OFFSET_TO_PAGE_ADDR(off) \ ((off & PAGE_LO_MASK) | PAGED_ADDR_BNDRY) -#define OFFSET_TO_PAGE_IDX(off) \ +#define OFFSET_TO_PAGE_IDX(off) \ ((off >> PAGE_SEL_OFFSET_SHIFT) & PAGE_SEL_MASK) struct mobiveil_msi { /* MSI information */ @@ -297,14 +299,14 @@ static void __iomem *mobiveil_pcie_map_bus(struct pci_bus *bus, unsigned int devfn, int where) { struct mobiveil_pcie *pcie = bus->sysdata; + u32 value; if (!mobiveil_pcie_valid_device(bus, devfn)) return NULL; - if (bus->number == pcie->root_bus_nr) { - /* RC config access */ + /* RC config access */ + if (bus->number == pcie->root_bus_nr) return pcie->csr_axi_slave_base + where; - } /* * EP config access (in Config/APIO space) @@ -312,10 +314,12 @@ static void __iomem *mobiveil_pcie_map_bus(struct pci_bus *bus, * (BDF) in PAB_AXI_AMAP_PEX_WIN_L0 Register. * Relies on pci_lock serialization */ - csr_writel(pcie, bus->number << PAB_BUS_SHIFT | - PCI_SLOT(devfn) << PAB_DEVICE_SHIFT | - PCI_FUNC(devfn) << PAB_FUNCTION_SHIFT, - PAB_AXI_AMAP_PEX_WIN_L(WIN_NUM_0)); + value = bus->number << PAB_BUS_SHIFT | + PCI_SLOT(devfn) << PAB_DEVICE_SHIFT | + PCI_FUNC(devfn) << PAB_FUNCTION_SHIFT; + + csr_writel(pcie, value, PAB_AXI_AMAP_PEX_WIN_L(WIN_NUM_0)); + return pcie->config_axi_slave_base + where; } @@ -350,22 +354,22 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) /* Handle INTx */ if (intr_status & PAB_INTP_INTX_MASK) { - shifted_status = csr_readl(pcie, PAB_INTP_AMBA_MISC_STAT) >> - PAB_INTX_START; + shifted_status = csr_readl(pcie, PAB_INTP_AMBA_MISC_STAT); + shifted_status >>= PAB_INTX_START; do { for_each_set_bit(bit, &shifted_status, PCI_NUM_INTX) { virq = irq_find_mapping(pcie->intx_domain, - bit + 1); + bit + 1); if (virq) generic_handle_irq(virq); else - dev_err_ratelimited(dev, - "unexpected IRQ, INT%d\n", bit); + dev_err_ratelimited(dev, "unexpected IRQ, INT%d\n", + bit); /* clear interrupt */ csr_writel(pcie, - shifted_status << PAB_INTX_START, - PAB_INTP_AMBA_MISC_STAT); + shifted_status << PAB_INTX_START, + PAB_INTP_AMBA_MISC_STAT); } } while ((shifted_status >> PAB_INTX_START) != 0); } @@ -375,8 +379,7 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) /* handle MSI interrupts */ while (msi_status & 1) { - msi_data = readl_relaxed(pcie->apb_csr_base - + MSI_DATA_OFFSET); + msi_data = readl_relaxed(pcie->apb_csr_base + MSI_DATA_OFFSET); /* * MSI_STATUS_OFFSET register gets updated to zero @@ -385,18 +388,18 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) * two dummy reads. */ msi_addr_lo = readl_relaxed(pcie->apb_csr_base + - MSI_ADDR_L_OFFSET); + MSI_ADDR_L_OFFSET); msi_addr_hi = readl_relaxed(pcie->apb_csr_base + - MSI_ADDR_H_OFFSET); + MSI_ADDR_H_OFFSET); dev_dbg(dev, "MSI registers, data: %08x, addr: %08x:%08x\n", - msi_data, msi_addr_hi, msi_addr_lo); + msi_data, msi_addr_hi, msi_addr_lo); virq = irq_find_mapping(msi->dev_domain, msi_data); if (virq) generic_handle_irq(virq); msi_status = readl_relaxed(pcie->apb_csr_base + - MSI_STATUS_OFFSET); + MSI_STATUS_OFFSET); } /* Clear the interrupt status */ @@ -413,7 +416,7 @@ static int mobiveil_pcie_parse_dt(struct mobiveil_pcie *pcie) /* map config resource */ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, - "config_axi_slave"); + "config_axi_slave"); pcie->config_axi_slave_base = devm_pci_remap_cfg_resource(dev, res); if (IS_ERR(pcie->config_axi_slave_base)) return PTR_ERR(pcie->config_axi_slave_base); @@ -421,7 +424,7 @@ static int mobiveil_pcie_parse_dt(struct mobiveil_pcie *pcie) /* map csr resource */ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, - "csr_axi_slave"); + "csr_axi_slave"); pcie->csr_axi_slave_base = devm_pci_remap_cfg_resource(dev, res); if (IS_ERR(pcie->csr_axi_slave_base)) return PTR_ERR(pcie->csr_axi_slave_base); @@ -452,7 +455,7 @@ static int mobiveil_pcie_parse_dt(struct mobiveil_pcie *pcie) } static void program_ib_windows(struct mobiveil_pcie *pcie, int win_num, - int pci_addr, u32 type, u64 size) + int pci_addr, u32 type, u64 size) { int pio_ctrl_val; int amap_ctrl_dw; @@ -465,19 +468,20 @@ static void program_ib_windows(struct mobiveil_pcie *pcie, int win_num, } pio_ctrl_val = csr_readl(pcie, PAB_PEX_PIO_CTRL); - csr_writel(pcie, - pio_ctrl_val | (1 << PIO_ENABLE_SHIFT), PAB_PEX_PIO_CTRL); - amap_ctrl_dw = csr_readl(pcie, PAB_PEX_AMAP_CTRL(win_num)); - amap_ctrl_dw = (amap_ctrl_dw | (type << AMAP_CTRL_TYPE_SHIFT)); - amap_ctrl_dw = (amap_ctrl_dw | (1 << AMAP_CTRL_EN_SHIFT)); + pio_ctrl_val |= 1 << PIO_ENABLE_SHIFT; + csr_writel(pcie, pio_ctrl_val, PAB_PEX_PIO_CTRL); - csr_writel(pcie, amap_ctrl_dw | lower_32_bits(size64), - PAB_PEX_AMAP_CTRL(win_num)); + amap_ctrl_dw = csr_readl(pcie, PAB_PEX_AMAP_CTRL(win_num)); + amap_ctrl_dw |= (type << AMAP_CTRL_TYPE_SHIFT) | + (1 << AMAP_CTRL_EN_SHIFT) | + lower_32_bits(size64); + csr_writel(pcie, amap_ctrl_dw, PAB_PEX_AMAP_CTRL(win_num)); csr_writel(pcie, upper_32_bits(size64), PAB_EXT_PEX_AMAP_SIZEN(win_num)); csr_writel(pcie, pci_addr, PAB_PEX_AMAP_AXI_WIN(win_num)); + csr_writel(pcie, pci_addr, PAB_PEX_AMAP_PEX_WIN_L(win_num)); csr_writel(pcie, 0, PAB_PEX_AMAP_PEX_WIN_H(win_num)); } @@ -486,7 +490,8 @@ static void program_ib_windows(struct mobiveil_pcie *pcie, int win_num, * routine to program the outbound windows */ static void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, - u64 cpu_addr, u64 pci_addr, u32 config_io_bit, u64 size) + u64 cpu_addr, u64 pci_addr, + u32 config_io_bit, u64 size) { u32 value, type; @@ -505,7 +510,7 @@ static void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, type = config_io_bit; value = csr_readl(pcie, PAB_AXI_AMAP_CTRL(win_num)); csr_writel(pcie, 1 << WIN_ENABLE_SHIFT | type << WIN_TYPE_SHIFT | - lower_32_bits(size64), PAB_AXI_AMAP_CTRL(win_num)); + lower_32_bits(size64), PAB_AXI_AMAP_CTRL(win_num)); csr_writel(pcie, upper_32_bits(size64), PAB_EXT_AXI_AMAP_SIZE(win_num)); @@ -515,14 +520,14 @@ static void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, */ value = csr_readl(pcie, PAB_AXI_AMAP_AXI_WIN(win_num)); csr_writel(pcie, cpu_addr & (~AXI_WINDOW_ALIGN_MASK), - PAB_AXI_AMAP_AXI_WIN(win_num)); + PAB_AXI_AMAP_AXI_WIN(win_num)); value = csr_readl(pcie, PAB_AXI_AMAP_PEX_WIN_H(win_num)); csr_writel(pcie, lower_32_bits(pci_addr), - PAB_AXI_AMAP_PEX_WIN_L(win_num)); + PAB_AXI_AMAP_PEX_WIN_L(win_num)); csr_writel(pcie, upper_32_bits(pci_addr), - PAB_AXI_AMAP_PEX_WIN_H(win_num)); + PAB_AXI_AMAP_PEX_WIN_H(win_num)); pcie->ob_wins_configured++; } @@ -538,7 +543,9 @@ static int mobiveil_bringup_link(struct mobiveil_pcie *pcie) usleep_range(LINK_WAIT_MIN, LINK_WAIT_MAX); } + dev_err(&pcie->pdev->dev, "link never came up\n"); + return -ETIMEDOUT; } @@ -551,16 +558,16 @@ static void mobiveil_pcie_enable_msi(struct mobiveil_pcie *pcie) msi->msi_pages_phys = (phys_addr_t)msg_addr; writel_relaxed(lower_32_bits(msg_addr), - pcie->apb_csr_base + MSI_BASE_LO_OFFSET); + pcie->apb_csr_base + MSI_BASE_LO_OFFSET); writel_relaxed(upper_32_bits(msg_addr), - pcie->apb_csr_base + MSI_BASE_HI_OFFSET); + pcie->apb_csr_base + MSI_BASE_HI_OFFSET); writel_relaxed(4096, pcie->apb_csr_base + MSI_SIZE_OFFSET); writel_relaxed(1, pcie->apb_csr_base + MSI_ENABLE_OFFSET); } static int mobiveil_host_init(struct mobiveil_pcie *pcie) { - u32 value, pab_ctrl, type = 0; + u32 value, pab_ctrl, type; int err; struct resource_entry *win, *tmp; @@ -575,26 +582,27 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) * Space */ value = csr_readl(pcie, PCI_COMMAND); - csr_writel(pcie, value | PCI_COMMAND_IO | PCI_COMMAND_MEMORY | - PCI_COMMAND_MASTER, PCI_COMMAND); + value |= PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; + csr_writel(pcie, value, PCI_COMMAND); /* * program PIO Enable Bit to 1 (and PEX PIO Enable to 1) in PAB_CTRL * register */ pab_ctrl = csr_readl(pcie, PAB_CTRL); - csr_writel(pcie, pab_ctrl | (1 << AMBA_PIO_ENABLE_SHIFT) | - (1 << PEX_PIO_ENABLE_SHIFT), PAB_CTRL); + pab_ctrl |= (1 << AMBA_PIO_ENABLE_SHIFT) | (1 << PEX_PIO_ENABLE_SHIFT); + csr_writel(pcie, pab_ctrl, PAB_CTRL); csr_writel(pcie, (PAB_INTP_INTX_MASK | PAB_INTP_MSI_MASK), - PAB_INTP_AMBA_MISC_ENB); + PAB_INTP_AMBA_MISC_ENB); /* * program PIO Enable Bit to 1 and Config Window Enable Bit to 1 in * PAB_AXI_PIO_CTRL Register */ value = csr_readl(pcie, PAB_AXI_PIO_CTRL); - csr_writel(pcie, value | APIO_EN_MASK, PAB_AXI_PIO_CTRL); + value |= APIO_EN_MASK; + csr_writel(pcie, value, PAB_AXI_PIO_CTRL); /* * we'll program one outbound window for config reads and @@ -605,25 +613,25 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) /* config outbound translation window */ program_ob_windows(pcie, pcie->ob_wins_configured, - pcie->ob_io_res->start, 0, CFG_WINDOW_TYPE, - resource_size(pcie->ob_io_res)); + pcie->ob_io_res->start, 0, CFG_WINDOW_TYPE, + resource_size(pcie->ob_io_res)); /* memory inbound translation window */ program_ib_windows(pcie, WIN_NUM_1, 0, MEM_WINDOW_TYPE, IB_WIN_SIZE); /* Get the I/O and memory ranges from DT */ resource_list_for_each_entry_safe(win, tmp, &pcie->resources) { - type = 0; if (resource_type(win->res) == IORESOURCE_MEM) type = MEM_WINDOW_TYPE; - if (resource_type(win->res) == IORESOURCE_IO) + else if (resource_type(win->res) == IORESOURCE_IO) type = IO_WINDOW_TYPE; - if (type) { - /* configure outbound translation window */ - program_ob_windows(pcie, pcie->ob_wins_configured, - win->res->start, 0, type, - resource_size(win->res)); - } + else + continue; + + /* configure outbound translation window */ + program_ob_windows(pcie, pcie->ob_wins_configured, + win->res->start, 0, type, + resource_size(win->res)); } /* setup MSI hardware registers */ @@ -643,7 +651,8 @@ static void mobiveil_mask_intx_irq(struct irq_data *data) mask = 1 << ((data->hwirq + PAB_INTX_START) - 1); raw_spin_lock_irqsave(&pcie->intx_mask_lock, flags); shifted_val = csr_readl(pcie, PAB_INTP_AMBA_MISC_ENB); - csr_writel(pcie, (shifted_val & (~mask)), PAB_INTP_AMBA_MISC_ENB); + shifted_val &= ~mask; + csr_writel(pcie, shifted_val, PAB_INTP_AMBA_MISC_ENB); raw_spin_unlock_irqrestore(&pcie->intx_mask_lock, flags); } @@ -658,7 +667,8 @@ static void mobiveil_unmask_intx_irq(struct irq_data *data) mask = 1 << ((data->hwirq + PAB_INTX_START) - 1); raw_spin_lock_irqsave(&pcie->intx_mask_lock, flags); shifted_val = csr_readl(pcie, PAB_INTP_AMBA_MISC_ENB); - csr_writel(pcie, (shifted_val | mask), PAB_INTP_AMBA_MISC_ENB); + shifted_val |= mask; + csr_writel(pcie, shifted_val, PAB_INTP_AMBA_MISC_ENB); raw_spin_unlock_irqrestore(&pcie->intx_mask_lock, flags); } @@ -672,10 +682,11 @@ static struct irq_chip intx_irq_chip = { /* routine to setup the INTx related data */ static int mobiveil_pcie_intx_map(struct irq_domain *domain, unsigned int irq, - irq_hw_number_t hwirq) + irq_hw_number_t hwirq) { irq_set_chip_and_handler(irq, &intx_irq_chip, handle_level_irq); irq_set_chip_data(irq, domain->host_data); + return 0; } @@ -692,7 +703,7 @@ static struct irq_chip mobiveil_msi_irq_chip = { static struct msi_domain_info mobiveil_msi_domain_info = { .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS | - MSI_FLAG_MULTI_PCI_MSI | MSI_FLAG_PCI_MSIX), + MSI_FLAG_MULTI_PCI_MSI | MSI_FLAG_PCI_MSIX), .chip = &mobiveil_msi_irq_chip, }; @@ -710,7 +721,7 @@ static void mobiveil_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) } static int mobiveil_msi_set_affinity(struct irq_data *irq_data, - const struct cpumask *mask, bool force) + const struct cpumask *mask, bool force) { return -EINVAL; } @@ -722,7 +733,8 @@ static struct irq_chip mobiveil_msi_bottom_irq_chip = { }; static int mobiveil_irq_msi_domain_alloc(struct irq_domain *domain, - unsigned int virq, unsigned int nr_irqs, void *args) + unsigned int virq, + unsigned int nr_irqs, void *args) { struct mobiveil_pcie *pcie = domain->host_data; struct mobiveil_msi *msi = &pcie->msi; @@ -742,13 +754,13 @@ static int mobiveil_irq_msi_domain_alloc(struct irq_domain *domain, mutex_unlock(&msi->lock); irq_domain_set_info(domain, virq, bit, &mobiveil_msi_bottom_irq_chip, - domain->host_data, handle_level_irq, - NULL, NULL); + domain->host_data, handle_level_irq, NULL, NULL); return 0; } static void mobiveil_irq_msi_domain_free(struct irq_domain *domain, - unsigned int virq, unsigned int nr_irqs) + unsigned int virq, + unsigned int nr_irqs) { struct irq_data *d = irq_domain_get_irq_data(domain, virq); struct mobiveil_pcie *pcie = irq_data_get_irq_chip_data(d); @@ -756,12 +768,11 @@ static void mobiveil_irq_msi_domain_free(struct irq_domain *domain, mutex_lock(&msi->lock); - if (!test_bit(d->hwirq, msi->msi_irq_in_use)) { + if (!test_bit(d->hwirq, msi->msi_irq_in_use)) dev_err(&pcie->pdev->dev, "trying to free unused MSI#%lu\n", d->hwirq); - } else { + else __clear_bit(d->hwirq, msi->msi_irq_in_use); - } mutex_unlock(&msi->lock); } @@ -785,12 +796,14 @@ static int mobiveil_allocate_msi_domains(struct mobiveil_pcie *pcie) } msi->msi_domain = pci_msi_create_irq_domain(fwnode, - &mobiveil_msi_domain_info, msi->dev_domain); + &mobiveil_msi_domain_info, + msi->dev_domain); if (!msi->msi_domain) { dev_err(dev, "failed to create MSI domain\n"); irq_domain_remove(msi->dev_domain); return -ENOMEM; } + return 0; } @@ -801,8 +814,8 @@ static int mobiveil_pcie_init_irq_domain(struct mobiveil_pcie *pcie) int ret; /* setup INTx */ - pcie->intx_domain = irq_domain_add_linear(node, - PCI_NUM_INTX, &intx_domain_ops, pcie); + pcie->intx_domain = irq_domain_add_linear(node, PCI_NUM_INTX, + &intx_domain_ops, pcie); if (!pcie->intx_domain) { dev_err(dev, "Failed to get a INTx IRQ domain\n"); @@ -917,10 +930,10 @@ MODULE_DEVICE_TABLE(of, mobiveil_pcie_of_match); static struct platform_driver mobiveil_pcie_driver = { .probe = mobiveil_pcie_probe, .driver = { - .name = "mobiveil-pcie", - .of_match_table = mobiveil_pcie_of_match, - .suppress_bind_attrs = true, - }, + .name = "mobiveil-pcie", + .of_match_table = mobiveil_pcie_of_match, + .suppress_bind_attrs = true, + }, }; builtin_platform_driver(mobiveil_pcie_driver); From patchwork Mon Mar 11 09:30:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847031 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D4AEC17DF for ; Mon, 11 Mar 2019 09:30:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB11228E81 for ; Mon, 11 Mar 2019 09:30:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B92A728FBD; Mon, 11 Mar 2019 09:30:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 46B1928E81 for ; Mon, 11 Mar 2019 09:30:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=x1zEzjfT/Y4xua8jCIOoWIQTGE1cyD1UykXxeZZkdFY=; b=nTYf5dxP3n4n9r 2CrMr+KXqsAeCNhLB9qvCfZjwcJjJU4mmRAo2JRFmW6/AnIyaIx/LDcZlnN+3q0uk96bmKagMr1hI hkEF1ypQLn71Lkg6NmCONPo10MZWvyWY/WiQr+pPNyPLG4w6/nI5uP+c+nxbbsipOUHWIe174l6fl p0fReyj0L65IPkiCCuKmiESIlRPOrr+lq2Zz1xxRS3bx8PPdwxjdLZiUHMAW4ls5Lt4SmwVt2a+jU QMCNjrWWJ9bzDSFZvhglWa9t1UTH0J49+zUFyJwc6AUX+CzZ6aavDMUYehwIeyJPevh+8vy73MAgA DLwYA8E4QcaODB9Q1GcA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HGj-0000iO-Fc; Mon, 11 Mar 2019 09:30:49 +0000 Received: from mail-he1eur01on0629.outbound.protection.outlook.com ([2a01:111:f400:fe1e::629] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HGM-0008Px-QW for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:30:37 +0000 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=QNCN4livbs1wo+1uLQfsBQB2e+/P+52q+z6t6VPGPtc=; b=Jcp/n/EzRaghXYfrZLxVTTvgiVbi/sT64BNNDLoaJo6tUViuoweyoc5I/dC+4aR+EwoOhxQvhjZVeAzkc5V6wVXcHl5mb2gQoiEtYqDQ9CPc3S0E/po8veV0rig+DHESoQ5J59cATwbYXKp1YLdh+n1HH0DUoQXNG4qC2vZrZfs= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB5592.eurprd04.prod.outlook.com (20.178.87.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Mon, 11 Mar 2019 09:30:20 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:30:20 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 03/28] PCI: mobiveil: correct the returned error number Thread-Topic: [PATCHv4 03/28] PCI: mobiveil: correct the returned error number Thread-Index: AQHU1+0LmAHw3KdU9kO+wVi9R8LChg== Date: Mon, 11 Mar 2019 09:30:20 +0000 Message-ID: <20190311093130.7209-4-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 35201a16-ed14-4bb7-99df-08d6a6042dd2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB5592; x-ms-traffictypediagnostic: AM6PR04MB5592: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB5592; 23:ypj/CEkDDPDp/Yw8d2s72DM8FNHrvNO2X1uH+yH?= =?iso-8859-1?q?xweAf+QATyV8xIi?= =?iso-8859-1?q?+TGdCu5qn+Q8Cn53w6mLalXhWGMu9CkitAa0cAQCTtWbsjViO9pHuMT5Fl5x?= =?iso-8859-1?q?ykCvn3Pg6uC07qxLyKWFm3zMi3rYLC8cSfH/5aQCFxx+EgcWpBMJDeu4kbea?= =?iso-8859-1?q?fe8rGl6lgJYKatdEjs9/CFBiieS4M+YJdeIkhlCt16Bn+aPLpHd/wAUQ6Uj6?= =?iso-8859-1?q?pRtxzSpWzhygKIBrnoAr6brlQnfDZRb7EpCzRRJrjYSYTvY7cHfJFDekZ+YB?= =?iso-8859-1?q?hGQOgLDX+hShqJfhbSI8BSAsK+PurEFur87JkrRHKLWOjCHm6yWdZXVo+/BO?= =?iso-8859-1?q?xaCNwhDjpMPCjfcqIKwVzgzZ/0AE5+yNqN3BJPd6vmxAvkcnC7sFGSg6yLbc?= =?iso-8859-1?q?u4KrEk/UWRlPp6/bQoptUAobYDdBP9NN7s3iIdhix/flsRc5eFDrScjEtsD1?= =?iso-8859-1?q?styWBrF5EoJqTeF4P1UGD0XXucRWWoR5UH2B7LUBEx2C0BjwZ0OO6JdA6+9m?= =?iso-8859-1?q?uUCpRcCRFYNWqu9fiGvu8fd5Mz6TEk1McK0ShRzjWDwyT0PxGGNIcRfoXmv/?= =?iso-8859-1?q?i+VsP/kvpCSIjjckC4e0gQPO+d13VR2W6z84Ypwr75Vl2fiyFp9+syYvq+iO?= =?iso-8859-1?q?00+574fXSkwTeIQRPvKcUnweok/yP908O3bGTgYvHGspz9bO8JYgYD66Pw90?= =?iso-8859-1?q?afv/y3YiuhZgT8wBbtf7B+9yKtnoPYjUejOmPQyGscDPmmgFOAJmbmYkFjYF?= =?iso-8859-1?q?77J+cQkGyabDnavvLXcbznImEq21ebN8g+6d+9jSjZjm5tqxU7bdLwfscm0q?= =?iso-8859-1?q?+hcVndn8PnMb8EzFotcfgguNKscnmPGRKP+7HkJKFYHhwgiPizbDRwaMBIkR?= =?iso-8859-1?q?KeXtIUdkEE0xDBH4XFA2kE7iDddxrcKbu0YMpu3x3729s7BURE3tri7wql/Z?= =?iso-8859-1?q?FuVholQx03stVVunjTrEouuLLLiiF+K9EdTsj8LGLVvobLjNzf5AsToCJb7l?= =?iso-8859-1?q?vgKH1S4x/WStYQx9oobkNjcDgdDa2SbtIy8BT9evL1QXQPb8qw61MFEJ5E/M?= =?iso-8859-1?q?fuA3BW+J7bBRqoyB4RBiiotS/IkCudCD6nAk3oXdLGX4Z6E8rKI+NoUDy9Cx?= =?iso-8859-1?q?3ohpactbQASSpMeJdhxcZsWjlgsHut7Moj2Ap+sVLupcBwOChNBJM192JUv1?= =?iso-8859-1?q?eajmlm9MuenkgzRT0YlCTdU1RglzqUmZETy3LjGufm3KoqoGC+AdTPZF2fSB?= =?iso-8859-1?q?brvichEMeKZY5k8OlSwXVgBpX6qutKQcjuT3vCv6lnm3HNJzjJJWfofXvQ4Y?= =?iso-8859-1?q?0bQJmj+lIZaeGAKDZOBM2U/sAp7LC5?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(376002)(136003)(39860400002)(199004)(189003)(5660300002)(4326008)(2201001)(8676002)(478600001)(81166006)(81156014)(14454004)(86362001)(8936002)(50226002)(7416002)(14444005)(256004)(1076003)(71200400001)(71190400001)(2616005)(476003)(486006)(11346002)(446003)(186003)(305945005)(7736002)(97736004)(68736007)(66066001)(36756003)(6486002)(105586002)(106356001)(6436002)(6512007)(110136005)(76176011)(54906003)(52116002)(99286004)(26005)(386003)(6506007)(3846002)(316002)(6116002)(102836004)(6346003)(25786009)(53936002)(2906002)(2501003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB5592; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 0Ixj8ln1ybbHp9zth2qAdTJ9Xd8HjnET8gIgiabTl26yhqW7gCJsT2vqXq1SmCGHLhKqNiO49pz8SbkmIzHxD0WaiHOOfYpnIFoMQCEwiWoNxdx83zIzNM1/wIhWquGp3qYuwOi5Py6EBFT5icbUvnRL9wM0/ns86TCJqlcibTwZxzfiEp4n4QcgwCkJ56rLkaMbkdqXR8xeC2U54zMzHRDMv6qzMf3t6ePYLl7WXWDBhGqey5iBSKfpG+FfCYpUWmbmUSP/kjKaR7rymPiZW5myHiyJSuUSBjozHyKwXznWhnbA0MEhkqO8pzOTCmQo8E7rFJUlN4kstF/pNNKAzdy0IOFDT/d9jFTqZ2U9+mgFRrX/N/pgx5rQ/OqapIB+blKXJ2Of5iKQ7K9iDQpxcWi8AzGwqAMV4+z9LsQq82Q= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35201a16-ed14-4bb7-99df-08d6a6042dd2 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:30:20.1332 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB5592 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023027_474302_377397F7 X-CRM114-Status: GOOD ( 12.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang This patch corrected the returned error number by convention, and removed a unnecessary error check. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index b87471f08a40..563210e731d3 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -819,7 +819,7 @@ static int mobiveil_pcie_init_irq_domain(struct mobiveil_pcie *pcie) if (!pcie->intx_domain) { dev_err(dev, "Failed to get a INTx IRQ domain\n"); - return -ENODEV; + return -ENOMEM; } raw_spin_lock_init(&pcie->intx_mask_lock); @@ -845,11 +845,9 @@ static int mobiveil_pcie_probe(struct platform_device *pdev) /* allocate the PCIe port */ bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie)); if (!bridge) - return -ENODEV; + return -ENOMEM; pcie = pci_host_bridge_priv(bridge); - if (!pcie) - return -ENOMEM; pcie->pdev = pdev; @@ -866,7 +864,7 @@ static int mobiveil_pcie_probe(struct platform_device *pdev) &pcie->resources, &iobase); if (ret) { dev_err(dev, "Getting bridge resources failed\n"); - return -ENOMEM; + return ret; } /* From patchwork Mon Mar 11 09:30:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9159D139A for ; Mon, 11 Mar 2019 09:31:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7866728E3A for ; Mon, 11 Mar 2019 09:31:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69A9228E6E; Mon, 11 Mar 2019 09:31:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 17CF528E3A for ; Mon, 11 Mar 2019 09:31:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wpg/3gQr3T85lTKWkr+HlzGdbcFHOrvYqujsWJC85Zw=; b=W2SJhjK5Atuzjj 9ugPHo/S6Qjdgdfpide0swqDO+Y/Saaupr0HGKW0QVV7hWiiVF3T0p4MxLTIXniVF3InsmPWUa4zb mFJZxSiEMJNkCOpogbl+Vpgl8dwtq7NS6VvlAiauldpmhA1wtuusFbcTu++Getp/NZwQ8+3B0KvJc tUSPqAuDPXSpiCZOOOsVQ5Og9XwgbF4vwVY4Vgwrx/6mCCMcoeDiunP76Rhc0/j1EsmVEzItYeZ8T /AQKJ8p44J18L32LMbg6qMQNUXUMtTc0l0jrnLz211RhwHCqgtoTlxUp96DTGH0yP4d1O1cZeGmvl 09Fmi6HBVWPclDluW77Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HH2-00018G-Ek; Mon, 11 Mar 2019 09:31:08 +0000 Received: from mail-he1eur01on0629.outbound.protection.outlook.com ([2a01:111:f400:fe1e::629] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HGX-0008Px-OS for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:31:05 +0000 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=11vMYtPjZFN2gkhgcCGW4FDZdYGpU4nuJcyKk/dfgqg=; b=q1wv3SQWyGTs0Cu/9SqbnizLDJaG8vRp6A5iCkQ16cZJ6Q8IUROkXNuLlpUBSwTgjhxYAnyHz7AtlJrk9Kjq9W1dywohXe7p4VqLRdFN0p7RTrUmThtpvoYtMY4bjXCXRWtKUaXEIihb1+bwR8LlfqcvnY+XGB3jv/OsnNn3/34= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB5592.eurprd04.prod.outlook.com (20.178.87.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Mon, 11 Mar 2019 09:30:27 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:30:27 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 04/28] PCI: mobiveil: remove flag MSI_FLAG_MULTI_PCI_MSI Thread-Topic: [PATCHv4 04/28] PCI: mobiveil: remove flag MSI_FLAG_MULTI_PCI_MSI Thread-Index: AQHU1+0Ppa3nAagG1EaLvH5ZY14VkQ== Date: Mon, 11 Mar 2019 09:30:27 +0000 Message-ID: <20190311093130.7209-5-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2ae83433-1db3-4f39-67fa-08d6a6043200 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB5592; x-ms-traffictypediagnostic: AM6PR04MB5592: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB5592; 23:b3TRoWyNDX4nhctorJUa2XLNqzOWYY9sRjxS1W/?= =?iso-8859-1?q?O20Qz7zOJXzh1lo?= =?iso-8859-1?q?mzK3TtrPhcLpwDHyDcPBmIYmEK9LmsnGj85OlZUkg2dkyOjucMtZmB9kc7Lf?= =?iso-8859-1?q?kgGRWSg8n8kFlp2lXfvEFjLQGEdS/wRPjlNVGIcXCqCH3ng1n13Bu7XkluDd?= =?iso-8859-1?q?gjgJEZfbUkaSOPbTX8NxRPPNegQmOyfpYbvtH4BnkLdd+6KbTPxsZGL4Wkqe?= =?iso-8859-1?q?5GIlcAli+hDac2V1D6bRdcFYVY0mmat4znVXM+0hnJcUIL1Nb54bdj+LH5BQ?= =?iso-8859-1?q?Kqi6qCGix9eezyU04jEDvtwtABbMmDIPLp18y0VEmPPBtNcvCj6+qD3Md/DL?= =?iso-8859-1?q?O/4jXRQDbyr0moLTNPganmBDXYSOX3uzSDtELCGQB9GLwVXTFAFWPKTwFbxU?= =?iso-8859-1?q?9f+FzpzqzLE8rczWW0PRT9NZKQUZz1bZ/6A7DNpMwqFRbbAqe+G/q8Ydk/0Z?= =?iso-8859-1?q?ZOddRDPzNIc2ELdhB6MAdTfEQa/9EybzoSlQy1lxkz9lGbK/Vz21BR2sytVm?= =?iso-8859-1?q?MsocEGW3LngtljbUQKhuimH5Vw/uBmBbptaSYjbiy+o3yX2Cu1xsz7UMks+R?= =?iso-8859-1?q?77iBgeqxfdYa0ypLbwOhYruYSQkNsbdASO8EHDFotVW18tFZEDdWaesc8/rU?= =?iso-8859-1?q?s5H7OPTp32ozx4tfRM2dWNb/ot8zl0CVl+nc5bsyb61LIqwJxgEyFPqBuT63?= =?iso-8859-1?q?3ESycr3byIK9ypf47iQlOWWAyHs1PSoolJuJIhYpZ4kaIUpTb1gx/DqN8QMe?= =?iso-8859-1?q?iajFe2Glwc8p9W7Nc1Fd1MesLRCYmkOe2R8wpQLTQwc7o2uZleccO9OtyLCo?= =?iso-8859-1?q?/JmEbArV3cFniCr4cZpKD3vfuI3/E+OL7tinvUHIcPm6MWuA6d0/f3QOUmtQ?= =?iso-8859-1?q?BUKIQgQIzMR5mJIugn70l+v8obe8kJ3vC7UlKfNqVoWdSS9mlC57uXLrgFJw?= =?iso-8859-1?q?WXC2e20LnYhz88wy2j9xeM4DOsGRtYxoTC5zAHotlZF+DcsE5BP4zmNy2sWl?= =?iso-8859-1?q?Qig3xb6Js3YnS2wnWX2b5o3bjmFi+OJLlBwU5mVpzNJDd6EIkaqieFAD68S2?= =?iso-8859-1?q?vr5lGIM++TsLdLdE+xAy+Gmm8/Oc3cub1lfzmcfh0iolUBxd9+A3tQKta4nw?= =?iso-8859-1?q?7SxWQL4RTVlWo6lt71H0ImJEDictkdixw9zM5b8Zipz8UM0fIJ/6sEVhP/pZ?= =?iso-8859-1?q?K3cnFvOvI3RBveLpPXurVsmmGrPxuud62jdB0VskQ1yyivyLBVABVTF1ICri?= =?iso-8859-1?q?tNeaTpg0U+Iw9A9ygl3WM+i+BTIyfG7Tt7xzzidj1RyA0+B8qfIQ7askUL+U?= =?iso-8859-1?q?sowZEpl1L83TKOwhueHfAhX+r+3TnEwbvIUaViQE2NTJicJBFf8w=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(376002)(136003)(39860400002)(199004)(189003)(4744005)(5660300002)(4326008)(2201001)(8676002)(478600001)(81166006)(81156014)(14454004)(86362001)(8936002)(50226002)(7416002)(14444005)(256004)(1076003)(71200400001)(71190400001)(2616005)(476003)(486006)(11346002)(446003)(186003)(305945005)(7736002)(97736004)(68736007)(66066001)(36756003)(6486002)(105586002)(106356001)(6436002)(6512007)(110136005)(76176011)(54906003)(52116002)(99286004)(26005)(386003)(6506007)(3846002)(316002)(6116002)(102836004)(6346003)(25786009)(53936002)(2906002)(2501003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB5592; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: F/FykdM32qe8JtnBXEKHuNH94BDvb9RxlqQ9/yR6WIZhFZN7637mlcsghnROks0ouram8oZ+l11dBivcQMEwcIELg/1xRWt6m6/ZhgUvfq1GvTA/8Rhq1roLMqFSTgNOsEdpkIETtCEX1ZAVuvM4PhiV3RkRJSWbw3rwqhs1auZHsLjqhk7Y7mLnjAlOyF0nSulqdYDfjHg4S4/KiNtxpyrqSHbrTZKtRRdIezqrxJNo6q7+opw2TsyPKsze/kDSyJ/an07oVRv5doCMS3tuYZ59hMLaY10OI/WRUriUyMZNNUKIdZuO/l8YcXBr52wUc+w0jadPX2vAI/ujG1rC/XtAHgE9N/S3tsJ1q+QCvbi3G9W3y7GduHQCE9X/Za73rBgFtcoBMS2Stnh3J/3+0y3xIHbaEt6cwr6ZKmO1JOQ= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ae83433-1db3-4f39-67fa-08d6a6043200 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:30:27.3354 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB5592 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023038_152667_816E65ED X-CRM114-Status: GOOD ( 12.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang The current code does not support multiple MSIs, so remove the corresponding flag from the msi_domain_info structure. Fixes: 1e913e58335f ("PCI: mobiveil: Add MSI support") Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index 563210e731d3..a0dd337c6214 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -703,7 +703,7 @@ static struct irq_chip mobiveil_msi_irq_chip = { static struct msi_domain_info mobiveil_msi_domain_info = { .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS | - MSI_FLAG_MULTI_PCI_MSI | MSI_FLAG_PCI_MSIX), + MSI_FLAG_PCI_MSIX), .chip = &mobiveil_msi_irq_chip, }; From patchwork Mon Mar 11 09:30:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 73F9F17DF for ; Mon, 11 Mar 2019 09:31:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A2C928E7B for ; Mon, 11 Mar 2019 09:31:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5833328E89; Mon, 11 Mar 2019 09:31:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 02DA628E98 for ; Mon, 11 Mar 2019 09:31:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NESceFEdWKWEz4pdiVJaiPBGwuLO+l4zuKKgxMP4Yfg=; b=BSHF+ml3L8BpUf tUtw2N0BKnfMa2I1lb6qaEAr39bkAOwGwvMKsnDVX4ZESVMiN+NtG48Gn5+BtxJeagwhvFoe5gx6M JF5i5visQXhP2tSdfc7d/NnQ47Tpw7oZgu0lHAg8MJBvVPAZYHpEqAO/cW2nBLiHPvtrUF51Dhey2 HNCqpk2IWCIAQD2YaQ9gPDRWJ096ejtFq9hjdipegycMuIrWWu5jGba0urOp95GQvDlZ3AHV9l66W +4Dtlysz89jCxAjZECsCVZtuUd5+N2eGC/17GPrA7KL0tfCb6yCECe2AA5t2Sv24R7PPjK6u5EiMk hLTRBB0nomJOJ0tEsgtA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HH9-0001Gv-UE; Mon, 11 Mar 2019 09:31:15 +0000 Received: from mail-eopbgr70049.outbound.protection.outlook.com ([40.107.7.49] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HGY-0000Rr-Ev for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:31:05 +0000 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=uJ1q3GbR4n8QaufXG6OpX4LbKDQTbtgJA7yjeAiVFB4=; b=hFcXS1l5UXKZw5VZ1tCH5EWpLe5mrfUqoBnXM9rUi0pQ7iNOl/vuL7r6eOx9fmf+YFf/+eiaSgAOKroTamnmSCEH/Ur+ck9J2ExCoSBEsk9cX83PuT6cKnhnGzV70vwK+kEEOzUSu2NLQszmUv9+vL+yuNBMJX3HKjyd7Gm/+Qs= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6566.eurprd04.prod.outlook.com (20.179.246.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Mon, 11 Mar 2019 09:30:35 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:30:35 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 05/28] PCI: mobiveil: correct PCI base address in MEM/IO outbound windows Thread-Topic: [PATCHv4 05/28] PCI: mobiveil: correct PCI base address in MEM/IO outbound windows Thread-Index: AQHU1+0UhvVjXnV0a0msw3SU+FqU/Q== Date: Mon, 11 Mar 2019 09:30:35 +0000 Message-ID: <20190311093130.7209-6-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 705a598e-b6e5-4c70-947b-08d6a60436bf x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6566; x-ms-traffictypediagnostic: AM6PR04MB6566: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6566; 23:2t+pDpXVcOPimXRfzj2wvoa6X60OD7wCdl/TDj+?= =?iso-8859-1?q?33bAqIdUP34woQ1?= =?iso-8859-1?q?vYQUNLbfZN6/uLAKk5Jom0x0hnw4n/6O4m/B4oufs+FY3g3JcGeCT6gI+y80?= =?iso-8859-1?q?dQtO013MbG6egkNOP9xNTedJtlXGn5Dc2JjsNn/BQwTgJgZcFphTe8TMIxpP?= =?iso-8859-1?q?y0R8vaAmGffw2P7HTduTTDwv58QnbLdKLCCswiDSpCUR42W1ueCsVXjw1VHe?= =?iso-8859-1?q?uU4ts/I+nDijLDgZ11H7CV3dpq+f970F46OU9yXWm20LSMbgFb6asUnSkBuQ?= =?iso-8859-1?q?IbiF17IKvkkTOlwKMzeDVRChsnWk3CGt70MIHxvPEjycxTLNEO96/SJgx002?= =?iso-8859-1?q?rPlKTMLmcJv21TejO4wbRRkGNs1z+dXUEBcOCRog/q1j/VKZ/YTp6Te7Lf1Q?= =?iso-8859-1?q?SE/QNb46HOcOAQUpSViReQzvTxTPV6PqB+b/3oH8JI1dLC8P5IlD5Dvv3AEP?= =?iso-8859-1?q?lnzQ3JgV+mEo2JvCtTxYSMMAgm4919Q74Bn3CvfLgDs56UwsBhSbl58xXPhk?= =?iso-8859-1?q?4F5SkqFjCqfx16n+2e3FfelahpZUZDF5mHHd6z0WeBnc86ES/5xkBZ0wbw5R?= =?iso-8859-1?q?sv7Io8RP9dQ2o5MiekSDnEoHxa7lemIoBFfv/TmGI34+cHYH9EodS5SKMN/c?= =?iso-8859-1?q?FXDpMiUNSFcemosFRsDVO50+k/1fRynn3w6kFIsWs5U7Bi/7vw7FK1iLATrj?= =?iso-8859-1?q?SR9aggrh0NG1T01Q46oZZil6tu9udbI8bHQ03szkDIZ8pSSe4yraN72hMXDl?= =?iso-8859-1?q?4FMF+OOiKfa3yNapEtNQpy2DYXxEuLrvYWs4MHKWhPMo10Tgr1VFX5x1ylTw?= =?iso-8859-1?q?qoTzA/wfQ0AVzeJ55lVDE84UbKFQEUVa/JpK3lNFIrgyj8My1dUL8oqgU/+U?= =?iso-8859-1?q?w6I3CGN+RIyxftfEVcdATG3XoTcOR0q+o4tdBgiLw7vziOYdTLn2h/Y4wsde?= =?iso-8859-1?q?7/lm3A0yC6JMYeWs/XM5ABVdRjAvtO6BS0odyjrok9IaKG1vm98giQ3pb8zK?= =?iso-8859-1?q?mVo8NU/DebDQuSRgygjBs8yUaSIEalmxrX7o5ZLiLoaQOVc915/pQwDLduQn?= =?iso-8859-1?q?Hc8Iok19BHqKOaf13aqjga/g7hSsdBqcExZDc5r2sx1Hgzv/7g6+IUG5fESd?= =?iso-8859-1?q?h1e4W0EL+hi4JUZg1CrT7udqx0z5eEhMTEUcyzwIONgHWun9/xhg5GU15YCf?= =?iso-8859-1?q?SbxkuiJN5rj+i1SjLu62fIpxIqkB85S92fiiZej5GLIrWyevb/OuEfpky9qr?= =?iso-8859-1?q?btfI1qbmnE4U+ZzUOxA4KQ5y+w374n7kuBlSe75OpKvqxdTQ=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39860400002)(346002)(376002)(136003)(199004)(189003)(6436002)(478600001)(25786009)(99286004)(11346002)(2616005)(476003)(76176011)(3846002)(6116002)(81166006)(81156014)(486006)(71190400001)(71200400001)(2906002)(8676002)(2201001)(5660300002)(97736004)(6486002)(446003)(7416002)(2501003)(86362001)(256004)(14454004)(316002)(68736007)(26005)(8936002)(6512007)(53936002)(1076003)(66066001)(386003)(54906003)(50226002)(110136005)(102836004)(6506007)(36756003)(105586002)(4326008)(106356001)(186003)(305945005)(52116002)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6566; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: GDIM1JN2MSBNmOQKseEJjhA/zN+Zw5I026PRKIRIu4HL8aXu9tGMDtA2BjUyJn48OAfC05aivYxHvQ5nFee1r/HOoY6vhRPx8Y4IhzOtxsULEG/2d7y0P0Ous4wJSRzrHYO3BtdZIP34uheFMyPCiuB9SNs7JNtt1oHn7YrB7llQ/aFdT0qOraBOVb5pHBVZq6uZmR0zxSWjMGYhTrRW/UqJyt7Xyt6ZF5MALRtCqpqg6eih+A7necKYxjIzKZ8E44OJZAMbi8TWNI+uG+9RTmLGDzyn6ndrotPoc7vUmVkwwJRpPeR8cAZRWlsqPmciBML1lIb+RmJe2mpZlh0IYfC7Q+9kWlRiit2dvH7UTVbPzS1n8sy4Nz4HtwCpc3S5UhbbaHXRcgj9AdFkoo97KQdM5AAZF5QVyeK0gKV2BMo= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 705a598e-b6e5-4c70-947b-08d6a60436bf X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:30:35.2692 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023038_984154_FA47D21C X-CRM114-Status: GOOD ( 10.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang It should get PCI base address from the DT node property 'ranges' to setup MEM/IO outbound windows instead of always zero. Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver") Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index a0dd337c6214..8ff873023b5f 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -630,8 +630,9 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) /* configure outbound translation window */ program_ob_windows(pcie, pcie->ob_wins_configured, - win->res->start, 0, type, - resource_size(win->res)); + win->res->start, + win->res->start - win->offset, + type, resource_size(win->res)); } /* setup MSI hardware registers */ From patchwork Mon Mar 11 09:30:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847051 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C267E17DF for ; Mon, 11 Mar 2019 09:31:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA09E28E98 for ; Mon, 11 Mar 2019 09:31:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7FE928FC7; Mon, 11 Mar 2019 09:31:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 502E028EB9 for ; Mon, 11 Mar 2019 09:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4vL4fCtMi8tTEj7sgM5fMJSEK2l0bSpVMteBeEEQwzc=; b=pD6BNcgOjHcxNF +CDOOF78tKveYP4jz6UC175K6iMLUYzVUCYC6rLzDmeEL/zmZCkN2V+/9E881XIda5xN0xp8B4yie oXd96gpVr9DcynzwNAkwyz0x7022VN/HUF8lqTd0q+mvS+9b9T91qjhVsGKO5jUzxUGOBSwh+U/m4 LIpI/G7tJdAidSE3iuK6Z9j0KyCj2YlxY/XnCfYf/VaRnnqmwx5IHiP7wwIkdkS2o0CycjCoynx+d kl3/rWApUGnTAa2+UX0v4BH+ObKtM3O+B5+xSXOxSMUgQ6WiIrRQD3rHmZbhW+NNafouiaksXNhhv 5Z+vqdBssHtVJnrA/yXg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HHg-0001qn-HZ; Mon, 11 Mar 2019 09:31:48 +0000 Received: from mail-eopbgr70049.outbound.protection.outlook.com ([40.107.7.49] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HH0-0000Rr-60 for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:31:33 +0000 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=DJcuDyglLGprdVl2BE3RD+8Wv6VKcmTEEz+VNHfZ1Ik=; b=BtB3hBH+vTkqonbfIzgvRia6BeowzBdhB7q2fmVAQEs8BbITcZbkDJPZxMeQalz1RbdcRyJ0RWjgkoliBmuwF7aL1L12Fefclv/5GOhtQ3J4E3X2gYL831BGVGOTR1GRygL9vu1bIRJ2QPOuLdoXVO8+MOAHA4QFZRoXXzE2ODo= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6566.eurprd04.prod.outlook.com (20.179.246.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Mon, 11 Mar 2019 09:30:44 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:30:44 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 06/28] PCI: mobiveil: replace the resource list iteration function Thread-Topic: [PATCHv4 06/28] PCI: mobiveil: replace the resource list iteration function Thread-Index: AQHU1+0ZNWwo8d+7skK9jlHtPc859Q== Date: Mon, 11 Mar 2019 09:30:44 +0000 Message-ID: <20190311093130.7209-7-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 19b17bd7-4da7-494f-2cb5-08d6a6043c32 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6566; x-ms-traffictypediagnostic: AM6PR04MB6566: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6566; 23:jS7vc8CzumKPfuTpSzI+H5gghYX3n3r01vBfaoa?= =?iso-8859-1?q?Va4SkUIBv1xU+Zc?= =?iso-8859-1?q?MzPmugTxKSv/6qcPpIJ2h50y98YdwSYkux/nsLApukYMKaFHBpFSJaLuRoj2?= =?iso-8859-1?q?pC7aYA+Z3/x263WzrGx51ZlaoJecVoDkykX/XrxE7DZHS3roI9txOB/iyWPm?= =?iso-8859-1?q?HTyOpOYinPkVorUv90xkf4vdkL15WK6hQAsWVLvt8t2WEbjm6zBl0M9Jshan?= =?iso-8859-1?q?lz4aYAVLTpnfPEDu/iUrzeCl4crtO44E1hpIr3eJaqBN1W3nVmhiGDeDZlFi?= =?iso-8859-1?q?EkPrZyivaL21BR08swnBONtgesu3yxZfn2yXiNjUJWDnjDbF8L1LDdXPfSOg?= =?iso-8859-1?q?j8MXx9YVNRwvtRVi/T8xxwp+VDJeGCecDf4T+CiqTsMAzruHGSnz1uUcOjOa?= =?iso-8859-1?q?0H2y4GR3ROSyWR2NOOIo+W2kt97OV/JtC/59TZLSWD0fFHeh+P2VNCCF+e2b?= =?iso-8859-1?q?kVckEM+exRGiGB1XOOA47jj9VKUosg7DhhIoQb7VQRxS4tpf9jTYQ05o0qG/?= =?iso-8859-1?q?1VenQtPTwx0j03ky0bfdjksfnD+YrqxyHbVl+Y+4vT2TSCB98QrNihAa8+wt?= =?iso-8859-1?q?8A7WYryLZIwIzEI7WxjZ6VrT5djyO3Cqb6J0BaJB+8VWhZBdPSMEKjOEHrJR?= =?iso-8859-1?q?R8R0voPY00bma0MzJY5mubGZWn03Am9Egy+DE9BDG5G5vfXtqOsGYJtEa35a?= =?iso-8859-1?q?hRbXHkMu6TrgFthenUw8ynoHcTtxtsfW3S1lMh4nxMM3VE3GpRn4xL4a6hFv?= =?iso-8859-1?q?ezlt0z982aLLEtMKKVQGmcj5N3ozo/9HgQ+QqXjC5C9KsQkgA6/4LeCRtF8P?= =?iso-8859-1?q?yklVTzYbEUgbq6gCH4u/XTUcOG31HlLFqw4lJQQaAwf8lJuu2sEc5WRCywdb?= =?iso-8859-1?q?6LMB/vqVGYUKGiJM8355SauwSoUHZmQiybkMVGfm01FMZ0DAAmskxug7j6YD?= =?iso-8859-1?q?Fu4Lr9gYSmu4yHfda/ax8YcN1hUG74Bi0KeziavRSemkIv7VaOPKNrTSfBuU?= =?iso-8859-1?q?MoooLja537dnhFSDK/vviPh0rd3vd86mufsn2jlktddISqzbnCLOe5qB1/uR?= =?iso-8859-1?q?RUdONtvoSZ2OL9ANjU0dA0FKGyQoHPU9UD7RXod4+U+Kqfa21e/uENaOxUzb?= =?iso-8859-1?q?3DaxylnE+0OYNciVWYke42zk/SwB5QvE1hEqA94HbsWKxXBRGLtbaqrUXcL1?= =?iso-8859-1?q?be/YwIiwE42B/cx6ES/SjkZ5AlG5o8bF/BDRLdf0kU6N5ZTm5uCc6+klmcJY?= =?iso-8859-1?q?u1QmFEY1LGyVSFz6rFh9JUUfZivYp8Om1oseJNa5Y9HJnSdDIJBU7Gb8HtbO?= =?iso-8859-1?q?vUL6Vbapw=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39860400002)(346002)(376002)(136003)(199004)(189003)(6436002)(478600001)(25786009)(99286004)(11346002)(2616005)(476003)(76176011)(3846002)(6116002)(81166006)(81156014)(486006)(71190400001)(71200400001)(2906002)(8676002)(2201001)(5660300002)(97736004)(6486002)(446003)(7416002)(2501003)(86362001)(14444005)(256004)(14454004)(316002)(68736007)(26005)(8936002)(6512007)(53936002)(1076003)(66066001)(386003)(54906003)(50226002)(110136005)(102836004)(6506007)(36756003)(105586002)(4326008)(106356001)(186003)(305945005)(52116002)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6566; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: u5hQq8uzlu/3rzDabQ6ZtdTZ+OcDKeptbsWyn97gFWQUem6CKoy6eADOn8XPZMQiQijYujKXidHvCQ4p7RVo9RKv/rXaTb/T3nP+NXUFa93qMY0yCnGFCFDNzJyBGfIHcFEzUFHM9xJHKXOAOPelj4wHdm5QXtM7rgTizGVgKJfHCEv5d8l6gBgIS4jdFZEylAa0yZlZpUbc6M+cDm39UBOxFmvoAkzp+hK8RxGYCHMUnyU6s7/XyfwsG1G61/ecM3q9OhrNhQT4oEiDGSeEMlegRFQtw1VNxMiW2/U7rfMz9d5B1svFcrgf+WXMt19hPhE2uVwkiTs0CMj7bT6CCLj+waZJrmspjCd5JX+sF8TT0XUDFt41MwnzXEe3R5OvpY8aflf8nI4Rvo7stXxo8U98IsLnKfEcCLZd2UEefPI= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19b17bd7-4da7-494f-2cb5-08d6a6043c32 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:30:44.2136 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023106_380242_EF2BCDE1 X-CRM114-Status: GOOD ( 10.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang As it won't delete any node in this iteration, replaced the function resource_list_for_each_entry_safe() with the resource_list_for_each_entry(). Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index 8ff873023b5f..b2cc9c097fc9 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -569,7 +569,7 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) { u32 value, pab_ctrl, type; int err; - struct resource_entry *win, *tmp; + struct resource_entry *win; err = mobiveil_bringup_link(pcie); if (err) { @@ -620,7 +620,7 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) program_ib_windows(pcie, WIN_NUM_1, 0, MEM_WINDOW_TYPE, IB_WIN_SIZE); /* Get the I/O and memory ranges from DT */ - resource_list_for_each_entry_safe(win, tmp, &pcie->resources) { + resource_list_for_each_entry(win, &pcie->resources) { if (resource_type(win->res) == IORESOURCE_MEM) type = MEM_WINDOW_TYPE; else if (resource_type(win->res) == IORESOURCE_IO) From patchwork Mon Mar 11 09:30:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847047 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94783139A for ; Mon, 11 Mar 2019 09:31:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AECB28FC7 for ; Mon, 11 Mar 2019 09:31:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F0DE28E3A; Mon, 11 Mar 2019 09:31:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1C84428FD1 for ; Mon, 11 Mar 2019 09:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=O586agp5dOIZtLMPEj+aZOkllzdRnTB7RQCy+shnmqE=; b=a+t90KeArSQ/A7 Uy5pe32EAZsPFbpTyB7XtIU82lA3+WQ5GkPWuydApi0JAi/MK2hAXN/r6JIVFbOVeQPYRPD2KPHIn 4NU7KczL/gSEntAwE92nav5gKe58yIB1eaFtPnbc2o4jlHJB7N0JI6heulBoWA40tqc22cpWh9lhk kMxzjNGfsDy7Gt3bxlqqp7ma1yZwSiuw6LC7GIcyPsv5H+kPx8doVmzHM1ZzTv9otHfs1n+nQ9oov JxnRvbtrENpGq28tXTwYbRCOo0zyNcIXIP+/gQELY/rfVD895tBy9G4jmCcOGjQZA58ksg+hS3Uu9 OUhRhoDYAyjayDcmNe4A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HHU-0001dr-7y; Mon, 11 Mar 2019 09:31:36 +0000 Received: from mail-he1eur01on0629.outbound.protection.outlook.com ([2a01:111:f400:fe1e::629] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HH0-0008Px-4a for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:31:33 +0000 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=iRVbxaOVpCHN4G6WjFD5HlukrFig/GTSuHoq4pwU7DA=; b=iWQENo4tsOBsVNBWUEq0KLvK1u6SgkCF48Zf5jdaKWCBrtz926BGNUHbfQAG8BWOu+GMKd7+OgNnXY3fAOYoOET/oJgSzjSIMAjBg0gn6u1WaMuqsQ1L1iyE9hMWFTjNJb/jREDwtBYjiK+IjLDF3eochzGcG72OAUYIjk5mv6M= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB5592.eurprd04.prod.outlook.com (20.178.87.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Mon, 11 Mar 2019 09:30:51 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:30:51 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 07/28] PCI: mobiveil: use WIN_NUM_0 explicitly for CFG outbound window Thread-Topic: [PATCHv4 07/28] PCI: mobiveil: use WIN_NUM_0 explicitly for CFG outbound window Thread-Index: AQHU1+0doYLeE65/10mqwvkZc/8Elw== Date: Mon, 11 Mar 2019 09:30:51 +0000 Message-ID: <20190311093130.7209-8-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a0998542-8984-4c35-65bf-08d6a6044028 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB5592; x-ms-traffictypediagnostic: AM6PR04MB5592: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB5592; 23:x9z+cPiQ0PraFUNlaCxlhaapZXF3IxFETnMlmpq?= =?iso-8859-1?q?NuODYL05pnFxXO+?= =?iso-8859-1?q?/gV7NlZDoYDAA/GZf+HSzDvqzauj27MWmk0vT1/JD52sfRuX8WlkF08uxm06?= =?iso-8859-1?q?Db0D5kzyKKb2+QbKtBf/o7HZ4vm+LSdOWixiMnJ7GovRKEdht8aN7IiYtUsx?= =?iso-8859-1?q?kUHF16sfX9tgAmZ4rsZR8B1FqY6CAP56EobfSpnf5zWcxQmrhhRy8xyVmpPL?= =?iso-8859-1?q?X9+OhEw9GgtNlxDPlAJNuMgl5WfLIpdrrNA1qMSFOXVnYkyqRRlQZunsJ60Z?= =?iso-8859-1?q?NGFK+jgI4t/JgTfa8yDTMjYb66+ad5ipesbZ36zmko/kUpZE7yzXIz9gQea/?= =?iso-8859-1?q?GAbw4PtDIRCvQItdJCsAnneVIAS1yxNSUX7FxfZ9U47YzOViqYGMw6pmehJQ?= =?iso-8859-1?q?iK1Tmen0OIOfSWqDYJJKdiOGLdKAX973Q/qGDq/Pm2m5RqrlLTHJ88wHeyj7?= =?iso-8859-1?q?xmY82iY3Fx0Xyd40eO8iLRhklEts6QVTLPqlEqcSJCz1A7W+6Ts3m65gq2HY?= =?iso-8859-1?q?CpC2wASf8fz+eaaM/tZGKOsEOPSwSrEIcojX31HPbzYDqrOJsusN6yrGAja5?= =?iso-8859-1?q?ahvYo+RlzG7ZnnIo5yQ/rI2fZreBN/Hx5OnxgJA6eFr3D55COEihvyE75fvb?= =?iso-8859-1?q?T5iGdLIIpDy+QkiUxN56CNiqHKhmtgjBehsGy9nzgBw8V89YgdO9Tdbw3N8D?= =?iso-8859-1?q?hDe0CPTuZIEzVv32TCSuWuEzod3odeRISvIp21AEDlfpX44f+Vq/60KnbOqE?= =?iso-8859-1?q?wAmZ/Dhg8R5xe/KsUxQoKW3B6eU+Ej21gD5O92equNyXLI3Njer4oQSf7qPZ?= =?iso-8859-1?q?Vov1kXUBbbs4q4OTYrxGmhyIhRhOLECQj29GAtAjjs6bYUxMFYwe7GyoD9Ut?= =?iso-8859-1?q?VDkU0DiB3KyvSqw8CaNpeEkdhMcRFrt/EOCtj9fw1wU02wPsyPPEucgMp3ZR?= =?iso-8859-1?q?TSzI8wGeu/hSBOvxLfyIDPzGbRp8etrYDlC3hnVBliULvbXgweC7eD5vL/O5?= =?iso-8859-1?q?n7zUf8xkvMiJOnNSRzmvoa2go1L5OXTQRfnNcvAQLDMHSw3Qh4tsL2vFcHqT?= =?iso-8859-1?q?XyQWaDfC4SdyP+G/I1ASrNHUj7ae4gGD4ElqrK8zbVJBFJ7cpt4li6boZEVy?= =?iso-8859-1?q?S3V37MK41YyGhfDgzh9s/JaWZUpy40zCK0NvxcKX05K9raEInoEuzy2ICgPK?= =?iso-8859-1?q?RWLf683vy/S/fcI9c2qYEqdZ6shTpcy+3/qiXc6mwgFdQwqOdnuZGEPqV27D?= =?iso-8859-1?q?4pqa+yL72kc/93oA7UmJM+azTQY00Oepd6YPDUmyiAjy5SQzpCyB7o565RqK?= =?iso-8859-1?q?T2Yj4fOGY=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(376002)(136003)(39860400002)(199004)(189003)(5660300002)(4326008)(2201001)(8676002)(478600001)(81166006)(81156014)(14454004)(86362001)(8936002)(50226002)(7416002)(256004)(1076003)(71200400001)(71190400001)(2616005)(476003)(486006)(11346002)(446003)(186003)(305945005)(7736002)(97736004)(68736007)(66066001)(36756003)(6486002)(105586002)(106356001)(6436002)(6512007)(110136005)(76176011)(54906003)(52116002)(99286004)(26005)(386003)(6506007)(3846002)(316002)(6116002)(102836004)(6346003)(25786009)(53936002)(2906002)(2501003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB5592; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: nQVkiW3DgIS65rjkpjn/5q36oNu6QdIsBFFicXS0GmcoJKVI7+szcvSL56CVsp4kiJIrEru8tiMQxLsVt4XLcjtlHl8XTkq83mwCRcsJYf7yiNay0yojtKUxpUcHRk2eTZoqMuA4tN1AJOAMK9MMfdqXTjouToSGBbztRU7Fu7jFwA221EpP2FZnF0GuAmxz4k39WmlkYleTm/sSQ6dc2TN8JiXHEfhv9kjwiBv717DXFRNQy4ZWgsctQvdyYrRzr5fLhIqpaS55RD3cAl0uk6yeohBenCAd+h5aHQcAhAeln7uAudBXULRF/f0OTghPDDb0ZuKcIjHs26NIf6O54GH45RjivRKeR23U/w2tJsjUfA7i3+YKm3a5S9WovHVPUiQunKmnYl8qw0EwF0LxPT37dok+ymy+B9ycOc3AYJM= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0998542-8984-4c35-65bf-08d6a6044028 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:30:51.0276 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB5592 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023106_294973_7733DC2B X-CRM114-Status: GOOD ( 10.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang As the .map_bus() use the WIN_NUM_0 for CFG transactions, it's better passing WIN_NUM_0 explicitly when initialize the CFG outbound window. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index b2cc9c097fc9..df71c11b4810 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -612,9 +612,8 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) */ /* config outbound translation window */ - program_ob_windows(pcie, pcie->ob_wins_configured, - pcie->ob_io_res->start, 0, CFG_WINDOW_TYPE, - resource_size(pcie->ob_io_res)); + program_ob_windows(pcie, WIN_NUM_0, pcie->ob_io_res->start, 0, + CFG_WINDOW_TYPE, resource_size(pcie->ob_io_res)); /* memory inbound translation window */ program_ib_windows(pcie, WIN_NUM_1, 0, MEM_WINDOW_TYPE, IB_WIN_SIZE); From patchwork Mon Mar 11 09:31:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847065 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 680B5139A for ; Mon, 11 Mar 2019 09:32:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4ED2528E39 for ; Mon, 11 Mar 2019 09:32:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C95228FD8; Mon, 11 Mar 2019 09:32:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D217F28FBD for ; Mon, 11 Mar 2019 09:32:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=y0yQCl1FD51YcGURKp2VqQdZ1V72bWnNeuXabhJwy7Y=; b=HFUOya1WRBNBl0 x2BcXyhBTiYmya1rrn14KOjdHbtSw6ofP89N/ldEE2aPtrA45gUlekqZdgtvm7fVI4Q2+jOozXKq6 usPyOwvRaetO5Zd1rc6IN7MqfgFiVinusoTftb8etNrZ/VCyYDrlnmqOpT283ErS7HJHqtjya322I r7Fz3R9AEFA8JF3qF9b11ZevYXXuUPsk9e0ibjHNuInQoF2vjDg6tmfTuApHi2MWs5lV1K8W4tkhu pH57Vw9V3c+WTG4IIe98W2PMWumunEHsIzWgEUf6VslUps8zVDXBKy+pnv0ZG0S7m9ckh3tovb3FS 6HEKpeD/LJzDpBGe5Cww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HIN-0002pT-2o; Mon, 11 Mar 2019 09:32:31 +0000 Received: from mail-eopbgr70049.outbound.protection.outlook.com ([40.107.7.49] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HHS-0000Rr-JB for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:32:12 +0000 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=kQP5OwqdG/Q2QfkutG8MTiHceJFLXEyIItNvHC1TlWI=; b=qnqVO5UiM7LkEojZWNn4Z10sjSq9n1y/jlP3dMZJx52sPp0NgwTmSJNRFsQDT9M/ggr+N1GVoCyQhwCsdD/zewyNl/lFVtQrm8gEHK/f+lZ0d1ms2zchdxdPRwYep13aYR4oF4ncVlcpXv77DeKeNoMTjxVODdsdVNGKjfCh+u0= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6566.eurprd04.prod.outlook.com (20.179.246.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Mon, 11 Mar 2019 09:31:00 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:31:00 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 08/28] PCI: mobiveil: use the 1st inbound window for MEM inbound transactions Thread-Topic: [PATCHv4 08/28] PCI: mobiveil: use the 1st inbound window for MEM inbound transactions Thread-Index: AQHU1+0jagSkKTBKl0OUnmc63aFyMw== Date: Mon, 11 Mar 2019 09:31:00 +0000 Message-ID: <20190311093130.7209-9-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3dace2d2-2eab-46b7-3f31-08d6a60445ac x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6566; x-ms-traffictypediagnostic: AM6PR04MB6566: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6566; 23:UaxgyU6b7wUNDPkX7EOVNSUn6jVXYk6uBA4UYSw?= =?iso-8859-1?q?OXMNGqr6DJvEVbq?= =?iso-8859-1?q?a4bzm5hm1Mvq8aazg1WSr2J8oWgr9hctFonW26LDcV4026Ln1ONTFUDbeoSQ?= =?iso-8859-1?q?ABKBRAsgi+OpRafweFdfe74ef3DeAvcdXeyf2GrF6+FGqXYa1PgYXuIVUtEt?= =?iso-8859-1?q?iP29DtCb2mzu2e4Bm8YsuS29Ov04ajHe5KNxhshTXvtnpuWnSUyIf2uR82sL?= =?iso-8859-1?q?xngcLtKLmjfLxMvDIeMSJgkzpwfrgPSgGMurgr1mVsKC9+UXeBCiExjeY4Ib?= =?iso-8859-1?q?3fwREa/M+9X6fT3yVq4QCIROGMzufsTVNzFWFl3xysnsscn5HzGK3RY4fDzl?= =?iso-8859-1?q?sf5TBaLPOe7/WOefIWb4tdkdQtdYq4P6AbINwMjKHw8eS3qn4cgho70TrFWY?= =?iso-8859-1?q?B0NnEMshk2wRUN/cvCnGnhjOvSWGS9QqA/88MVH2PtIeG92attfzWpoqnRLb?= =?iso-8859-1?q?49jP0+RYqaVwW/GXtAoZ0y/kl3AQdmAhCN8lM2s1K47RtIku8L0DAyq0mQI2?= =?iso-8859-1?q?EhjnlgaDI/Pq+nae+HobqpUrUus8vk16cf7/Y9Ly6xaHnbWKVojKv+4TD8BW?= =?iso-8859-1?q?AkauPZzEsVM4oKJ5WIKfI46EWofF/Yv/y0WahCdN6cyu2z5A6CB16TQK996d?= =?iso-8859-1?q?zizuPGSPQrNO8v/uNzgg78dyspguwzzzWUU+bJdnc13ojs6PVgfbcurHTGkR?= =?iso-8859-1?q?qD6YgvoOyg0onMNKVdn9gVHzg0dkS1lQTejM3c4ZSRkthM5pCg70Q5A/fcSs?= =?iso-8859-1?q?2ABJK25Dn7bK2k5uz6nwvUtWAH/3Qoz7srvcVQC9qJ8O5DFAiEqkew0RTaI7?= =?iso-8859-1?q?nBIooyNMa6oThYggCqUNgvgqn5NLOVnBn02aCiOLRQvr1lALOdBo25ZC4tPq?= =?iso-8859-1?q?OJrqfhgNmfabJUcyBaeYwbOOHqoGWm8zDTsiqcxTMmkCLNcvnwUsEPYnc53N?= =?iso-8859-1?q?5XTFh12b16ETdpj+7rMpBkDvgOKU8A+VUS0IGx4X0R3pKVAcw/hXS6cgNRUV?= =?iso-8859-1?q?KYK5hkQDYbZTAC28PXp0/Nc9sbepYpSGdL7WdEnF1bM5hoyyfGuJu370Y7Pb?= =?iso-8859-1?q?KxiLzlKGY2hkX1t+ZVPoFAJJnLe6N2NCw8W1IynA3WjIxwib7hIA9yZe9CB7?= =?iso-8859-1?q?ggLY54bVNll4wzUnZxJBA2ZbZ8lpekfKVCSzbum3CNhvduEaTcyMRO5n5XU6?= =?iso-8859-1?q?t8hOtmTXLk0r3FNxHiclA9FI2fYCyXnRSCJLC8Rw5WT/s2+AUW8PhB2WYot0?= =?iso-8859-1?q?DJawwF5MltRiToV02waPG3Fxk+eJKPU0Didxs/05yBHURbSZta1+MEDhuMgc?= =?iso-8859-1?q?FmwH2rOF3diRIArkGznn1+tm1S3JNE?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39860400002)(346002)(376002)(136003)(199004)(189003)(6436002)(478600001)(25786009)(99286004)(11346002)(2616005)(476003)(76176011)(3846002)(6116002)(81166006)(81156014)(486006)(71190400001)(71200400001)(2906002)(8676002)(2201001)(5660300002)(97736004)(6486002)(446003)(7416002)(4744005)(2501003)(86362001)(14444005)(256004)(14454004)(316002)(68736007)(26005)(8936002)(6512007)(53936002)(1076003)(66066001)(386003)(54906003)(50226002)(110136005)(102836004)(6506007)(36756003)(105586002)(4326008)(106356001)(186003)(305945005)(52116002)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6566; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 6vbf/TSaAxcH05F7GgmPY4zSzZajm+EtVIN6IHMict2l4mHZ3fWh021s0xrpOmQj6gMXp1LmEL2L3wBl0jKTOFBocO6rSYqo+sW1Dqv5yHZ0hB996u2YJ+VWO7rCiF71Nij/cl/qmXgFfntTf97y6jm64qdcEkMpDQtVIc5DIWm5p4fVz7SVBgLpMEwLxFNztKoHLtpu46NUyg9jGDYVoGRbedOMIRp1lag+ZRRP3lGbHnr6kQtih2PChVF6jA4RYUNBU6EpfQbeZzFBE/UzFaiMQCh7KqofThXsuXXGKYcY99N8+88A0Dt+XrfeCjqh7xaREvUlgL8YCUjq1Cdeu57RKeMhaeI1V+yABGu8nz0TVbd5QutsABa0hyHyFHd1WMv+lzUwqLlU9pfS0UoPQ0RspmWVD/PKD+IQmoNHghM= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3dace2d2-2eab-46b7-3f31-08d6a60445ac X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:31:00.2733 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023134_754203_92319291 X-CRM114-Status: GOOD ( 11.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang The inbound windows have different register set with outbound windows. This patch change the MEM inbound window to the first one. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index df71c11b4810..e88afc792a5c 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -616,7 +616,7 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) CFG_WINDOW_TYPE, resource_size(pcie->ob_io_res)); /* memory inbound translation window */ - program_ib_windows(pcie, WIN_NUM_1, 0, MEM_WINDOW_TYPE, IB_WIN_SIZE); + program_ib_windows(pcie, WIN_NUM_0, 0, MEM_WINDOW_TYPE, IB_WIN_SIZE); /* Get the I/O and memory ranges from DT */ resource_list_for_each_entry(win, &pcie->resources) { From patchwork Mon Mar 11 09:31:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A305139A for ; Mon, 11 Mar 2019 09:32:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3B9E28E82 for ; Mon, 11 Mar 2019 09:32:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F19BE28E94; Mon, 11 Mar 2019 09:32:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6F27D28FC7 for ; Mon, 11 Mar 2019 09:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tuIhqi9+Tb093n2mUessN7SbyOhwzIplx4FqLakAS7M=; b=JpQW26ZFba1cXA thBGtJblyk2y5cMe53H2FopYYlJqTFEzBPBUds9BKMV8cnxIUQxXFxwlHXAmYHbXgEqseVtDGhPvs xFHQPBZWv0miHN59StNu1d37p0gPs/6jtjFqRxmmlYEHzY+kxW2LpmwOXmHQF5rrpCwjGilXB5YNy 7ARiUaKsxtmxVZvh8J4koRIYe4mYUEtdOs5gWOrfMJhz+5Vh9VqdccIyO1rigNbvsbsv0nYH1RiQx 5c7b6NW5EncNNj0BS8P4gxd2xagQClNQif66PuGdgcK46JYE1LQ3tx7Kvbo1JpbFleNd0y/EyThYY HuHiyG9fHu5pQiIqen4w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HIA-0002Yn-SC; Mon, 11 Mar 2019 09:32:18 +0000 Received: from mail-he1eur01on0629.outbound.protection.outlook.com ([2a01:111:f400:fe1e::629] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HHS-0008Px-0m for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:32:08 +0000 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=yE/+sI1z9N9q1s0rB4pdxVIkHsTsqWxTGUE8KouewAc=; b=AVZaeiFXB82kpqpEVlEhYMwIZA2doV51TH8GpAXXI2iT3mDC0YWpB2ZToZdZ8/s2yaLJyRlwokGNYpLpd954oluCrYokHDmS3pN5R75VLT6j5lG8JjP0xGrHz6RPRT3lT6grfJKm3yQVoqPZ4Ei8aV9B8Czo6moK516dxwcMD+I= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB5592.eurprd04.prod.outlook.com (20.178.87.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Mon, 11 Mar 2019 09:31:08 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:31:08 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 09/28] PCI: mobiveil: correct inbound/outbound window setup routines Thread-Topic: [PATCHv4 09/28] PCI: mobiveil: correct inbound/outbound window setup routines Thread-Index: AQHU1+0oL7MapNPz0EOtrgg+R8OzwA== Date: Mon, 11 Mar 2019 09:31:08 +0000 Message-ID: <20190311093130.7209-10-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b1de001e-1211-4a93-bb5b-08d6a6044a60 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB5592; x-ms-traffictypediagnostic: AM6PR04MB5592: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB5592; 23:rT0RigL4WQFb3f9uu2mpVC1M6dsmfI38lHrmkoY?= =?iso-8859-1?q?tlaiPuZbjjdSOwm?= =?iso-8859-1?q?Tv8/zC1FbFSunoI+lIGD+FRgn9cDGo09f9JIz4I1pmtDV8SN+rIeGXkmUNgk?= =?iso-8859-1?q?sdxemhxDr39GEeaKQdVxlppVIf/Ifb9VDj0VTxuSUqL+y57YFrngt6LarhCm?= =?iso-8859-1?q?oY15wr5dWqsZMZeN6LrWengQ27zHGobO/jY8k1uH9IPBjIO6w54MrK2ddA72?= =?iso-8859-1?q?FqLQ6nSurpMuYFM2mtXkJOewMeZuPpd9+VM5z87hEhH77MoKJP+VJo0323m9?= =?iso-8859-1?q?aYu4AI9qyT0dQJKL/JrSlQaz91fCraeeaU++2WFJc9iIwBYaxqmLU8jkJrnL?= =?iso-8859-1?q?4uf5xwPvFwcjLFkGzAsGzFVqVRgCV2NVxrctyV8LOmpjGZocYVEVyTejZ11r?= =?iso-8859-1?q?qZXhJuDSWJ3EOqwAAUETMNpr4jrTb9PVmDrHwQSEaQJ07ugCLA/kw+fjsHDd?= =?iso-8859-1?q?yVAjmcjKR4ff3dLAF3dP+F93UHQfCBTW6OycXyAn59D5nVGJc2MQve7xhyVr?= =?iso-8859-1?q?nqPFG7a2lffWsIb+7IXaawI4633h9Cef/goiskDe1xrPLmdolCYzXFEx+UZJ?= =?iso-8859-1?q?IyuZyFdEWyM2QoFKWIVJw70BQZpUv1PEo6LVin2HY33H7GJRUv4KZLezJ9c+?= =?iso-8859-1?q?OA9J6EU5kH57bANl2AnqYe7lRgMTxjcgH67ZrJz5PDRN8POW3fBzaEfb/iRH?= =?iso-8859-1?q?QUvl1C+F66VFGeMYtNLfJF4cyK1ObduGUbw0BzIAKRDXnd84RIz98sqcrht2?= =?iso-8859-1?q?1cMgGlpj/AR4DDTVTHVvSUS74aY7RcYiMMdAapdayiNdpfQEyuIwUiBz8LSR?= =?iso-8859-1?q?4ZyqEe5149bNqN98D4/0pr7SG/dcLFGMqL9U86qqerq04RUivUu+UsyQHySd?= =?iso-8859-1?q?65AmVA8B1SsfNjo7TThtBFW29nRgI0ECVp6wNu2atnvchMx3sqPuC8MWox3D?= =?iso-8859-1?q?X/ibiOQF4VMoxewjVtE6ZPsZR2rhdgAHSGcFa9ciP7N2AkMit5CDdD1YHQbL?= =?iso-8859-1?q?4LLMb4Rp0zasEqKvUuQU13dt8DnrN9zZJPvkywQlo5eXjMfSXyES2wueQyq0?= =?iso-8859-1?q?Y9KH788Ru/lbwN4wK18LVWl9ezezSHFCfriJ0VXJjheBvdtekV+7RKktLend?= =?iso-8859-1?q?2TxxXSd+uFmUui/pxEQOU+PDHLv9yU/VrGEzq5s+iAE0L/5mEjpTH3B1xkwf?= =?iso-8859-1?q?NwR+/NcP2oVC+l2dLcuqBQ0gAeXe94HjFycoUhi9qj9wwIo4f3uFCd46NaLo?= =?iso-8859-1?q?tCePZhAdGbCI7cWJdV3xvyErgk5yizdODUwEUEssz4v5KnWprJg3ZWJHqCSQ?= =?iso-8859-1?q?odPxsYmKE=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(376002)(136003)(39860400002)(199004)(189003)(5660300002)(4326008)(2201001)(8676002)(478600001)(81166006)(81156014)(14454004)(86362001)(8936002)(50226002)(7416002)(256004)(1076003)(71200400001)(71190400001)(2616005)(476003)(486006)(11346002)(446003)(186003)(305945005)(7736002)(97736004)(68736007)(66066001)(36756003)(6486002)(105586002)(106356001)(6436002)(6512007)(110136005)(76176011)(54906003)(52116002)(99286004)(26005)(386003)(6506007)(3846002)(316002)(6116002)(102836004)(6346003)(25786009)(53936002)(2906002)(2501003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB5592; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: dqc7WT5TwWOtTXERj2W6Z5tbV8Dj0BitHONpzvgJGW8tU+74l7x6xnqLP6QX5ZYPIPhVpH5LZapzy3g4MBTniY5Pn9LJ0ylWoz+tlhhsijUUh0AtOx2d7xyN0lgSscbrcSkJUp3O3ldtWt/r0dWv8GFXLyyGUx7JZK1WMtnKqKxDaSUva89kCrtvriHdreo8a08/nogSeKd+S5hW7PXUWG0ZpNTWwcY6ag2LV2pRA6C4sfYQj/JMXDu0gSojgN2jOAYR2Dedtj2mOFK6WAaj+thjUYp7RSQnzmpY/ACexx4rQKSvyj4AznSX1X2nn7ygWdtS2gFQr5T7I01wCYVUTyilOUBIfadLaur1vyFJlpZavKKL80bblrXzH1BdWOKrR4Zz8A53lXS4HWGbSs+L/NMd1o1O8rYO/McaANMTX24= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1de001e-1211-4a93-bb5b-08d6a6044a60 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:31:08.2490 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB5592 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023134_367903_0CE0F52A X-CRM114-Status: GOOD ( 15.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang Outbound window routine: - Removed unused var definition and register read operations. - Added the upper 32-bit cpu address setup of the window. - Instead of blindly write, only change the fields specified. - Masked the lower bits of window size in case override the control bits. - Check if the passing window number is available, instead of the total number of the initialized windows. Inbound window routine: - Added parameter 'u64 cpu_addr' to specify the cpu address of the window instead of using 'pci_addr'. - Changed 'int pci_addr' to 'u64 pci_addr', and added setup of the upper 32-bit pci address of the window. - Moved the PCIe PIO master enablement to mobiveil_host_init(). - Instead of blindly write, only change the fields specified. - Masked the lower bits of window size in case override the control bits. - Check if the passing window number is available, instead of the total number of the initialized windows. - And added the statistic of initialized inbound windows. Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver") Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 70 +++++++++++++++----------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index e88afc792a5c..4ba458474e42 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -65,9 +65,13 @@ #define PAB_AXI_AMAP_CTRL(win) PAB_REG_ADDR(0x0ba0, win) #define WIN_ENABLE_SHIFT 0 #define WIN_TYPE_SHIFT 1 +#define WIN_TYPE_MASK 0x3 +#define WIN_SIZE_SHIFT 10 +#define WIN_SIZE_MASK 0x3fffff #define PAB_EXT_AXI_AMAP_SIZE(win) PAB_EXT_REG_ADDR(0xbaf0, win) +#define PAB_EXT_AXI_AMAP_AXI_WIN(win) PAB_EXT_REG_ADDR(0x80a0, win) #define PAB_AXI_AMAP_AXI_WIN(win) PAB_REG_ADDR(0x0ba4, win) #define AXI_WINDOW_ALIGN_MASK 3 @@ -82,8 +86,10 @@ #define PAB_PEX_AMAP_CTRL(win) PAB_REG_ADDR(0x4ba0, win) #define AMAP_CTRL_EN_SHIFT 0 #define AMAP_CTRL_TYPE_SHIFT 1 +#define AMAP_CTRL_TYPE_MASK 3 #define PAB_EXT_PEX_AMAP_SIZEN(win) PAB_EXT_REG_ADDR(0xbef0, win) +#define PAB_EXT_PEX_AMAP_AXI_WIN(win) PAB_EXT_REG_ADDR(0xb4a0, win) #define PAB_PEX_AMAP_AXI_WIN(win) PAB_REG_ADDR(0x4ba4, win) #define PAB_PEX_AMAP_PEX_WIN_L(win) PAB_REG_ADDR(0x4ba8, win) #define PAB_PEX_AMAP_PEX_WIN_H(win) PAB_REG_ADDR(0x4bac, win) @@ -455,49 +461,51 @@ static int mobiveil_pcie_parse_dt(struct mobiveil_pcie *pcie) } static void program_ib_windows(struct mobiveil_pcie *pcie, int win_num, - int pci_addr, u32 type, u64 size) + u64 cpu_addr, u64 pci_addr, u32 type, u64 size) { - int pio_ctrl_val; - int amap_ctrl_dw; + u32 value; u64 size64 = ~(size - 1); - if ((pcie->ib_wins_configured + 1) > pcie->ppio_wins) { + if (win_num >= pcie->ppio_wins) { dev_err(&pcie->pdev->dev, "ERROR: max inbound windows reached !\n"); return; } - pio_ctrl_val = csr_readl(pcie, PAB_PEX_PIO_CTRL); - pio_ctrl_val |= 1 << PIO_ENABLE_SHIFT; - csr_writel(pcie, pio_ctrl_val, PAB_PEX_PIO_CTRL); - - amap_ctrl_dw = csr_readl(pcie, PAB_PEX_AMAP_CTRL(win_num)); - amap_ctrl_dw |= (type << AMAP_CTRL_TYPE_SHIFT) | - (1 << AMAP_CTRL_EN_SHIFT) | - lower_32_bits(size64); - csr_writel(pcie, amap_ctrl_dw, PAB_PEX_AMAP_CTRL(win_num)); + value = csr_readl(pcie, PAB_PEX_AMAP_CTRL(win_num)); + value &= ~(AMAP_CTRL_TYPE_MASK << AMAP_CTRL_TYPE_SHIFT | + WIN_SIZE_MASK << WIN_SIZE_SHIFT); + value |= (type << AMAP_CTRL_TYPE_SHIFT) | (1 << AMAP_CTRL_EN_SHIFT) | + (lower_32_bits(size64) & WIN_SIZE_MASK << WIN_SIZE_SHIFT); + csr_writel(pcie, value, PAB_PEX_AMAP_CTRL(win_num)); csr_writel(pcie, upper_32_bits(size64), PAB_EXT_PEX_AMAP_SIZEN(win_num)); - csr_writel(pcie, pci_addr, PAB_PEX_AMAP_AXI_WIN(win_num)); + csr_writel(pcie, lower_32_bits(cpu_addr), + PAB_PEX_AMAP_AXI_WIN(win_num)); + csr_writel(pcie, upper_32_bits(cpu_addr), + PAB_EXT_PEX_AMAP_AXI_WIN(win_num)); + + csr_writel(pcie, lower_32_bits(pci_addr), + PAB_PEX_AMAP_PEX_WIN_L(win_num)); + csr_writel(pcie, upper_32_bits(pci_addr), + PAB_PEX_AMAP_PEX_WIN_H(win_num)); - csr_writel(pcie, pci_addr, PAB_PEX_AMAP_PEX_WIN_L(win_num)); - csr_writel(pcie, 0, PAB_PEX_AMAP_PEX_WIN_H(win_num)); + pcie->ib_wins_configured++; } /* * routine to program the outbound windows */ static void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, - u64 cpu_addr, u64 pci_addr, - u32 config_io_bit, u64 size) + u64 cpu_addr, u64 pci_addr, u32 type, u64 size) { - u32 value, type; + u32 value; u64 size64 = ~(size - 1); - if ((pcie->ob_wins_configured + 1) > pcie->apio_wins) { + if (win_num >= pcie->apio_wins) { dev_err(&pcie->pdev->dev, "ERROR: max outbound windows reached !\n"); return; @@ -507,10 +515,12 @@ static void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, * program Enable Bit to 1, Type Bit to (00) base 2, AXI Window Size Bit * to 4 KB in PAB_AXI_AMAP_CTRL register */ - type = config_io_bit; value = csr_readl(pcie, PAB_AXI_AMAP_CTRL(win_num)); - csr_writel(pcie, 1 << WIN_ENABLE_SHIFT | type << WIN_TYPE_SHIFT | - lower_32_bits(size64), PAB_AXI_AMAP_CTRL(win_num)); + value &= ~(WIN_TYPE_MASK << WIN_TYPE_SHIFT | + WIN_SIZE_MASK << WIN_SIZE_SHIFT); + value |= 1 << WIN_ENABLE_SHIFT | type << WIN_TYPE_SHIFT | + (lower_32_bits(size64) & WIN_SIZE_MASK << WIN_SIZE_SHIFT); + csr_writel(pcie, value, PAB_AXI_AMAP_CTRL(win_num)); csr_writel(pcie, upper_32_bits(size64), PAB_EXT_AXI_AMAP_SIZE(win_num)); @@ -518,11 +528,10 @@ static void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, * program AXI window base with appropriate value in * PAB_AXI_AMAP_AXI_WIN0 register */ - value = csr_readl(pcie, PAB_AXI_AMAP_AXI_WIN(win_num)); - csr_writel(pcie, cpu_addr & (~AXI_WINDOW_ALIGN_MASK), + csr_writel(pcie, lower_32_bits(cpu_addr) & (~AXI_WINDOW_ALIGN_MASK), PAB_AXI_AMAP_AXI_WIN(win_num)); - - value = csr_readl(pcie, PAB_AXI_AMAP_PEX_WIN_H(win_num)); + csr_writel(pcie, upper_32_bits(cpu_addr), + PAB_EXT_AXI_AMAP_AXI_WIN(win_num)); csr_writel(pcie, lower_32_bits(pci_addr), PAB_AXI_AMAP_PEX_WIN_L(win_num)); @@ -604,6 +613,11 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) value |= APIO_EN_MASK; csr_writel(pcie, value, PAB_AXI_PIO_CTRL); + /* Enable PCIe PIO master */ + value = csr_readl(pcie, PAB_PEX_PIO_CTRL); + value |= 1 << PIO_ENABLE_SHIFT; + csr_writel(pcie, value, PAB_PEX_PIO_CTRL); + /* * we'll program one outbound window for config reads and * another default inbound window for all the upstream traffic @@ -616,7 +630,7 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) CFG_WINDOW_TYPE, resource_size(pcie->ob_io_res)); /* memory inbound translation window */ - program_ib_windows(pcie, WIN_NUM_0, 0, MEM_WINDOW_TYPE, IB_WIN_SIZE); + program_ib_windows(pcie, WIN_NUM_0, 0, 0, MEM_WINDOW_TYPE, IB_WIN_SIZE); /* Get the I/O and memory ranges from DT */ resource_list_for_each_entry(win, &pcie->resources) { From patchwork Mon Mar 11 09:31:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847071 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E361017DF for ; Mon, 11 Mar 2019 09:32:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBABE28E39 for ; Mon, 11 Mar 2019 09:32:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF3EA28E72; Mon, 11 Mar 2019 09:32:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 65EE328E39 for ; Mon, 11 Mar 2019 09:32:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vKuzOKr9WbTEfximoU4RpZF94DDnkyYyFpuXX+AX8cs=; b=Fl4f9q4UoV11rw FNKHPJA9hPgitW20E0JTIiV/wVzvTkT+ppXCCu91XMttGHC7s3HrvCP0aneNwXwRZ27JMcu4eDN21 AUb/h6Jgvn1T4VCKlSHZcTztR257aDzkkWS1D+IYpR3RJFIPkzGtl8nM270x5oiJvBAF58BOt/Ze0 utmqIamOBUvnnO+JVijh3EZUymLDDWjkJsnl6CSm9mXGD/lWXBuwWSuwdBF3KZodhQOWucOXArCc2 knmmOyesL1SflQpbUaVlpPThqOllPkgTC3XRzJ0K11J3FZqZRcHQWfzLtkRU1XqtMX6MnvXSO7xTp WIayMlMdqzxzVforB+LA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HIe-0003Dk-Ed; Mon, 11 Mar 2019 09:32:48 +0000 Received: from mail-he1eur01on0629.outbound.protection.outlook.com ([2a01:111:f400:fe1e::629] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HI1-0008Px-OM for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:32:46 +0000 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=Xv4ENgxk7YVVshpRVP6XCpicqcTCUNEYDTGrxfW4F30=; b=lAThMnGZvXFutN43AowTqE1k2u1kvtSZ0rDbID6jbrlgAR06LkPw/SBzt2i0V3NY2VYrokMD+G9yT0St5+5lmdR1Jrdck8l/8A+7Pq33pgR4rMUWHPmqEY99o+ULgjoskdlVYOcE2JcoPv9QXXtXpw/jmD649XZw5vmEZwXlnnU= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB5592.eurprd04.prod.outlook.com (20.178.87.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Mon, 11 Mar 2019 09:31:16 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:31:16 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 10/28] PCI: mobiveil: fix the INTx process error Thread-Topic: [PATCHv4 10/28] PCI: mobiveil: fix the INTx process error Thread-Index: AQHU1+0si14PzdOFlUat22euDKg75Q== Date: Mon, 11 Mar 2019 09:31:16 +0000 Message-ID: <20190311093130.7209-11-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 61f90912-1997-48d7-0fdd-08d6a6044f34 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB5592; x-ms-traffictypediagnostic: AM6PR04MB5592: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB5592; 23:Z7wOhZmKXkJ6x9yTnQvV7LuFc0CdJf/m5u5FYcX?= =?iso-8859-1?q?0RTKYQolbkFGsYK?= =?iso-8859-1?q?rbgDAszk/SjLlUWv8NN3XbP9NH/Y4NWpvWdaGgawvWUF1w/p1nMnTgLj94H1?= =?iso-8859-1?q?XunTzgTz7/QtUSr01K8S5ctpAaQhNlWqRS85zuNYLw/APn7ZLDG+NyEDIA+5?= =?iso-8859-1?q?1/1Kkrj0UD7gzgxh1VTdZhEdKlXEvyXf4rExynufewCKSe/yepDoTsjurWd9?= =?iso-8859-1?q?nmJz9GxyaI3yf04Q7uGPVMKBIzws292hIwVSrJHWqJ58VkFTo1eaUaF4x6Em?= =?iso-8859-1?q?HzLn8pcXrPyMVM1j2jrkF4o6xEF/YAihKBwu1uIcl4O6qcAsmZkkOlmhGZzh?= =?iso-8859-1?q?7H0yO+xpW/bw81EiKWc7kL24ZsmmwPF/ywRja3kzosP8xy7NilGBwQTADbVZ?= =?iso-8859-1?q?oSW3AICDRgzSOe0ELpg1sywBfkd5F9dTft2thhoWUKidfJeWeF6zJq9yKzaA?= =?iso-8859-1?q?PDT5nPcEC6JkYA87Zuxhk/SDa/YqvBL759R7W0QF/0G9zmxtvyjeCAAdfFg6?= =?iso-8859-1?q?lrq46hmT1p5pA+OiaW4R9w9PcPS8MrkIogO3fLQzkGEJkzjWpU2HSsFX6d5M?= =?iso-8859-1?q?vglyi2A2bzee8Tf8LJrh7NitbSeFmcaYf9wayBx4U6/f5NIiBNLZ/ZraH7Sx?= =?iso-8859-1?q?MmzskDRlGiP5di0F/88aHQ3sSzZTzhfWcksMQDcL63uuDL8UbkJqp0oKUUm4?= =?iso-8859-1?q?eNPApM0gPVP2ntKQQqfxBu/YAG18ZkFs4OnN5ZIbnzVY3ugM8whNRhRG6n+I?= =?iso-8859-1?q?zlwgLBZLt+ybhkir1Bvr8fst9QpZVWZrGSwNmoDQ6pLC61HmaFckvXI+c4JH?= =?iso-8859-1?q?2vozR1Eh0Z8tNY4PRVHzN6Mjzx+n+ICB++4aePMvrt0lTAgjT/B+39HaeKtO?= =?iso-8859-1?q?+2TLdfTGR4tz7LNRSyVvRjw0bQ6jTLeGYpSKw/uJwLMGUTpMLVjmlTQFtyTI?= =?iso-8859-1?q?JtsAIaR1c4JEeGejJJcT8p35CNgTiaicql7HvY3+RHRqoxwbroQq0lXAaqRP?= =?iso-8859-1?q?XJT4aq/w5vetmAWqoyF/SpigeE39DnCxp9UbUjfnwhaLQZiRhuYn+D9E35Xv?= =?iso-8859-1?q?H6ElCOpOFCkAs9v0P4DNptyryte0M+/Gv9DK37n6gm0Uooz/bv3dhfG4mFEQ?= =?iso-8859-1?q?7WopWOAHszKS7lWsEozKy0oYKmmeYuzLBh74CdrbjGu6v6x12m0qMg//XDWm?= =?iso-8859-1?q?oes7/hLqNhk/MOBcnE8hVrs5VgX9Tvjx0Gp8RAASQVwMZ+9IGYYf9DwoE3Ob?= =?iso-8859-1?q?VB/PRLxmMXPgjwrwmLkNcivWFxShYx8B/lJe9sFAj6inVjf7jWCGcnDiOjyv?= =?iso-8859-1?q?FlzNsD5Ro=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(376002)(136003)(39860400002)(199004)(189003)(5660300002)(4326008)(2201001)(8676002)(478600001)(81166006)(81156014)(14454004)(86362001)(8936002)(50226002)(7416002)(256004)(1076003)(71200400001)(71190400001)(2616005)(476003)(486006)(11346002)(446003)(186003)(305945005)(7736002)(97736004)(68736007)(66066001)(36756003)(6486002)(105586002)(106356001)(6436002)(6512007)(110136005)(76176011)(54906003)(52116002)(99286004)(26005)(386003)(6506007)(3846002)(316002)(6116002)(102836004)(6346003)(25786009)(53936002)(2906002)(2501003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB5592; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: BVggsVBP610u5rsiv3Gn9LIMMJ8rI6szoUKmaG8UF+5pAAb3QkS5hfko2VKpGH62QzOpJNVWcB+Jvp/NJsZroi/91pNJadLK5f4Kpj8FfWbXWUQ6zzTcbilZJKQEe0KCorrxef2aryCm8Zk8U94xKRmqLglhHh5wTJlUB+Y6qgVlyk0/61wMh45rXDL764VsUuPxmwU9vkGBmewDPEHElVcUACtLG9Wx43YS2Qf9E7pur0lihrZiGXu+eG9pHL50+FHXgMDT3R+VzfgIElLpRoTIQOzdAN7p4XGrLC1WRvVydZ7t4uesYXlZTEb2TPJ3aqxcppoX+UvFm3uVX4CyqGrreDSeqkrjweJDY2a8Y4ZR0ScE4sl0T5GW/tmI8HmORJAJydg0NB6p7KGYr0sF7ryAGw1tiH+grJ4dnmORP0k= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 61f90912-1997-48d7-0fdd-08d6a6044f34 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:31:16.1307 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB5592 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023210_812179_0F4AFEFF X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang In the loop block, there is not code change the loop key, this patch updated the loop key by re-read the INTx status register. This patch also change to clear the handled INTx status. Note: Need MV to test this fix. Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver") Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index 4ba458474e42..78e575e71f4d 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -361,6 +361,7 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) /* Handle INTx */ if (intr_status & PAB_INTP_INTX_MASK) { shifted_status = csr_readl(pcie, PAB_INTP_AMBA_MISC_STAT); + shifted_status &= PAB_INTP_INTX_MASK; shifted_status >>= PAB_INTX_START; do { for_each_set_bit(bit, &shifted_status, PCI_NUM_INTX) { @@ -372,12 +373,16 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) dev_err_ratelimited(dev, "unexpected IRQ, INT%d\n", bit); - /* clear interrupt */ - csr_writel(pcie, - shifted_status << PAB_INTX_START, + /* clear interrupt handled */ + csr_writel(pcie, 1 << (PAB_INTX_START + bit), PAB_INTP_AMBA_MISC_STAT); } - } while ((shifted_status >> PAB_INTX_START) != 0); + + shifted_status = csr_readl(pcie, + PAB_INTP_AMBA_MISC_STAT); + shifted_status &= PAB_INTP_INTX_MASK; + shifted_status >>= PAB_INTX_START; + } while (shifted_status != 0); } /* read extra MSI status register */ From patchwork Mon Mar 11 09:31:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847237 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5D7BB1390 for ; Mon, 11 Mar 2019 10:32:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 406BF28BE3 for ; Mon, 11 Mar 2019 10:32:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3453028C04; Mon, 11 Mar 2019 10:32:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C3B3028F69 for ; Mon, 11 Mar 2019 10:32:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=X7Eh79aHeCcBt5J6twLMXr2uQa+IMh3izarWMldg2Ls=; b=ItPO2aXRUkH2S7 9m3yjEa6bEOnS7iAX7keZiYYe5DLvrG6ERzfaogXdCDgQe2is7mSyzfT4Z1XL7ZesPcSSjW9STAWW NZx2rV5/W+jIrK0qOo6OrLszDLziwhVdYFXlstfmsVBpaeM7zuYXkM+m9hU7kM9FiQu1DDsDOHJqt pQ3a73mdxEOaRxhzyrZ5cNIcWVQNaq209qEr7sWEG3vP9q0O886aaBT21m1MP2kNr4aSV+4r2ZApD OASOvPeqcb6abcXw0lM0gtT3YJAQSgVJAjJjYHXEkTQP0Uu/cflifRKBxjTSk2Dx97CZjJqqRnyGN hMFKmUNyMNJ8zuktlQ+w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3IDx-0000Dh-HF; Mon, 11 Mar 2019 10:32:01 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3ID3-0007Mk-UA for linux-arm-kernel@bombadil.infradead.org; Mon, 11 Mar 2019 10:31:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=MIME-Version:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:Message-ID:Date:Subject:CC:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ioURpHbldQu1ga2fdu1nut9D4Rk/cA214SnJc+EcAus=; b=MmG4b1cDeJIJjk/ztrZgl2r8RS HZC1R4k0HwD2Ip5hJ612gxIUn9HqYqh2nmML5LyUQAcqYC8DrQJWZYV8cjdNK967srbJ05RlYr5e4 p84D7KF991BzX4F7CNxzhRLxSF3QiHrmlinUbsGE1wq+P+YnIYRUJy5w9uk9RlS/SmV9wQCdfCo4Q 3Ig+40YRfiEaHQgIFeoJDN39ns1r8Kv9i+NIy7sGipGwmxbv/zUqqd4LBoIs/E82FMxrLwvsm9bj5 Gmc07Y8rYuB2rxsPu39MM1xjv1OYz08tj+3XSH8/iTscu2ydt4Kh9q675eKkYhU//PSx/50uUUQPg BHZFMMmA==; Received: from mail-eopbgr70054.outbound.protection.outlook.com ([40.107.7.54] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HHx-0008Hu-Dk for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:32:07 +0000 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=ioURpHbldQu1ga2fdu1nut9D4Rk/cA214SnJc+EcAus=; b=YtIUtzBYKVs9FV8vMHYwMAP/Sx93EmjQzBepNz1ei40d+dMEdEGNoheBWmwhFN28FpVlVSHCaJHY+MpZ+3IFgU3fMt9XKA80UXZgGMQtTm9lQfdzsBX/lufSIPL5p4m1vi4JM2dPavpo0RMQTiS5UlzXRl8ukfujZ7nrUbB0zsA= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6566.eurprd04.prod.outlook.com (20.179.246.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Mon, 11 Mar 2019 09:31:23 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:31:23 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 11/28] PCI: mobiveil: only fix up the Class Code field Thread-Topic: [PATCHv4 11/28] PCI: mobiveil: only fix up the Class Code field Thread-Index: AQHU1+0xoaV/Y9GqOUGCpK8QyE26hg== Date: Mon, 11 Mar 2019 09:31:23 +0000 Message-ID: <20190311093130.7209-12-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ec21b41d-9e08-48d9-6d2a-08d6a60453c5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6566; x-ms-traffictypediagnostic: AM6PR04MB6566: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6566; 23:O2ykTF/dLD89ixjTqdMatg+bXuvZRGsSShvEKHQ?= =?iso-8859-1?q?QNohpZAFjZ1i/18?= =?iso-8859-1?q?pBSrYgnzk2Vp9QNwi5DmrY8xKKXemSbia3lQE38fv1ZHa4ngYc0Df88r7/9O?= =?iso-8859-1?q?ebj6PpPofdChrVWOH2SKvGLFAyRwLLThgtqofgsd01VpKNOHQAdIMu38mVoG?= =?iso-8859-1?q?HeBuPULgvVj6Gh904xJ4/TRCDnFsUBSqYR4nLmtqHUQV7yD/ePd+fATilGD1?= =?iso-8859-1?q?OFp5o2OdNP66zCx3oFim0aKnfWy7OVcHcLl4Cq/LqbcBTO4e/Zy/3rX0VJCB?= =?iso-8859-1?q?ZS0ClYTvJxpIoTyh3wWHLGGbwaORWQWF2JHh8fKEd1QkPEe8juFVuLti+Mym?= =?iso-8859-1?q?ZM+RrrGuVAnqzfqlDUhssax4CU6an7hEHmy2xwe12tjukTfElh0GF7kdtzdB?= =?iso-8859-1?q?74oBgRHMTQKwXV9tsJAIFk1Jqh+q5DMZpA2nldTnHalisI9f+aKdljKmt8o8?= =?iso-8859-1?q?nZjaO2r1XNJaIMU7TmYuekwYuHz7sseOj+b9+okw9+RttHPeetZnM8OGL/Xz?= =?iso-8859-1?q?MOhMcWEIENIVp2rY0O66Vd2tmvdHNKm3zvJHjdZCXcFMYyPVfvDqSeeuRlqE?= =?iso-8859-1?q?jt4NUZ9U6wAzuy/o2f6aJRbVSgpBA+UT99UoiA6aAz7Nzo+q7CLFq6XZVOlE?= =?iso-8859-1?q?33Ifv7CiJOaL8U6umYCxh3hvqIiK7To9lEC91QnjcPu8O2odVkCVWuIiXlAI?= =?iso-8859-1?q?SXc5hJeVwF8yzarnqX7ZXheeiTotVXxd3gEZICiTuQvs3+RJfE0i1oPa9MS+?= =?iso-8859-1?q?pMBeuYlMS0HcVs3A1R2xngg8db7j6WVeuOYf6Plkjx5LAyPgQihVKhavHYtM?= =?iso-8859-1?q?O/nPkj4+7H8uhC2sqqJy/5iWc65G5wQrMmfPjhSrutD/53wm6O9Fz/tQjN0D?= =?iso-8859-1?q?GSen7N1ZUJsJ6rYp2DyOb8Nfs1PGl1IP4/PSX8rE2cwmEsNbN8IeHC/I7Es0?= =?iso-8859-1?q?/vtI2xCRDCE74AiYtiq/1zFJvQTh8NFU7Id3ORSz0/kPx/LP7QmiyWSr2DHY?= =?iso-8859-1?q?O0EMJeemeW+DGK/5ekY09ErE/H2rcLJarTYznrkJlZIK1soKQJESgkCvvhld?= =?iso-8859-1?q?1axy8FiGoiTGWkBIc1dcPcymnqTk4Mo7he1m/JcAnCYAjALFJQniCccV5btN?= =?iso-8859-1?q?OY/qSNZD6+ca6gptaQ7nkg3IvCQpf6uLB/ztjMtx58bBChsC/Foa1jC/NzD6?= =?iso-8859-1?q?En7JyEAbwVMpx6zd6zluL7qBzfcMayYGjp40U2Jmejl0YPJ/ugbbvdRQ7atf?= =?iso-8859-1?q?4IDvWGnaWnRMOD4mxpDxXW9K0VTbaQ21ZMsOZHWPrEDfl9pw=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39860400002)(346002)(376002)(136003)(199004)(189003)(6436002)(478600001)(25786009)(99286004)(11346002)(2616005)(476003)(76176011)(3846002)(6116002)(81166006)(81156014)(486006)(71190400001)(71200400001)(2906002)(8676002)(2201001)(5660300002)(97736004)(6486002)(446003)(7416002)(2501003)(86362001)(256004)(14454004)(316002)(68736007)(26005)(8936002)(6512007)(53936002)(1076003)(66066001)(386003)(54906003)(50226002)(110136005)(102836004)(6506007)(36756003)(105586002)(4326008)(106356001)(186003)(305945005)(52116002)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6566; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: THh689YRWj/TDFnfuALOViBkWft0f3RUKmA7t7+CQ0P/2x/6rvUcdWvecCvsPbkNqriCjY8Eb711Dc/G8eGg88EYtdObwWtU5eF6b+uUb1ixIWgJcginYTb4yJWIrnOAn5mJyUmfUjoIiT3lZDOyQHDbLdsTkBPGWTMN+whblD5PGRUP4RnhLUOx87RLqa6RPziAaEL0KQlONVydsE6hucImKeEJ+Q5NeRFLX+DVd1TfG2+6VqJecC9LFCdacZoiddiobQX32vYRf8Dy016/LwattEVv2vqeqfgLJ4r+6OjHLxUTuWwawYS1x+deX4yT6PklMLVZL6Cg5wav8q40Z8NUIlNFOjGz2Ih9fsqkM/CiIq0kfWkH7Zip8h64EUuF0W26bnMjk/V/VyUSGGR+HNW6iEf0iJgNQforMnhL8E0= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec21b41d-9e08-48d9-6d2a-08d6a60453c5 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:31:23.7883 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_053205_553147_350F7725 X-CRM114-Status: GOOD ( 10.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang Fix up the Class Code to PCI bridge, do not change the Revision ID. And move the fixup to mobiveil_host_init function. Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver") Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index 78e575e71f4d..8eee1ab7ee24 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -653,6 +653,12 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) type, resource_size(win->res)); } + /* fixup for PCIe class register */ + value = csr_readl(pcie, PAB_INTP_AXI_PIO_CLASS); + value &= 0xff; + value |= (PCI_CLASS_BRIDGE_PCI << 16); + csr_writel(pcie, value, PAB_INTP_AXI_PIO_CLASS); + /* setup MSI hardware registers */ mobiveil_pcie_enable_msi(pcie); @@ -896,9 +902,6 @@ static int mobiveil_pcie_probe(struct platform_device *pdev) goto error; } - /* fixup for PCIe class register */ - csr_writel(pcie, 0x060402ab, PAB_INTP_AXI_PIO_CLASS); - /* initialize the IRQ domains */ ret = mobiveil_pcie_init_irq_domain(pcie); if (ret) { From patchwork Mon Mar 11 09:31:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847235 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C280139A for ; Mon, 11 Mar 2019 10:31:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03AD328F17 for ; Mon, 11 Mar 2019 10:31:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3EAD28F40; Mon, 11 Mar 2019 10:31:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6AD8E28F70 for ; Mon, 11 Mar 2019 10:31:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SVoGEN28RN/KwNvxFSXtQ7jHFbMJ41cl/zza4QMUOvI=; b=LIrXrnFhGjJt3n lwXhf8ORaxUtFjI9ZL1xmJ7Ii3C+rIXfs/4tKm2cEnzF+DxEOdVBgpykrUOMl9fJ047JDIOt4YPm6 KR7B0P1dyO1Pu4YyUDi2F/mijexHttX3pLhIGLTy8jQEg9eTf9efcQgqMCqvgE/8Zg1/yWOeuNyU5 1V+qXDiBsz341Cf6/+OD9RFB29DV11zFeZ50n46rggSpgEytwm7Zq2Elk6w9Oq0AoKGsBXFaEd/Pi Djn6sOCTZGFKBs1HLZ0E138CcKkIY2Js8TXzFTHP91e/wrKWkZqbWSZwv54lCIHHVXFL90YCIwp9g vZ/aEs68suUUhC7iJK6g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3IDc-0008JO-Qv; Mon, 11 Mar 2019 10:31:40 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3ID2-0007Mk-1X for linux-arm-kernel@bombadil.infradead.org; Mon, 11 Mar 2019 10:31:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=MIME-Version:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:Message-ID:Date:Subject:CC:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=y/a8qAlxeqJzSchfITzvJwR/7Avj4N4SKqgqIBpuQrE=; b=zDGCtSp/RqaaAOA8nhHzsjZgcN uXQR4X5BCF8lZKd/GGlibZwcP/PTu9yiaqaHz8YVuEzXzP6YBktVDyadDYXKlxiojfyoV/o5fDGSJ 5p4dBQwYmuQNDN5DZSidXtQjco4Y6rw1Wo8mVd3aW4jqBoCGGfT/w1pcsnME4mNm0fY7N6ia0x1Sn adTOCotX+ZfGIke/VzMzOAmqd2RgP75ALBA/xkk0YE9FOCkyHN5liNaSvzyB+P6XHfkM055zcP/Xk V4J7WYvXFAMWAnbj6wctsBZ7M2vSKP6IJU5CGhli362CTwVIYJpGU37ZenUGlKcdKV/dwQPnUwhxH leE/ESJA==; Received: from mail-eopbgr70054.outbound.protection.outlook.com ([40.107.7.54] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HHz-0008Hu-Me for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:32:08 +0000 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=y/a8qAlxeqJzSchfITzvJwR/7Avj4N4SKqgqIBpuQrE=; b=xUJHXxRbUcq/WXK5bOsZagJhPY0x9PGmcX6wxx37tHgv4h27ZdAOiNOk/iFNCNFclTF9YVTkrU7bzv1zahaI45juwAkSaJmlxSpYUZqBV8WS8CBSw9TRanjyn/vLGnO7nPoPNEbeyMh2/+3ngCHOXSn/XZnEFcoBVfz7MeG30zw= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6566.eurprd04.prod.outlook.com (20.179.246.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Mon, 11 Mar 2019 09:31:31 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:31:31 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 12/28] PCI: mobiveil: move out the link up waiting from mobiveil_host_init Thread-Topic: [PATCHv4 12/28] PCI: mobiveil: move out the link up waiting from mobiveil_host_init Thread-Index: AQHU1+01OAPqrzT7sUuzybX31Yd4fw== Date: Mon, 11 Mar 2019 09:31:31 +0000 Message-ID: <20190311093130.7209-13-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b552853a-3d70-4c14-8f56-08d6a604584c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6566; x-ms-traffictypediagnostic: AM6PR04MB6566: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6566; 23:60oAHf54hxehkY0pxln2hx8EpStpSmFlGhumKGU?= =?iso-8859-1?q?v8lxQagAbjVraZb?= =?iso-8859-1?q?EMAVe0f3cNvBye64V/4L1MGEPO2Z9bgosAapFOsVl74S0WLzNtE/R3n8mZZg?= =?iso-8859-1?q?nvRWyWRu+Y7wxVqrC0VCQ1h9FpKz1bPFpYHW6yGrJtiS4rRp9LqYn1pGp653?= =?iso-8859-1?q?mznB83dlN6LnesKm+5CeIGsRnyFHYV7Dis86VrfOIJZSeCk+8QhKewWePjEa?= =?iso-8859-1?q?CY9ThTXGIkl2GMzY6Ihk4d4n+ZLBMN4awVNkEgr4/rrHMiPbUO0MRWl515n1?= =?iso-8859-1?q?FNXxYjggHNpDrMhelDHzm+Z/2LX5e73fmGYYQahoRAn8tEupEqKeXXzig8db?= =?iso-8859-1?q?2jThAN+bnDI41eQ7igUc0IU2V2ffwAuyuQ7Go6dDiJGZ8cGj4lvSOGRjV6Bu?= =?iso-8859-1?q?wTUp1nsoCX3dqoXf4sLBEtu/td36Go8XfFCtHoAZm8JF5plqM2x/P8zIgrvZ?= =?iso-8859-1?q?amIe0UokavKWnYisnZik8ix74LKslpIQUIE86Hx/ZBTWDy4rCo1s7eEtFQJB?= =?iso-8859-1?q?XlGtFpLa9gpFNJaCUSiVfFzFgPiNL6HpUqQJ91V02A7mw2pQsmrk5A7t1j0O?= =?iso-8859-1?q?1Hz2ISABuMOKmEcSmDjRVod58nX63jmLX2WXElrkjKjn06IOSfJsQXmbsIlF?= =?iso-8859-1?q?CsCgXbUNeE/A3sI7q52AlOazmwfKCC//nLUL/5/i+tpGSTh0VPdGNNsOrzOU?= =?iso-8859-1?q?UqbicWe9lMbJLaQZFkykKD+i5eVZ76VxVqLCI3RaGqSw4SyDJZfCqK8CDMEU?= =?iso-8859-1?q?jItOpKV8NxcoR8/SFR5f/aOBbCFvD7tSjD4nwp8bm/wzwFeNsKlxBiXxxhAp?= =?iso-8859-1?q?eVuDueBcsMhefrG95A+AMObZ8vsB3OF3xkYPZAIC+L9VR4UhIrNBL94KrXqR?= =?iso-8859-1?q?eV3lp4gGX3QICtxUKqJAfn2svoAW95MtiB8A8sGwIdNRkYuLowoiIpAmkbYE?= =?iso-8859-1?q?LqfzDAw6dID5EF+cGexh6/kvSwvYDaCMDPd3zZDSxw8V8lG+KSQzxT6Hon+k?= =?iso-8859-1?q?nL0t3gi5UqJRB1CPUwpOS4rBLLkVlghUxoeZu8BCqCuRrvv0nclU23GXi261?= =?iso-8859-1?q?75/AF0SSY+5jnvWkvNpXwWveoKGjNXGi6VOw/zqBo5bmA5IO3zrUbxD9M6o1?= =?iso-8859-1?q?6mPuNVDeP21muQBkUJdo14+wF5VRxdMoB2guvQ0FueDbb0v9UQpVBKkNrmxQ?= =?iso-8859-1?q?FnzFVxamNSeyKBgwSWlhczzuBs+JmthSGAHkhvAHsVVs4CdMFu0TATbjzSFK?= =?iso-8859-1?q?0bTSUgW5cOYG07wVFz0rXixsyl3681PXQ7nexofzRE4dLTrEiIMdXacdvT6C?= =?iso-8859-1?q?jr8NxALK1NwFiqY3tDcI0yVFqeMV9mWlxX9PAxKvFAsx4YlhirGrl/0NDHgP?= =?iso-8859-1?q?tptAaXjLeA4kaHfFv9KrTY1BmY2+y0h5oK?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(396003)(366004)(39860400002)(346002)(376002)(136003)(199004)(189003)(6436002)(478600001)(25786009)(99286004)(11346002)(2616005)(476003)(76176011)(3846002)(6116002)(81166006)(81156014)(486006)(71190400001)(71200400001)(2906002)(8676002)(2201001)(5660300002)(97736004)(6486002)(446003)(7416002)(2501003)(86362001)(256004)(14454004)(316002)(68736007)(26005)(8936002)(6512007)(53936002)(1076003)(66066001)(386003)(54906003)(50226002)(110136005)(102836004)(6506007)(36756003)(105586002)(4326008)(106356001)(186003)(305945005)(52116002)(7736002)(921003)(1121003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6566; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 65107GJjDvV2B7D6cFCLRZo4NlHsdBJ4RWxIoaVDlGzpOIcc30M68pVV9YNTPorHGqQ7mAzJviUZAtrQE7/am+37lCCItczF+oT2sZNCE6cyod82tTUtgZo0oD7x0toIje7LdClRDVMwsB28NvqWfrXnyOTnB8LKOP+RBzEP0n/W0x+URm6uprEx0VZawFaVWP0NykmJlVx8PyKQDDB40wncjHngQhpjZTBQDPr6e+MFDZRYJcIXdPWqiH23UbZoqbweCRR088laDcwlchMzRRwBofErRrN9Qg8C7LTxleWOrnivzCZ09kQJXemV8CpWx3KxhNTQUNw4BPFKvmYWe5PQKOIlCK6VMfaEjdDORCMYB0h66cGnwSOkg6O7SnGM8Ehcp5YbL0mLptbcdQVKk9FELhFk30QNak6E574leJ4= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b552853a-3d70-4c14-8f56-08d6a604584c X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:31:31.3328 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_053207_760971_FB45EDC2 X-CRM114-Status: GOOD ( 13.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang Host initial sequence does not depend on PCIe link up, so move it to the place just before the enumeration. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index 8eee1ab7ee24..c2848c22b466 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -582,15 +582,8 @@ static void mobiveil_pcie_enable_msi(struct mobiveil_pcie *pcie) static int mobiveil_host_init(struct mobiveil_pcie *pcie) { u32 value, pab_ctrl, type; - int err; struct resource_entry *win; - err = mobiveil_bringup_link(pcie); - if (err) { - dev_info(&pcie->pdev->dev, "link bring-up failed\n"); - return err; - } - /* * program Bus Master Enable Bit in Command Register in PAB Config * Space @@ -662,7 +655,7 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) /* setup MSI hardware registers */ mobiveil_pcie_enable_msi(pcie); - return err; + return 0; } static void mobiveil_mask_intx_irq(struct irq_data *data) @@ -922,6 +915,12 @@ static int mobiveil_pcie_probe(struct platform_device *pdev) bridge->map_irq = of_irq_parse_and_map_pci; bridge->swizzle_irq = pci_common_swizzle; + ret = mobiveil_bringup_link(pcie); + if (ret) { + dev_info(dev, "link bring-up failed\n"); + goto error; + } + /* setup the kernel resources for the newly added PCIe root bus */ ret = pci_scan_root_bus_bridge(bridge); if (ret) From patchwork Mon Mar 11 09:31:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847233 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 60A69139A for ; Mon, 11 Mar 2019 10:31:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4817628F17 for ; Mon, 11 Mar 2019 10:31:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 457B528F3F; Mon, 11 Mar 2019 10:31:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BF8FB28F17 for ; Mon, 11 Mar 2019 10:31:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=roeqXrn2uf9Lec5VRhnIZ+WFX+swvbIdnpKv0vVmUSQ=; b=ZCI7l6kh1j0GPh b5gYVJ3Cp9amwk2zb1eQqy1CpwwrISV01bav1kiwgOkZru3n4f/slYl4qS4Cv7/xPPouSpidHcPib Zl1h4v54LBliBjAITy0uz56rEdYrlwiLYA3rH8s+6fuvhALn3S8/c46362YzwwgcdZc3mKOmR6Qmi MdL0DZM9Gs1pBzGX22ls8A5I0ofm6zyPTB2Ovvk/f9ItYEpNsYXLEE68dSrrjl6qO34DTiys1ZRX3 4V+caxvmcQe1t8lK42lP2LrtxsNkK5CBFlxnRgDDgMxOP5b2Y/qEbA84ZuU6yw3nsgkObwTGERaZG tcCXux42JGZ5S6Tw1bog==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3IDT-00085U-US; Mon, 11 Mar 2019 10:31:31 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3ID0-0007Mk-9v for linux-arm-kernel@bombadil.infradead.org; Mon, 11 Mar 2019 10:31:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=MIME-Version:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:Message-ID:Date:Subject:CC:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=h98GqNjPia0Xp1b4knoYmw7wXmiPPTfaTDiNOdqSt84=; b=aIImBaVfmPbjnbAaJawbT5cpej DThu9mC5JPiT2UM3C9MnkBbaz18OjJ1t9VSDEK91wOV3LXVG7yCqBBGvaY6KF3Dc4Ooh1LHMPGPBy 56t72xkmUEq4RxVTj+45tiPGT5cZj71rji4lcKUxFyfmJyITnCV4lJpaYvhl9N1BOQldeT888jfab Ft24csASK6ERZeOU9H3G3Yz/bsBy5XC2s8IT3nl98aLjB4FNZxn8UduVfKh8xlbNPSWqL1kqcbAsY WiDTlANGuhyzj7YqP3BOSE7Zt8GwHr0hmNHSsPbJXTHQG/3IXpznkxAhhlAXlXf4WCGhyIB5QLuFv SZdBg2Cw==; Received: from mail-eopbgr70054.outbound.protection.outlook.com ([40.107.7.54] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HI0-0008Hu-L4 for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:32:09 +0000 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=h98GqNjPia0Xp1b4knoYmw7wXmiPPTfaTDiNOdqSt84=; b=rIKJ8GFXovpkVwEAObHqb2a1CRmyTsryhbIgqyoUCJbeqqS8NUsFV+BMyx70o3iaVjh8OFSzSO+skQUaLrUNBv3A+BMr8d17moLqHBh2v041t30Mnx1pw+L7HpvRfGEQzEWinakrdX8F0yr9busSkZ2fScm4PdkcbFuVtGSgGVQ= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6566.eurprd04.prod.outlook.com (20.179.246.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Mon, 11 Mar 2019 09:31:39 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:31:39 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 13/28] PCI: mobiveil: move irq chained handler setup out of DT parse Thread-Topic: [PATCHv4 13/28] PCI: mobiveil: move irq chained handler setup out of DT parse Thread-Index: AQHU1+06/RSu/VKYqEqSsuWhKkfXmg== Date: Mon, 11 Mar 2019 09:31:39 +0000 Message-ID: <20190311093130.7209-14-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 50d783ff-2ff3-4f15-a954-08d6a6045cf6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6566; x-ms-traffictypediagnostic: AM6PR04MB6566: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6566; 23:vVC961mp7jwWISXcHyi3VCVMgHJjlVu5Mk0lVvJ?= =?iso-8859-1?q?ZhwZhu1Q9rqf/IE?= =?iso-8859-1?q?5dGMnQ2OdE/rZQ9q+PVcAOhdOIaT+7C1DXpiLbzGbFJOl2ENkBVfgIrtOd5j?= =?iso-8859-1?q?SW58IId09zS4qUhRi3X3P0KU98Z1hA1E03/mOyVKAoyGZBapvG2ChU3+mdd6?= =?iso-8859-1?q?4wKg8K3ax+xUEUg3Jq0jJ/0E/frMJjdoBNousuNfj0oATGfz5i2uYbTvrgte?= =?iso-8859-1?q?1yKwT8iV7O26qaO164tiFVZoFCA8BeLDPIUSdF29w9/V/1adOeKDAoNw4QXo?= =?iso-8859-1?q?WACbv2RX5QxllwIOAjsklQOA1IOfPjVBwgwE61JGuzQyuBaCYlguZl9aLtco?= =?iso-8859-1?q?Y/smwYso5ZKerNp2nb2zeriXh5T8rKFvzpSM4AOfmXR3cZax1P5J/BBY117A?= =?iso-8859-1?q?g1TjbTwJOEh0hel1FYo7yo1XDVXIc3U2Wq/HSUdI4tXyHDlcupYwFTuUhd+T?= =?iso-8859-1?q?g/FQtFDIl8HANo4F7Fl8Z9vbcAfn0J5SmFoRAh++d7YAuFlOWzADZJ+tNm4r?= =?iso-8859-1?q?5ksgVpXksb8mbNNx290ZPSeQ0NdB6L9S8pFE+PKz+Dev5LM4Ta86XQfsMR1Z?= =?iso-8859-1?q?rl5yH8i7Xu47tOCpxW9gDiBi8jSJ4DBoMLytj7O1g6RAWUxwx4M/JBVF0hRY?= =?iso-8859-1?q?DCuryPXUeZPDWcAXXqwfGt1elAW+uAb5RCWVKvAeqy5u1Y7/Pgh/zWHbDiIi?= =?iso-8859-1?q?WfNOkwkMgXQ65TCoKGFcEsL5W742o2IvaoiUtz75RG5kizuhCVr+EHuHHc8g?= =?iso-8859-1?q?qOxmnKGantviIlQOtChF8SGfrNM8LbF09vdILIoiQKA0AeMc3Z+Q6KFfgZqW?= =?iso-8859-1?q?J+0DYPQ4l7Am0GVpdFPPTZdU6XZWcVEVf+6v1lM6tFqrfP/SAHbT9m2mAeNq?= =?iso-8859-1?q?7Cq3/zeMlD9pOJEMmt29KCU9gnw2pN3kveU7UNnPkp3SZvycSF/ESm7FXEqR?= =?iso-8859-1?q?ZnKCJ1CCl4KZ6nyKmAEmO80kod/6A28KzYjzc0MUU/vVZcVLcgLuTVB1q9gI?= =?iso-8859-1?q?mrb6Ad9L3YrHnFduzWJJBOLWkFgO4H6CjGxDURfZCa29GrvpW/xF4KIFUG85?= =?iso-8859-1?q?2C/GGt/gop/NjawlYWuabCkPapLgXKfw7O1XWCSR8Qn0FpiIAcSsmOYCrBBX?= =?iso-8859-1?q?umGkU7NjKreccMhZbiZpht89ZR9Vj9pFN/DxlYt7QP2WDmunZv83LtutG5/y?= =?iso-8859-1?q?Jt4+KrP9sG0H9Izqwi3LU2w6V0Nle9iqXT/+lOj1RsOxZOl+CEJ8AeuSkkRO?= =?iso-8859-1?q?nB21OlQd69hlYgxX14+W3mdK0yq/m3OKfMa9USd/RqNQ33rLXZnih7VLhH5J?= =?iso-8859-1?q?nguVNfpx2tuhgKGkxb5KfjO/KXFLxt?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39860400002)(346002)(376002)(136003)(199004)(189003)(6436002)(478600001)(25786009)(99286004)(11346002)(2616005)(476003)(76176011)(3846002)(6116002)(81166006)(81156014)(486006)(71190400001)(71200400001)(2906002)(8676002)(2201001)(5660300002)(97736004)(6486002)(446003)(7416002)(4744005)(2501003)(86362001)(14444005)(256004)(14454004)(316002)(68736007)(26005)(8936002)(6512007)(53936002)(1076003)(66066001)(386003)(54906003)(50226002)(110136005)(102836004)(6506007)(36756003)(105586002)(4326008)(106356001)(186003)(305945005)(52116002)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6566; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Sa2KSAo4d5AZznuPv8V9PwBEdGH3paJinapbshFRL8msw5dwsk3VKQSuzKb5g2qF2k/TKMmJa8eR5Fcg0Y+vTKro9u0fgumdz6eUHGsTVomU6ec4aCpGVOkfq+tASECdmLNAN0nz6Ufi4w1lOSKCkyW6jiQ85XZlDduoj8ZUKulA9BxYKjO8QssL4ae4oEfAfbyl5voU6s+v2Bdnz7ED3lBRYgGCLM/XLwWyRfTSRoiHw68vxa2yAlzc4pm+ihM1OYCItd5owdmugTEVpBXRtUXJiT6HRgMNrqxISVkGyvVWywBdgrERMLrr5hZQznD8+qXha4ZAylL+PMxf3Gj2QLCTiKsR1H0jt8yGuAqjYmK2+YtmZfifH+HGXG3wiH0u+RZOPSWhX1dmZRRh6/OscXE9pqCqYLlbqsgJDuCb8l0= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50d783ff-2ff3-4f15-a954-08d6a6045cf6 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:31:39.3846 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_053208_719165_E6D622FB X-CRM114-Status: GOOD ( 11.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang Move irq_set_chained_handler_and_data() out of DT parse function. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index c2848c22b466..db7ecb021c63 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -460,8 +460,6 @@ static int mobiveil_pcie_parse_dt(struct mobiveil_pcie *pcie) return -ENODEV; } - irq_set_chained_handler_and_data(pcie->irq, mobiveil_pcie_isr, pcie); - return 0; } @@ -902,6 +900,8 @@ static int mobiveil_pcie_probe(struct platform_device *pdev) goto error; } + irq_set_chained_handler_and_data(pcie->irq, mobiveil_pcie_isr, pcie); + ret = devm_request_pci_bus_resources(dev, &pcie->resources); if (ret) goto error; From patchwork Mon Mar 11 09:31:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847231 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B08211390 for ; Mon, 11 Mar 2019 10:31:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96E6C28F70 for ; Mon, 11 Mar 2019 10:31:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8ADF228F69; Mon, 11 Mar 2019 10:31:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 36C1A28F45 for ; Mon, 11 Mar 2019 10:31:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=woNw11O4avJpUCcn2Q8H5UZTPnZw8ZzaYXHIcwtn8Vg=; b=hIzNVmQwTAEjDA VxhSXBmHP2jbTsr6duMtgkwgvnLHdK11ReBr2O55T1mIJIlBgjSH7ZwE2O3A3nPl407GqyVax3f/w CGUFiBCIDNi/s739+9hlCOMjn6k1an+Pi0QVwXPKBTVX42aBv7c7py4pKjCiQgGRcdn9nuwNl/Da4 I2RbyFWvkYJBCYk9wh3qS51Ka4zDAV1XPcr/AoTxAg4vwdjPfXy7n2+75frwrq1RsKyAlOrjXmwow DTwifvuwvpPm3tCLPQiaVl1oN9gR4prOwJANz8qF6e2IvBZCnmtLGYOy9FvEK8oe36XN6wzFy5rTy inWLKzXFAkfYpReDnxxQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3IDH-0007qQ-CA; Mon, 11 Mar 2019 10:31:19 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3ICy-0007Mk-L9 for linux-arm-kernel@bombadil.infradead.org; Mon, 11 Mar 2019 10:31:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=MIME-Version:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:Message-ID:Date:Subject:CC:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4BMcqpDgTrc8M2YPv+PL29hYMDyvskZ4hrkMnMjLAqE=; b=K6hHYn6bzfEwZn5hXFNZWGWZvR cUKdfvRbtIhjAgEZgkuwncZQ2gE17R10lu7u2dIRr9RL1WurDVlosRDFrD3PH9Hh5/I693AMULUtd cddRs94NmQopBLYjSmSctIwAxd1y+63k0L+ykJ6K3RtLUYvPFjjK56qOPVlqzdG9ukMxo4L5EdV86 +Sze5r/OSGB5BNc09X5tTRi4rv2NHi91SmLHGsrHEpLPXmPY+H9epIAwl4InROZp0CcgFla+Tbhdd fkRBRqb3yG1h7FFibopEgEOpCVHt7f+w5SnRNNWDWSUTCug2WqQzFMfpALMGWBd56tGVEQ9OAcDX8 z+IyzRkw==; Received: from mail-eopbgr70054.outbound.protection.outlook.com ([40.107.7.54] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HI1-0008Hu-JO for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:32:10 +0000 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=4BMcqpDgTrc8M2YPv+PL29hYMDyvskZ4hrkMnMjLAqE=; b=YMsp2PGjsP1kO+lD7OpZcsjeBpGkLywXpme/k9S75A5KbaujfNNWynXdFI3g9yGkBEbQ4w3pY23FuU1Osi5L5J7sjSk8BVYv9VwC5X2X5c+KtQ3ktjlaJ02CU5UR6ObT7XV+UG4bZVrBIB9M7RAh1CHf+fJoPBHYK+AxJozwJuI= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6566.eurprd04.prod.outlook.com (20.179.246.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Mon, 11 Mar 2019 09:31:48 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:31:48 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 14/28] PCI: mobiveil: initialize Primary/Secondary/Subordinate bus number Thread-Topic: [PATCHv4 14/28] PCI: mobiveil: initialize Primary/Secondary/Subordinate bus number Thread-Index: AQHU1+1AtGOoAU+YtEiiEyC+O3ktCA== Date: Mon, 11 Mar 2019 09:31:48 +0000 Message-ID: <20190311093130.7209-15-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6414e1d7-6e2f-4080-8d60-08d6a6046260 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6566; x-ms-traffictypediagnostic: AM6PR04MB6566: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6566; 23:2nyWhzU/u3C9d3uUunmmxohN6ssX76Bta/GZzl4?= =?iso-8859-1?q?2LdEThMKC44fQ82?= =?iso-8859-1?q?xbBPEPM8wwaI/yXhX/lrNbyqe5Pqt0poN+/yA8ZCQRmgoExoSngWJfIiwX+i?= =?iso-8859-1?q?NvRQCpRiW8az370thxqy0X8p0abt5Hc77Fz0aICrDGPnjVudQH07OISyFSXF?= =?iso-8859-1?q?M7yuJS/9vOFv52nVw2dLTMGwI5q8/9GUqXtPSkXMTAoISn4PSSty700UU45P?= =?iso-8859-1?q?7Fb6XMKbQpqaxTcZ6DN1SwSVdA97ICon1252/39qScU/p08h43/75pjBUr6M?= =?iso-8859-1?q?Xtv0ZDjDJ8KRMqnD8DDrBM5N7JWLdUoo0glOFAOdPbi5uLykSYzVraWO6PUf?= =?iso-8859-1?q?Yj5yA8iLwGGaMYUW0OPxLjU05GV1wmM8qQnQqtEgLckg51G26FGT90kz/eI0?= =?iso-8859-1?q?Qg/N3ENXUpOXhGfl9SdrlNM/YuJTIgDPuObUwg/Wmzxz71Owg6AOM9byxhOE?= =?iso-8859-1?q?5uTxzPMTyujR8urSbMYPjhQ1rlmMvfbGkWOpaAkEWO59CNTZ2m4qnc7vI9EZ?= =?iso-8859-1?q?YxXViM4LgDCB8n7iljWT9AKMqBOrPry43AgWErudx+mxLZGdQUoUye/XaIxe?= =?iso-8859-1?q?XmdMyJHt+GZrlaA83+eMfYrPvoE0PTxg6w0UPsFDkiO5ropXoFIIHbn0UJ1p?= =?iso-8859-1?q?EIMGgXLnN7yV06Tl7E/m2SzOsnqokbmlRa3xkzV0ecXIPYAyMxfaPS9iawA0?= =?iso-8859-1?q?DNj9bw9W20v8dHUC/dl/HOiDRJp4X3BG3By3DU+e/es7Kem26yMcAor8MQvI?= =?iso-8859-1?q?TI99GG8ZV1KJgGEuAkn+57YsGX/Wf4GWXB2ksC+7ZQF6fU27cCNQ+a0OCUwx?= =?iso-8859-1?q?RIdtiZUnuX/FPUYwuRmcxLAdne3y3j0Wsz8iNI21l0UfsVhfy2sUymcJU8sk?= =?iso-8859-1?q?8nTyFj+EYVZoNPE5WsxmCXIidCWsvEb1jP1V83EpHk6z06YrpJznV2D1Nv+W?= =?iso-8859-1?q?jF1YbjM635V4uPYIsn8RycyA89UCW2HY3KDu6E2WrmpU7dXUDeu80ZVOa5mK?= =?iso-8859-1?q?1+IR5QMLqVjMehed152zWVmbfOqiB2+PTFr/5lefWZIv4ZpK1DFftHexpOzm?= =?iso-8859-1?q?ye51BIHadrU2QytymtlB6hMVefAkvgVx5tCynP1IeRqz4PUaLCrPIuojoLZK?= =?iso-8859-1?q?LVgPnxpyiYJXk+DpOqScmf7XjdWQ+OvjWNNjW6oRpNWoKH2uTAnxogkt9cYu?= =?iso-8859-1?q?KUBPzjI/ld6vIEYk9J/Y9wz0H4uAJubOeWKnkil04Yh6PtFr8H/3VRB7dG5t?= =?iso-8859-1?q?v/5oCy1o6TYovYh95r6rY8WV0NIyioejH+Vbc7eT1h82XtwE24fAtQSUhPi4?= =?iso-8859-1?q?U2RXP3u+I=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39860400002)(346002)(376002)(136003)(199004)(189003)(6436002)(478600001)(25786009)(99286004)(11346002)(2616005)(476003)(76176011)(3846002)(6116002)(81166006)(81156014)(486006)(71190400001)(71200400001)(2906002)(8676002)(2201001)(5660300002)(97736004)(6486002)(446003)(7416002)(4744005)(2501003)(86362001)(256004)(14454004)(316002)(68736007)(26005)(8936002)(6512007)(53936002)(1076003)(66066001)(386003)(54906003)(50226002)(110136005)(102836004)(6506007)(36756003)(105586002)(4326008)(106356001)(186003)(305945005)(52116002)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6566; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ZOG5AiK+viOkVXE2H2LgmFb1AB3q/Hdn5Y8vJL2fFc7O+UqiFJbUnxvqxdsx4+uE0FBK25pRnq2LmoNi0RoNpHnXScbwLP9DbdCDYuTnPcC40Z9wBdRK6TblG5nz9IXPSBX8dcsLMbkhzv9RkDeXyozcd2E0TLl68g+2jmyDbaB6PT7mkiomBE+rNEck7yl9/LhkGZ+NqRg9DPkXL8tQbKi8IgQBtIkY0xWWA8onvDW1MuTkiPzubu9h5j00ZWJHcUbD5bdfB3SQbM/tgH0IykjjNgxnkD37sUDiVNp19EpMg1u7qwuOU3YnUAKYt1XNo/GsFzy4LCAi0Q9GLOG7Tph55W2p4R4yxxel+E7e3632eeYeio3t/AciG9OfGHjkVPQSdM3u/VXK1X1trk3sqIyDoxW4qLmBDvKoXpBsfDg= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6414e1d7-6e2f-4080-8d60-08d6a6046260 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:31:48.4531 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_053209_672609_6B3AD91B X-CRM114-Status: UNSURE ( 9.04 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang The reset value is all zero, so set a workable value for Primary, Secondary and Subordinate bus numbers. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/pcie-mobiveil.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c index db7ecb021c63..9210165fe8c0 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/pcie-mobiveil.c @@ -582,6 +582,12 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) u32 value, pab_ctrl, type; struct resource_entry *win; + /* setup bus numbers */ + value = csr_readl(pcie, PCI_PRIMARY_BUS); + value &= 0xff000000; + value |= 0x00ff0100; + csr_writel(pcie, value, PCI_PRIMARY_BUS); + /* * program Bus Master Enable Bit in Command Register in PAB Config * Space From patchwork Mon Mar 11 09:31:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847075 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 90A07139A for ; Mon, 11 Mar 2019 09:33:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75B2628E39 for ; Mon, 11 Mar 2019 09:33:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6966528E73; Mon, 11 Mar 2019 09:33:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 04B9F28E39 for ; Mon, 11 Mar 2019 09:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uspzINJr3cHofchQ457r2sJgwC33JzvwXFBqoRM8Klg=; b=TTxoJkg8xX5Cla ISCWfRbs6xYKsSmoXDs5cIzIAoEQZ+d1wwkMP7elLbTFsSiFunWKER55s5qnmSi1HkveatvcVBRmc nM0M1A73/z59aEVdunMNpuGamTxccB6GG2N/xPVOR+mb/Z6NN4jsjewJqspiHfuVVCloFwqI7rhkt KriYiypqeIURTakj3qzU0VFwCMsrAUIrbsGTlpBvlG+dsxy1YlQPMhIH6jRfbgFfzkqB3UmL1Lcci BmyzBirqt1t9irigoOVXIaOcWY1AU7Ab4sPTVH9ufjPJPb1mErJqg3c/qEpPdiIvfhgvnBxEpUsXI A3tLcaqsehoEn8GMQmtg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HIp-0003Qm-FU; Mon, 11 Mar 2019 09:32:59 +0000 Received: from mail-eopbgr70049.outbound.protection.outlook.com ([40.107.7.49] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HI4-0000Rr-Gy for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:32:47 +0000 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=bwQmuOG1mZDjPwBK/BZ1hEmqeje416sikwB+xbTSKZM=; b=I14Sxy26vp+AqplOiTtruqF87X8+vBBUBuzRT2bBBL0EKl3KqOiNvYJFKkUd4MtsIkpzQ8wOlx/K9pqC+Yp9uH0MZ+V5Jh6XCKq8eSGmOScAWrjDA/V67K99jag/oqma7rNgysSltsZaZKqrEIhn0b7mJ0K9vQz0L55RWe6FW6w= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6566.eurprd04.prod.outlook.com (20.179.246.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Mon, 11 Mar 2019 09:31:55 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:31:55 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 15/28] dt-bindings: pci: mobiveil: change gpio_slave and apb_csr to optional Thread-Topic: [PATCHv4 15/28] dt-bindings: pci: mobiveil: change gpio_slave and apb_csr to optional Thread-Index: AQHU1+1Eh+uOewU500u0mr9dSGaHtQ== Date: Mon, 11 Mar 2019 09:31:54 +0000 Message-ID: <20190311093130.7209-16-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: aae8e711-33f7-4bcf-b7b2-08d6a604663f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6566; x-ms-traffictypediagnostic: AM6PR04MB6566: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6566; 23:OsF4Ey4/7FW24eXF7PPRHeZpP93nIgCyhgPx+Ng?= =?iso-8859-1?q?akXTI27mH3qTxbo?= =?iso-8859-1?q?7TBNGsibZmCSHLFqDYN3x9jNH2XHEBIbioL9ikhNpkUXrLbEyQTXCfIZrL+t?= =?iso-8859-1?q?jwHOppce8JOSCQtKGMBvfzY/enwqvx5UiB7BZA2HsIRHd+yLsinqVHLRMFo2?= =?iso-8859-1?q?r/Z3VhgejE/1hsY05lqWevufivl0Cc0K1q0ZPvjGMlZqn+vbEklrD76cfATI?= =?iso-8859-1?q?RoAC7tzVqQCjC81oDjpmvoVSx07QBj9IlX8dmAkvDPufL18qEcKDAF/Ym53V?= =?iso-8859-1?q?KzdxyKlYx3Q4aTLBtCI1LrtqmahqO1VaftxhmYPuNstNH8WfUdit4HM6OOjk?= =?iso-8859-1?q?WGfGXyUcr7SI73hep+cwXlrvVQSDqdGdJ5b4pIIKbIK/RfhmPKM42qkm7VgK?= =?iso-8859-1?q?FwDE/rwf7XKtClx7EMLaY5r/60ZlHw4fw/rLPGJMqvN9FBhkwSgmgA03y5J6?= =?iso-8859-1?q?9hYcaVQXI3V4ZWR0MRvD2YSt2BXXvp0Ia5n+fwPiQ2fUGSh7kJt5x0qW3X+i?= =?iso-8859-1?q?jEM17zhYHY2BTZuz36OQ6AccBy7xWRma017mnzy8HmX0+5+CVC5vIbFsAbc2?= =?iso-8859-1?q?VepiP41J5hxjTaJ+mNKgUm43XUKRUtekcHsAroZ+49DI2MabE7HutZAX1Ujv?= =?iso-8859-1?q?dqq3gWHpD04lPVy7e/yPf38VLkoogKNe0Knsynki8a/Aw40M6ECCWqL2bOEt?= =?iso-8859-1?q?AuwCcUkd9yRsgVuwMKfxKQsIqP7M7IVAyvaWmzuOMbuU5jaZkIFHVg96k2Pv?= =?iso-8859-1?q?RduvFZ9WjGsgMzGzKDr0Qh765Vpz7J7I9xTEOwdFKDq5ge2hOuFPSrc74xEP?= =?iso-8859-1?q?J6t5hvBiAefVrKDTNSYc9Y7ALUsksXyxAF5HBzQdtuCKmGZUljUgbZnfbfXR?= =?iso-8859-1?q?wZ/jRl1N3Kp2tIlOjI+JAq14ca1lLMafM7PyuK/vs932TbBhCdUrkWPIJVwz?= =?iso-8859-1?q?lNqZ136OoiNa8GNBfstEdauYCK1+8TSE10rm1gJXlgcARdYxiv9r6oavmdkw?= =?iso-8859-1?q?EyA1Bodxzb7Zd2QZ0RS9ZnS6Iwi7OUdLg0M22KjwwBoy9IQQ4jqDKTp8vKkZ?= =?iso-8859-1?q?5RrM+NITuM2WOID0iVI5MCAdIwy2woCkRfTxfNqMAljDnrE3Woe6h09lDZ7i?= =?iso-8859-1?q?EEW+lZEbzUgTUDaJMwzydfD05rWMYADmHNa/GudPQpYlc+DwCeJdJ8ywS40d?= =?iso-8859-1?q?qv59nVOFJmHJb8cEkY7eJBEd0lfjFpJdIIK8BjyDsZSOUbflp07RBJwyfXdD?= =?iso-8859-1?q?uvwEWS6MXR9ii2dvjmOP6ZMRCeVdS1emxsC1pWWazERtc02w=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39860400002)(346002)(376002)(136003)(199004)(189003)(6436002)(478600001)(25786009)(99286004)(11346002)(2616005)(476003)(76176011)(3846002)(6116002)(81166006)(81156014)(486006)(71190400001)(71200400001)(2906002)(8676002)(2201001)(5660300002)(97736004)(6486002)(446003)(7416002)(2501003)(86362001)(256004)(14454004)(316002)(68736007)(26005)(8936002)(6512007)(53936002)(1076003)(66066001)(386003)(54906003)(50226002)(110136005)(102836004)(6506007)(36756003)(105586002)(4326008)(106356001)(186003)(305945005)(52116002)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6566; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: A5VUvjamFratLulhhIws1fJrgKiySSPopYwFXEhnw5MDSpqtmbfc2SyukLkSJJqvQEh3WWHszj9M5WWhhH3Qyx4+8x2w/wfRhq4ich2CSb+x5MgNGMsdtp+xVj8N4oRBu3dLTzS/0ogW9DOqLCBfnXh1oC6ZVjydKYQy129Se/aRAzMAJYoWfsKv4z6D+ewzwxP+1NgaKhsX/D0YPQDfHcO3T1qZgvnHs/0JiYYtjq+IW1EllmoY2PwlJC54S5xtAFmAj+ZXJ0EY7hsaJZt8Cd7OQulJ+EVC+YP7H1jzU7V40S2LvM6vHqR8bIEW4hXfcO4Tc8PvuZ0MRYF5IOSi12qXH7GyE6zcP1t3rc3RJDCcCLX0xl0cCRcdLpjB3pCli+ftzdNcjn/KrexgSBTgCDKeQzGPEnEcfjrJ8fJnvRo= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aae8e711-33f7-4bcf-b7b2-08d6a604663f X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:31:54.9729 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023213_232763_C3635C6D X-CRM114-Status: GOOD ( 10.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang Change the "gpio_slave" and "apb_csr" to optional, the "gpio_slave" is not used in current code, and "apb_csr" is not used by some platforms. Signed-off-by: Hou Zhiqiang Acked-by: Subrahmanya Lingappa Acked-by: Rob Herring Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change Documentation/devicetree/bindings/pci/mobiveil-pcie.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/mobiveil-pcie.txt b/Documentation/devicetree/bindings/pci/mobiveil-pcie.txt index a618d4787dd7..64156993e052 100644 --- a/Documentation/devicetree/bindings/pci/mobiveil-pcie.txt +++ b/Documentation/devicetree/bindings/pci/mobiveil-pcie.txt @@ -10,8 +10,10 @@ Required properties: interrupt source. The value must be 1. - compatible: Should contain "mbvl,gpex40-pcie" - reg: Should contain PCIe registers location and length + Mandatory: "config_axi_slave": PCIe controller registers "csr_axi_slave" : Bridge config registers + Optional: "gpio_slave" : GPIO registers to control slot power "apb_csr" : MSI registers From patchwork Mon Mar 11 09:32:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847095 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DA94017DF for ; Mon, 11 Mar 2019 09:33:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA84528E73 for ; Mon, 11 Mar 2019 09:33:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADF6228E82; Mon, 11 Mar 2019 09:33:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 769E528E81 for ; Mon, 11 Mar 2019 09:33:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6FEZau88N0b+ZwdwGfGcZyNUrD4YfuoAi8a0PvxtS7U=; b=i/1swNL4YYHtqt wve+wBp0bg4iiDYkQWw/Fy915Qh0uoJtFEqCd11FS49zpQ7mfhGHJ2Mn8X2BFUtrTwBvVnXW0Jy1L Fh/4oUoB8w08jgiFU3Lo1bnIRllI42rGfz0DcMzI91Bz9hFDBH0OD2m9cgfILQqX1MPAufDj/NCm8 ZphPkP8CNawhrTmYzVDRfy/xqYGp/96O4XQcDfOQX/0WygR5z5AigA2xhJ1XLUqhCbpCpLwQ9GZN1 JuRWSSg0j4dXKdgzUniU+b2uA5wRfpydP8i+OfwpONw31jXHCxLWQBAY5gbrY2QlfQtLhqWhw37WY nmoM1jBCdDkURrYtuSAw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HJQ-0004Az-Nh; Mon, 11 Mar 2019 09:33:36 +0000 Received: from mail-eopbgr80055.outbound.protection.outlook.com ([40.107.8.55] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HId-0003Cg-AX for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:33:23 +0000 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=NhItaE5nDuYbjyzsvAZlSUfLN3asWmS3e3H64G9swIk=; b=mOSMyX8ySNXgWYelBzejd3N2DbIdV5NVkCs4OsYhmu504ZsgzzIWCHOwkbUbNobqxVju0ceorGNg1T53jCrovqtGlqVjlpF6ENXOyDoGTdP9SQ6tTftTqb8m4z3vxlJxKE9yKXUKGtg0xruZyPlW91ofLrkVoHNftYGh9aYxHLU= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6566.eurprd04.prod.outlook.com (20.179.246.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Mon, 11 Mar 2019 09:32:04 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:32:04 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 16/28] PCI: mobiveil: refactor Mobiveil PCIe Host Bridge IP driver Thread-Topic: [PATCHv4 16/28] PCI: mobiveil: refactor Mobiveil PCIe Host Bridge IP driver Thread-Index: AQHU1+1JKH7BRWLFLk+IghztSVt2gg== Date: Mon, 11 Mar 2019 09:32:04 +0000 Message-ID: <20190311093130.7209-17-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c4231c9c-5689-4393-cbd5-08d6a6046ad7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6566; x-ms-traffictypediagnostic: AM6PR04MB6566: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6566; 23:IWC8gnUhHI+bvMaMAh/WUkh6XSqMJoCfGfJRUhx?= =?iso-8859-1?q?5SS/DRojCunt48W?= =?iso-8859-1?q?DeY+LfraLVQFBNEkO+YwElvtnHIR73ovJjhSekGwwdE5j08/rtoT0/jnJzK0?= =?iso-8859-1?q?XBc4/XFwBmFyIv0bPhzQU5N1Td7YMWrEsKH6lmGT2Jh74Tm8va2YWgF0xuB/?= =?iso-8859-1?q?+yqgbpNvXPXB0Ki5Rg/WN5RfkvqAiPEhGdUI22gvx1fp+cOjsVk+FuDxuWXa?= =?iso-8859-1?q?VAywjRFmGbJs1GrSEI9yOn3OFT7Dm67BD2kJkhNps12S+OZWLJmOfi5zMywA?= =?iso-8859-1?q?u3BYxG4gcthyD3Jxg11+4CUvgD7xCIGEzi1nTjWdYcjF4WM0lyraEstiTD1H?= =?iso-8859-1?q?KmpFPX98gc+BMadfj1il0oUuWFHWDojlblcHoHQf5Q9Bm4l+VzeS7punrtQO?= =?iso-8859-1?q?8TCgbsNjh6vIXocZIzcH3LHIdyRyvZ9OIAB5sZumHMSQDkwQ2PPVc+T14YiD?= =?iso-8859-1?q?H2iU/sn/VbgLYcaSzaa/GUyTRd+zw1NmOd2tQ1nwxQfo14ZzruHfDou0+r05?= =?iso-8859-1?q?Qv6wUDguiyGi7BXBfuCwK35ntt4u+7KyP4GyxRmJLdjSFCSkGYetfXCSX9vN?= =?iso-8859-1?q?QSVcwy/nmKpPtGTNGIXXgVcXiTLkNHqEhz1kdC1wDtynvRV4qQll8VAJTwJ2?= =?iso-8859-1?q?is99+LsEeM70DIaJBOlVSuYGPhmNSCQZ6MRAR+gLjK9nwtVFh811K+OaYHHO?= =?iso-8859-1?q?FwaSYQKisSLp6ugYbFjMsPQqqyEiTOMQgiPGI4v4xibLybIqadq8oSfEZ9ES?= =?iso-8859-1?q?Da2CS5JBpuXXpKfp9+qWNcsq8rDANRfggWQDToLaPOS90ZbvAfbnzHfTHWHH?= =?iso-8859-1?q?HXUhSZk0aAOF02TAICXAhFypwQqtYWu3S9jhgsmXgd8SOp7io7ZO1QNk5Lum?= =?iso-8859-1?q?XNp91oQb/HwNcjUHT0GpNWHYQBw/bY4U1HV6fqq4Zw8t8ODE2eHxvdm5xLMg?= =?iso-8859-1?q?6/qTm3kT199MUCO9M0X7wJp97Oz5jUmgZvJOFPb2QubVUos9Zd1PJnSC85fA?= =?iso-8859-1?q?mpboN4uXIAK1d2Fq4rYLGujkfxj6pwrJEbC0YisUXmAthzTIzWIsrciS4umr?= =?iso-8859-1?q?5oBaSsFTdXf3Yziv9bfN3w5cL5cgyzNTMBwzQWeWkcpUUEnNRWue4Q3tOAH0?= =?iso-8859-1?q?sr7knWS7QAN58GPuYZSCvtJ9qGC24iINOh7JcMWAV7o4Z0BNxONRPXmet2Rw?= =?iso-8859-1?q?43aMyP3CzqW5svGgxGIhMSn3gutes2S7C3M3F43x9Uk7RCluc0sR4gXJ6Xmu?= =?iso-8859-1?q?drdb9sUmlTpobxQSpwmIvw2sPtTr805VQ+/RYiRFc1mSIvmw7MBuxa/5iuSR?= =?iso-8859-1?q?w1T4Jgw0FNn7pdyIX55FqiLvVmdNL1hkWgN/zX+4csyeEN83SJEHVmRFO3xP?= =?iso-8859-1?q?3jt97fLbk/6d5hd2EgOwKfkj11Zg0W+TfLoL+exgfUJC0ydeWvhmi7JA=3D?= =?iso-8859-1?q?=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39860400002)(346002)(376002)(136003)(199004)(189003)(6436002)(478600001)(25786009)(99286004)(11346002)(2616005)(476003)(76176011)(3846002)(6116002)(81166006)(81156014)(486006)(71190400001)(71200400001)(2906002)(8676002)(2201001)(5660300002)(97736004)(6486002)(446003)(7416002)(30864003)(2501003)(86362001)(5024004)(14444005)(256004)(14454004)(316002)(53946003)(68736007)(26005)(8936002)(6512007)(53936002)(1076003)(66066001)(386003)(54906003)(50226002)(110136005)(102836004)(6506007)(36756003)(105586002)(4326008)(106356001)(186003)(305945005)(52116002)(7736002)(921003)(1121003)(579004)(559001)(569006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6566; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: MJzDR68uvsbzuyE0UTV/MNLRoRdTiHFalaUyYDrYGbTUrYA+rZ+mY2YnI3lYRFpmn4EiatP6CkOtRTfGXkor66vE6mmVmzA0IVYLsKw/TT9C7ef7zFYjFP67jh552mk7qvMt6KPKCXj1lYTFbFBsb3UZkMJmg5Vw2GgcdYAKIZR9IK8FVYC4bZsPJCSY3Ol6dcUM7iPk+Ps0GEOijZQzCgX2/3mp/psAp2YX3Rhn1aiJZfRy1MR8ZK4Uo6xQHdqXEkhUNaNFDAEgZQgu/LGNOwtlGj7wXbXm/tEXZchtvURtusF4hz4lBicipWBsbrV9HNS5dxC2lsgmhO/QjO3ynY0OsC1VJtB6ngRXjnF5hgahhhqM3Qb2y+xmMjubCyPH1BUeUOsdwcr4YeLmA2uYHHn2VOk7OETq58VYsA5wGPw= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4231c9c-5689-4393-cbd5-08d6a6046ad7 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:32:04.1425 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023247_853470_0FFFFABE X-CRM114-Status: GOOD ( 17.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang As the Mobiveil PCIe controller support RC&EP DAUL mode, and to make platforms which integrated the Mobiveil PCIe IP more easy to add their drivers, this patch moved the Mobiveil driver to a new directory 'drivers/pci/controller/mobiveil' and refactored it according to the abstraction of RC&EP (EP driver will be added later). Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change MAINTAINERS | 2 +- drivers/pci/controller/Kconfig | 11 +- drivers/pci/controller/Makefile | 2 +- drivers/pci/controller/mobiveil/Kconfig | 24 + drivers/pci/controller/mobiveil/Makefile | 4 + .../pcie-mobiveil-host.c} | 528 +++--------------- .../controller/mobiveil/pcie-mobiveil-plat.c | 54 ++ .../pci/controller/mobiveil/pcie-mobiveil.c | 228 ++++++++ .../pci/controller/mobiveil/pcie-mobiveil.h | 187 +++++++ 9 files changed, 587 insertions(+), 453 deletions(-) create mode 100644 drivers/pci/controller/mobiveil/Kconfig create mode 100644 drivers/pci/controller/mobiveil/Makefile rename drivers/pci/controller/{pcie-mobiveil.c => mobiveil/pcie-mobiveil-host.c} (55%) create mode 100644 drivers/pci/controller/mobiveil/pcie-mobiveil-plat.c create mode 100644 drivers/pci/controller/mobiveil/pcie-mobiveil.c create mode 100644 drivers/pci/controller/mobiveil/pcie-mobiveil.h diff --git a/MAINTAINERS b/MAINTAINERS index 1e64279f338a..1013e74b14f2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11877,7 +11877,7 @@ M: Subrahmanya Lingappa L: linux-pci@vger.kernel.org S: Supported F: Documentation/devicetree/bindings/pci/mobiveil-pcie.txt -F: drivers/pci/controller/pcie-mobiveil.c +F: drivers/pci/controller/mobiveil/pcie-mobiveil* PCI DRIVER FOR MVEBU (Marvell Armada 370 and Armada XP SOC support) M: Thomas Petazzoni diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig index 6671946dbf66..0e981ed00a75 100644 --- a/drivers/pci/controller/Kconfig +++ b/drivers/pci/controller/Kconfig @@ -241,16 +241,6 @@ config PCIE_MEDIATEK Say Y here if you want to enable PCIe controller support on MediaTek SoCs. -config PCIE_MOBIVEIL - bool "Mobiveil AXI PCIe controller" - depends on ARCH_ZYNQMP || COMPILE_TEST - depends on OF - depends on PCI_MSI_IRQ_DOMAIN - help - Say Y here if you want to enable support for the Mobiveil AXI PCIe - Soft IP. It has up to 8 outbound and inbound windows - for address translation and it is a PCIe Gen4 IP. - config PCIE_TANGO_SMP8759 bool "Tango SMP8759 PCIe controller (DANGEROUS)" depends on ARCH_TANGO && PCI_MSI && OF @@ -281,4 +271,5 @@ config VMD module will be called vmd. source "drivers/pci/controller/dwc/Kconfig" +source "drivers/pci/controller/mobiveil/Kconfig" endmenu diff --git a/drivers/pci/controller/Makefile b/drivers/pci/controller/Makefile index d56a507495c5..b79a615041a0 100644 --- a/drivers/pci/controller/Makefile +++ b/drivers/pci/controller/Makefile @@ -26,11 +26,11 @@ obj-$(CONFIG_PCIE_ROCKCHIP) += pcie-rockchip.o obj-$(CONFIG_PCIE_ROCKCHIP_EP) += pcie-rockchip-ep.o obj-$(CONFIG_PCIE_ROCKCHIP_HOST) += pcie-rockchip-host.o obj-$(CONFIG_PCIE_MEDIATEK) += pcie-mediatek.o -obj-$(CONFIG_PCIE_MOBIVEIL) += pcie-mobiveil.o obj-$(CONFIG_PCIE_TANGO_SMP8759) += pcie-tango.o obj-$(CONFIG_VMD) += vmd.o # pcie-hisi.o quirks are needed even without CONFIG_PCIE_DW obj-y += dwc/ +obj-y += mobiveil/ # The following drivers are for devices that use the generic ACPI diff --git a/drivers/pci/controller/mobiveil/Kconfig b/drivers/pci/controller/mobiveil/Kconfig new file mode 100644 index 000000000000..64343c07bfed --- /dev/null +++ b/drivers/pci/controller/mobiveil/Kconfig @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: GPL-2.0 + +menu "Mobiveil PCIe Core Support" + depends on PCI + +config PCIE_MOBIVEIL + bool + +config PCIE_MOBIVEIL_HOST + bool + depends on PCI_MSI_IRQ_DOMAIN + select PCIE_MOBIVEIL + +config PCIE_MOBIVEIL_PLAT + bool "Mobiveil AXI PCIe controller" + depends on ARCH_ZYNQMP || COMPILE_TEST + depends on OF + select PCIE_MOBIVEIL_HOST + help + Say Y here if you want to enable support for the Mobiveil AXI PCIe + Soft IP. It has up to 8 outbound and inbound windows + for address translation and it is a PCIe Gen4 IP. + +endmenu diff --git a/drivers/pci/controller/mobiveil/Makefile b/drivers/pci/controller/mobiveil/Makefile new file mode 100644 index 000000000000..9fb6d1c6504d --- /dev/null +++ b/drivers/pci/controller/mobiveil/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 +obj-$(CONFIG_PCIE_MOBIVEIL) += pcie-mobiveil.o +obj-$(CONFIG_PCIE_MOBIVEIL_HOST) += pcie-mobiveil-host.o +obj-$(CONFIG_PCIE_MOBIVEIL_PLAT) += pcie-mobiveil-plat.o diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c similarity index 55% rename from drivers/pci/controller/pcie-mobiveil.c rename to drivers/pci/controller/mobiveil/pcie-mobiveil-host.c index 9210165fe8c0..dc5324d94466 100644 --- a/drivers/pci/controller/pcie-mobiveil.c +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c @@ -4,9 +4,9 @@ * * Copyright (c) 2018 Mobiveil Inc. * Author: Subrahmanya Lingappa + * Refactor: Zhiqiang Hou */ -#include #include #include #include @@ -23,275 +23,21 @@ #include #include -#include "../pci.h" - -/* register offsets and bit positions */ - -/* - * translation tables are grouped into windows, each window registers are - * grouped into blocks of 4 or 16 registers each - */ -#define PAB_REG_BLOCK_SIZE 16 -#define PAB_EXT_REG_BLOCK_SIZE 4 - -#define PAB_REG_ADDR(offset, win) \ - (offset + (win * PAB_REG_BLOCK_SIZE)) -#define PAB_EXT_REG_ADDR(offset, win) \ - (offset + (win * PAB_EXT_REG_BLOCK_SIZE)) - -#define LTSSM_STATUS 0x0404 -#define LTSSM_STATUS_L0_MASK 0x3f -#define LTSSM_STATUS_L0 0x2d - -#define PAB_CTRL 0x0808 -#define AMBA_PIO_ENABLE_SHIFT 0 -#define PEX_PIO_ENABLE_SHIFT 1 -#define PAGE_SEL_SHIFT 13 -#define PAGE_SEL_MASK 0x3f -#define PAGE_LO_MASK 0x3ff -#define PAGE_SEL_OFFSET_SHIFT 10 - -#define PAB_AXI_PIO_CTRL 0x0840 -#define APIO_EN_MASK 0xf - -#define PAB_PEX_PIO_CTRL 0x08c0 -#define PIO_ENABLE_SHIFT 0 - -#define PAB_INTP_AMBA_MISC_ENB 0x0b0c -#define PAB_INTP_AMBA_MISC_STAT 0x0b1c -#define PAB_INTP_INTX_MASK 0x01e0 -#define PAB_INTP_MSI_MASK 0x8 - -#define PAB_AXI_AMAP_CTRL(win) PAB_REG_ADDR(0x0ba0, win) -#define WIN_ENABLE_SHIFT 0 -#define WIN_TYPE_SHIFT 1 -#define WIN_TYPE_MASK 0x3 -#define WIN_SIZE_SHIFT 10 -#define WIN_SIZE_MASK 0x3fffff - -#define PAB_EXT_AXI_AMAP_SIZE(win) PAB_EXT_REG_ADDR(0xbaf0, win) - -#define PAB_EXT_AXI_AMAP_AXI_WIN(win) PAB_EXT_REG_ADDR(0x80a0, win) -#define PAB_AXI_AMAP_AXI_WIN(win) PAB_REG_ADDR(0x0ba4, win) -#define AXI_WINDOW_ALIGN_MASK 3 - -#define PAB_AXI_AMAP_PEX_WIN_L(win) PAB_REG_ADDR(0x0ba8, win) -#define PAB_BUS_SHIFT 24 -#define PAB_DEVICE_SHIFT 19 -#define PAB_FUNCTION_SHIFT 16 - -#define PAB_AXI_AMAP_PEX_WIN_H(win) PAB_REG_ADDR(0x0bac, win) -#define PAB_INTP_AXI_PIO_CLASS 0x474 - -#define PAB_PEX_AMAP_CTRL(win) PAB_REG_ADDR(0x4ba0, win) -#define AMAP_CTRL_EN_SHIFT 0 -#define AMAP_CTRL_TYPE_SHIFT 1 -#define AMAP_CTRL_TYPE_MASK 3 - -#define PAB_EXT_PEX_AMAP_SIZEN(win) PAB_EXT_REG_ADDR(0xbef0, win) -#define PAB_EXT_PEX_AMAP_AXI_WIN(win) PAB_EXT_REG_ADDR(0xb4a0, win) -#define PAB_PEX_AMAP_AXI_WIN(win) PAB_REG_ADDR(0x4ba4, win) -#define PAB_PEX_AMAP_PEX_WIN_L(win) PAB_REG_ADDR(0x4ba8, win) -#define PAB_PEX_AMAP_PEX_WIN_H(win) PAB_REG_ADDR(0x4bac, win) - -/* starting offset of INTX bits in status register */ -#define PAB_INTX_START 5 - -/* supported number of MSI interrupts */ -#define PCI_NUM_MSI 16 - -/* MSI registers */ -#define MSI_BASE_LO_OFFSET 0x04 -#define MSI_BASE_HI_OFFSET 0x08 -#define MSI_SIZE_OFFSET 0x0c -#define MSI_ENABLE_OFFSET 0x14 -#define MSI_STATUS_OFFSET 0x18 -#define MSI_DATA_OFFSET 0x20 -#define MSI_ADDR_L_OFFSET 0x24 -#define MSI_ADDR_H_OFFSET 0x28 - -/* outbound and inbound window definitions */ -#define WIN_NUM_0 0 -#define WIN_NUM_1 1 -#define CFG_WINDOW_TYPE 0 -#define IO_WINDOW_TYPE 1 -#define MEM_WINDOW_TYPE 2 -#define IB_WIN_SIZE ((u64)256 * 1024 * 1024 * 1024) -#define MAX_PIO_WINDOWS 8 - -/* Parameters for the waiting for link up routine */ -#define LINK_WAIT_MAX_RETRIES 10 -#define LINK_WAIT_MIN 90000 -#define LINK_WAIT_MAX 100000 - -#define PAGED_ADDR_BNDRY 0xc00 -#define OFFSET_TO_PAGE_ADDR(off) \ - ((off & PAGE_LO_MASK) | PAGED_ADDR_BNDRY) -#define OFFSET_TO_PAGE_IDX(off) \ - ((off >> PAGE_SEL_OFFSET_SHIFT) & PAGE_SEL_MASK) - -struct mobiveil_msi { /* MSI information */ - struct mutex lock; /* protect bitmap variable */ - struct irq_domain *msi_domain; - struct irq_domain *dev_domain; - phys_addr_t msi_pages_phys; - int num_of_vectors; - DECLARE_BITMAP(msi_irq_in_use, PCI_NUM_MSI); -}; - -struct mobiveil_pcie { - struct platform_device *pdev; - struct list_head resources; - void __iomem *config_axi_slave_base; /* endpoint config base */ - void __iomem *csr_axi_slave_base; /* root port config base */ - void __iomem *apb_csr_base; /* MSI register base */ - phys_addr_t pcie_reg_base; /* Physical PCIe Controller Base */ - struct irq_domain *intx_domain; - raw_spinlock_t intx_mask_lock; - int irq; - int apio_wins; - int ppio_wins; - int ob_wins_configured; /* configured outbound windows */ - int ib_wins_configured; /* configured inbound windows */ - struct resource *ob_io_res; - char root_bus_nr; - struct mobiveil_msi msi; -}; - -/* - * mobiveil_pcie_sel_page - routine to access paged register - * - * Registers whose address greater than PAGED_ADDR_BNDRY (0xc00) are paged, - * for this scheme to work extracted higher 6 bits of the offset will be - * written to pg_sel field of PAB_CTRL register and rest of the lower 10 - * bits enabled with PAGED_ADDR_BNDRY are used as offset of the register. - */ -static void mobiveil_pcie_sel_page(struct mobiveil_pcie *pcie, u8 pg_idx) -{ - u32 val; - - val = readl(pcie->csr_axi_slave_base + PAB_CTRL); - val &= ~(PAGE_SEL_MASK << PAGE_SEL_SHIFT); - val |= (pg_idx & PAGE_SEL_MASK) << PAGE_SEL_SHIFT; - - writel(val, pcie->csr_axi_slave_base + PAB_CTRL); -} - -static void *mobiveil_pcie_comp_addr(struct mobiveil_pcie *pcie, u32 off) -{ - if (off < PAGED_ADDR_BNDRY) { - /* For directly accessed registers, clear the pg_sel field */ - mobiveil_pcie_sel_page(pcie, 0); - return pcie->csr_axi_slave_base + off; - } - - mobiveil_pcie_sel_page(pcie, OFFSET_TO_PAGE_IDX(off)); - return pcie->csr_axi_slave_base + OFFSET_TO_PAGE_ADDR(off); -} - -static int mobiveil_pcie_read(void __iomem *addr, int size, u32 *val) -{ - if ((uintptr_t)addr & (size - 1)) { - *val = 0; - return PCIBIOS_BAD_REGISTER_NUMBER; - } - - switch (size) { - case 4: - *val = readl(addr); - break; - case 2: - *val = readw(addr); - break; - case 1: - *val = readb(addr); - break; - default: - *val = 0; - return PCIBIOS_BAD_REGISTER_NUMBER; - } - - return PCIBIOS_SUCCESSFUL; -} - -static int mobiveil_pcie_write(void __iomem *addr, int size, u32 val) -{ - if ((uintptr_t)addr & (size - 1)) - return PCIBIOS_BAD_REGISTER_NUMBER; - - switch (size) { - case 4: - writel(val, addr); - break; - case 2: - writew(val, addr); - break; - case 1: - writeb(val, addr); - break; - default: - return PCIBIOS_BAD_REGISTER_NUMBER; - } - - return PCIBIOS_SUCCESSFUL; -} - -static u32 csr_read(struct mobiveil_pcie *pcie, u32 off, size_t size) -{ - void *addr; - u32 val; - int ret; - - addr = mobiveil_pcie_comp_addr(pcie, off); - - ret = mobiveil_pcie_read(addr, size, &val); - if (ret) - dev_err(&pcie->pdev->dev, "read CSR address failed\n"); - - return val; -} - -static void csr_write(struct mobiveil_pcie *pcie, u32 val, u32 off, size_t size) -{ - void *addr; - int ret; - - addr = mobiveil_pcie_comp_addr(pcie, off); - - ret = mobiveil_pcie_write(addr, size, val); - if (ret) - dev_err(&pcie->pdev->dev, "write CSR address failed\n"); -} - -static u32 csr_readl(struct mobiveil_pcie *pcie, u32 off) -{ - return csr_read(pcie, off, 0x4); -} - -static void csr_writel(struct mobiveil_pcie *pcie, u32 val, u32 off) -{ - csr_write(pcie, val, off, 0x4); -} - -static bool mobiveil_pcie_link_up(struct mobiveil_pcie *pcie) -{ - return (csr_readl(pcie, LTSSM_STATUS) & - LTSSM_STATUS_L0_MASK) == LTSSM_STATUS_L0; -} +#include "pcie-mobiveil.h" static bool mobiveil_pcie_valid_device(struct pci_bus *bus, unsigned int devfn) { struct mobiveil_pcie *pcie = bus->sysdata; /* Only one device down on each root port */ - if ((bus->number == pcie->root_bus_nr) && (devfn > 0)) + if ((bus->number == pcie->rp.root_bus_nr) && (devfn > 0)) return false; /* * Do not read more than one device on the bus directly * attached to RC */ - if ((bus->primary == pcie->root_bus_nr) && (devfn > 0)) + if ((bus->primary == pcie->rp.root_bus_nr) && (devfn > 0)) return false; return true; @@ -311,7 +57,7 @@ static void __iomem *mobiveil_pcie_map_bus(struct pci_bus *bus, return NULL; /* RC config access */ - if (bus->number == pcie->root_bus_nr) + if (bus->number == pcie->rp.root_bus_nr) return pcie->csr_axi_slave_base + where; /* @@ -326,7 +72,7 @@ static void __iomem *mobiveil_pcie_map_bus(struct pci_bus *bus, csr_writel(pcie, value, PAB_AXI_AMAP_PEX_WIN_L(WIN_NUM_0)); - return pcie->config_axi_slave_base + where; + return pcie->rp.config_axi_slave_base + where; } static struct pci_ops mobiveil_pcie_ops = { @@ -340,7 +86,7 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) struct irq_chip *chip = irq_desc_get_chip(desc); struct mobiveil_pcie *pcie = irq_desc_get_handler_data(desc); struct device *dev = &pcie->pdev->dev; - struct mobiveil_msi *msi = &pcie->msi; + struct mobiveil_msi *msi = &pcie->rp.msi; u32 msi_data, msi_addr_lo, msi_addr_hi; u32 intr_status, msi_status; unsigned long shifted_status; @@ -365,7 +111,7 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) shifted_status >>= PAB_INTX_START; do { for_each_set_bit(bit, &shifted_status, PCI_NUM_INTX) { - virq = irq_find_mapping(pcie->intx_domain, + virq = irq_find_mapping(pcie->rp.intx_domain, bit + 1); if (virq) generic_handle_irq(virq); @@ -428,10 +174,10 @@ static int mobiveil_pcie_parse_dt(struct mobiveil_pcie *pcie) /* map config resource */ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "config_axi_slave"); - pcie->config_axi_slave_base = devm_pci_remap_cfg_resource(dev, res); - if (IS_ERR(pcie->config_axi_slave_base)) - return PTR_ERR(pcie->config_axi_slave_base); - pcie->ob_io_res = res; + pcie->rp.config_axi_slave_base = devm_pci_remap_cfg_resource(dev, res); + if (IS_ERR(pcie->rp.config_axi_slave_base)) + return PTR_ERR(pcie->rp.config_axi_slave_base); + pcie->rp.ob_io_res = res; /* map csr resource */ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, @@ -441,12 +187,6 @@ static int mobiveil_pcie_parse_dt(struct mobiveil_pcie *pcie) return PTR_ERR(pcie->csr_axi_slave_base); pcie->pcie_reg_base = res->start; - /* map MSI config resource */ - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "apb_csr"); - pcie->apb_csr_base = devm_pci_remap_cfg_resource(dev, res); - if (IS_ERR(pcie->apb_csr_base)) - return PTR_ERR(pcie->apb_csr_base); - /* read the number of windows requested */ if (of_property_read_u32(node, "apio-wins", &pcie->apio_wins)) pcie->apio_wins = MAX_PIO_WINDOWS; @@ -454,119 +194,15 @@ static int mobiveil_pcie_parse_dt(struct mobiveil_pcie *pcie) if (of_property_read_u32(node, "ppio-wins", &pcie->ppio_wins)) pcie->ppio_wins = MAX_PIO_WINDOWS; - pcie->irq = platform_get_irq(pdev, 0); - if (pcie->irq <= 0) { - dev_err(dev, "failed to map IRQ: %d\n", pcie->irq); - return -ENODEV; - } - return 0; } -static void program_ib_windows(struct mobiveil_pcie *pcie, int win_num, - u64 cpu_addr, u64 pci_addr, u32 type, u64 size) -{ - u32 value; - u64 size64 = ~(size - 1); - - if (win_num >= pcie->ppio_wins) { - dev_err(&pcie->pdev->dev, - "ERROR: max inbound windows reached !\n"); - return; - } - - value = csr_readl(pcie, PAB_PEX_AMAP_CTRL(win_num)); - value &= ~(AMAP_CTRL_TYPE_MASK << AMAP_CTRL_TYPE_SHIFT | - WIN_SIZE_MASK << WIN_SIZE_SHIFT); - value |= (type << AMAP_CTRL_TYPE_SHIFT) | (1 << AMAP_CTRL_EN_SHIFT) | - (lower_32_bits(size64) & WIN_SIZE_MASK << WIN_SIZE_SHIFT); - csr_writel(pcie, value, PAB_PEX_AMAP_CTRL(win_num)); - - csr_writel(pcie, upper_32_bits(size64), - PAB_EXT_PEX_AMAP_SIZEN(win_num)); - - csr_writel(pcie, lower_32_bits(cpu_addr), - PAB_PEX_AMAP_AXI_WIN(win_num)); - csr_writel(pcie, upper_32_bits(cpu_addr), - PAB_EXT_PEX_AMAP_AXI_WIN(win_num)); - - csr_writel(pcie, lower_32_bits(pci_addr), - PAB_PEX_AMAP_PEX_WIN_L(win_num)); - csr_writel(pcie, upper_32_bits(pci_addr), - PAB_PEX_AMAP_PEX_WIN_H(win_num)); - - pcie->ib_wins_configured++; -} - -/* - * routine to program the outbound windows - */ -static void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, - u64 cpu_addr, u64 pci_addr, u32 type, u64 size) -{ - - u32 value; - u64 size64 = ~(size - 1); - - if (win_num >= pcie->apio_wins) { - dev_err(&pcie->pdev->dev, - "ERROR: max outbound windows reached !\n"); - return; - } - - /* - * program Enable Bit to 1, Type Bit to (00) base 2, AXI Window Size Bit - * to 4 KB in PAB_AXI_AMAP_CTRL register - */ - value = csr_readl(pcie, PAB_AXI_AMAP_CTRL(win_num)); - value &= ~(WIN_TYPE_MASK << WIN_TYPE_SHIFT | - WIN_SIZE_MASK << WIN_SIZE_SHIFT); - value |= 1 << WIN_ENABLE_SHIFT | type << WIN_TYPE_SHIFT | - (lower_32_bits(size64) & WIN_SIZE_MASK << WIN_SIZE_SHIFT); - csr_writel(pcie, value, PAB_AXI_AMAP_CTRL(win_num)); - - csr_writel(pcie, upper_32_bits(size64), PAB_EXT_AXI_AMAP_SIZE(win_num)); - - /* - * program AXI window base with appropriate value in - * PAB_AXI_AMAP_AXI_WIN0 register - */ - csr_writel(pcie, lower_32_bits(cpu_addr) & (~AXI_WINDOW_ALIGN_MASK), - PAB_AXI_AMAP_AXI_WIN(win_num)); - csr_writel(pcie, upper_32_bits(cpu_addr), - PAB_EXT_AXI_AMAP_AXI_WIN(win_num)); - - csr_writel(pcie, lower_32_bits(pci_addr), - PAB_AXI_AMAP_PEX_WIN_L(win_num)); - csr_writel(pcie, upper_32_bits(pci_addr), - PAB_AXI_AMAP_PEX_WIN_H(win_num)); - - pcie->ob_wins_configured++; -} - -static int mobiveil_bringup_link(struct mobiveil_pcie *pcie) -{ - int retries; - - /* check if the link is up or not */ - for (retries = 0; retries < LINK_WAIT_MAX_RETRIES; retries++) { - if (mobiveil_pcie_link_up(pcie)) - return 0; - - usleep_range(LINK_WAIT_MIN, LINK_WAIT_MAX); - } - - dev_err(&pcie->pdev->dev, "link never came up\n"); - - return -ETIMEDOUT; -} - static void mobiveil_pcie_enable_msi(struct mobiveil_pcie *pcie) { phys_addr_t msg_addr = pcie->pcie_reg_base; - struct mobiveil_msi *msi = &pcie->msi; + struct mobiveil_msi *msi = &pcie->rp.msi; - pcie->msi.num_of_vectors = PCI_NUM_MSI; + msi->num_of_vectors = PCI_NUM_MSI; msi->msi_pages_phys = (phys_addr_t)msg_addr; writel_relaxed(lower_32_bits(msg_addr), @@ -604,9 +240,6 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) pab_ctrl |= (1 << AMBA_PIO_ENABLE_SHIFT) | (1 << PEX_PIO_ENABLE_SHIFT); csr_writel(pcie, pab_ctrl, PAB_CTRL); - csr_writel(pcie, (PAB_INTP_INTX_MASK | PAB_INTP_MSI_MASK), - PAB_INTP_AMBA_MISC_ENB); - /* * program PIO Enable Bit to 1 and Config Window Enable Bit to 1 in * PAB_AXI_PIO_CTRL Register @@ -628,20 +261,24 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) */ /* config outbound translation window */ - program_ob_windows(pcie, WIN_NUM_0, pcie->ob_io_res->start, 0, - CFG_WINDOW_TYPE, resource_size(pcie->ob_io_res)); + program_ob_windows(pcie, WIN_NUM_0, pcie->rp.ob_io_res->start, 0, + CFG_WINDOW_TYPE, resource_size(pcie->rp.ob_io_res)); /* memory inbound translation window */ program_ib_windows(pcie, WIN_NUM_0, 0, 0, MEM_WINDOW_TYPE, IB_WIN_SIZE); /* Get the I/O and memory ranges from DT */ resource_list_for_each_entry(win, &pcie->resources) { - if (resource_type(win->res) == IORESOURCE_MEM) + if (resource_type(win->res) == IORESOURCE_MEM) { type = MEM_WINDOW_TYPE; - else if (resource_type(win->res) == IORESOURCE_IO) + } else if (resource_type(win->res) == IORESOURCE_IO) { type = IO_WINDOW_TYPE; - else + } else if (resource_type(win->res) == IORESOURCE_BUS) { + pcie->rp.root_bus_nr = win->res->start; + continue; + } else { continue; + } /* configure outbound translation window */ program_ob_windows(pcie, pcie->ob_wins_configured, @@ -656,9 +293,6 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) value |= (PCI_CLASS_BRIDGE_PCI << 16); csr_writel(pcie, value, PAB_INTP_AXI_PIO_CLASS); - /* setup MSI hardware registers */ - mobiveil_pcie_enable_msi(pcie); - return 0; } @@ -671,11 +305,11 @@ static void mobiveil_mask_intx_irq(struct irq_data *data) pcie = irq_desc_get_chip_data(desc); mask = 1 << ((data->hwirq + PAB_INTX_START) - 1); - raw_spin_lock_irqsave(&pcie->intx_mask_lock, flags); + raw_spin_lock_irqsave(&pcie->rp.intx_mask_lock, flags); shifted_val = csr_readl(pcie, PAB_INTP_AMBA_MISC_ENB); shifted_val &= ~mask; csr_writel(pcie, shifted_val, PAB_INTP_AMBA_MISC_ENB); - raw_spin_unlock_irqrestore(&pcie->intx_mask_lock, flags); + raw_spin_unlock_irqrestore(&pcie->rp.intx_mask_lock, flags); } static void mobiveil_unmask_intx_irq(struct irq_data *data) @@ -687,11 +321,11 @@ static void mobiveil_unmask_intx_irq(struct irq_data *data) pcie = irq_desc_get_chip_data(desc); mask = 1 << ((data->hwirq + PAB_INTX_START) - 1); - raw_spin_lock_irqsave(&pcie->intx_mask_lock, flags); + raw_spin_lock_irqsave(&pcie->rp.intx_mask_lock, flags); shifted_val = csr_readl(pcie, PAB_INTP_AMBA_MISC_ENB); shifted_val |= mask; csr_writel(pcie, shifted_val, PAB_INTP_AMBA_MISC_ENB); - raw_spin_unlock_irqrestore(&pcie->intx_mask_lock, flags); + raw_spin_unlock_irqrestore(&pcie->rp.intx_mask_lock, flags); } static struct irq_chip intx_irq_chip = { @@ -759,7 +393,7 @@ static int mobiveil_irq_msi_domain_alloc(struct irq_domain *domain, unsigned int nr_irqs, void *args) { struct mobiveil_pcie *pcie = domain->host_data; - struct mobiveil_msi *msi = &pcie->msi; + struct mobiveil_msi *msi = &pcie->rp.msi; unsigned long bit; WARN_ON(nr_irqs != 1); @@ -786,7 +420,7 @@ static void mobiveil_irq_msi_domain_free(struct irq_domain *domain, { struct irq_data *d = irq_domain_get_irq_data(domain, virq); struct mobiveil_pcie *pcie = irq_data_get_irq_chip_data(d); - struct mobiveil_msi *msi = &pcie->msi; + struct mobiveil_msi *msi = &pcie->rp.msi; mutex_lock(&msi->lock); @@ -807,9 +441,9 @@ static int mobiveil_allocate_msi_domains(struct mobiveil_pcie *pcie) { struct device *dev = &pcie->pdev->dev; struct fwnode_handle *fwnode = of_node_to_fwnode(dev->of_node); - struct mobiveil_msi *msi = &pcie->msi; + struct mobiveil_msi *msi = &pcie->rp.msi; - mutex_init(&pcie->msi.lock); + mutex_init(&msi->lock); msi->dev_domain = irq_domain_add_linear(NULL, msi->num_of_vectors, &msi_domain_ops, pcie); if (!msi->dev_domain) { @@ -836,15 +470,15 @@ static int mobiveil_pcie_init_irq_domain(struct mobiveil_pcie *pcie) int ret; /* setup INTx */ - pcie->intx_domain = irq_domain_add_linear(node, PCI_NUM_INTX, - &intx_domain_ops, pcie); + pcie->rp.intx_domain = irq_domain_add_linear(node, PCI_NUM_INTX, + &intx_domain_ops, pcie); - if (!pcie->intx_domain) { + if (!pcie->rp.intx_domain) { dev_err(dev, "Failed to get a INTx IRQ domain\n"); return -ENOMEM; } - raw_spin_lock_init(&pcie->intx_mask_lock); + raw_spin_lock_init(&pcie->rp.intx_mask_lock); /* setup MSI */ ret = mobiveil_allocate_msi_domains(pcie); @@ -854,24 +488,58 @@ static int mobiveil_pcie_init_irq_domain(struct mobiveil_pcie *pcie) return 0; } -static int mobiveil_pcie_probe(struct platform_device *pdev) +static int mobiveil_pcie_interrupt_init(struct mobiveil_pcie *pcie) +{ + struct device *dev = &pcie->pdev->dev; + struct resource *res; + int ret; + + if (pcie->rp.ops->interrupt_init) + return pcie->rp.ops->interrupt_init(pcie); + + /* map MSI config resource */ + res = platform_get_resource_byname(pcie->pdev, IORESOURCE_MEM, + "apb_csr"); + pcie->apb_csr_base = devm_pci_remap_cfg_resource(dev, res); + if (IS_ERR(pcie->apb_csr_base)) + return PTR_ERR(pcie->apb_csr_base); + + /* setup MSI hardware registers */ + mobiveil_pcie_enable_msi(pcie); + + pcie->rp.irq = platform_get_irq(pcie->pdev, 0); + if (pcie->rp.irq <= 0) { + dev_err(dev, "failed to map IRQ: %d\n", pcie->rp.irq); + return -ENODEV; + } + + /* initialize the IRQ domains */ + ret = mobiveil_pcie_init_irq_domain(pcie); + if (ret) { + dev_err(dev, "Failed creating IRQ Domain\n"); + return ret; + } + + irq_set_chained_handler_and_data(pcie->rp.irq, + mobiveil_pcie_isr, pcie); + + /* Enable interrupts */ + csr_writel(pcie, (PAB_INTP_INTX_MASK | PAB_INTP_MSI_MASK), + PAB_INTP_AMBA_MISC_ENB); + + return 0; +} + +int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie) { - struct mobiveil_pcie *pcie; struct pci_bus *bus; struct pci_bus *child; struct pci_host_bridge *bridge; - struct device *dev = &pdev->dev; + struct device *dev = &pcie->pdev->dev; resource_size_t iobase; int ret; - /* allocate the PCIe port */ - bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie)); - if (!bridge) - return -ENOMEM; - - pcie = pci_host_bridge_priv(bridge); - - pcie->pdev = pdev; + INIT_LIST_HEAD(&pcie->resources); ret = mobiveil_pcie_parse_dt(pcie); if (ret) { @@ -879,7 +547,10 @@ static int mobiveil_pcie_probe(struct platform_device *pdev) return ret; } - INIT_LIST_HEAD(&pcie->resources); + /* allocate the PCIe port */ + bridge = devm_pci_alloc_host_bridge(dev, 0); + if (!bridge) + return -ENOMEM; /* parse the host bridge base addresses from the device tree file */ ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, @@ -899,15 +570,12 @@ static int mobiveil_pcie_probe(struct platform_device *pdev) goto error; } - /* initialize the IRQ domains */ - ret = mobiveil_pcie_init_irq_domain(pcie); + ret = mobiveil_pcie_interrupt_init(pcie); if (ret) { - dev_err(dev, "Failed creating IRQ Domain\n"); + dev_err(dev, "Interrupt init failed\n"); goto error; } - irq_set_chained_handler_and_data(pcie->irq, mobiveil_pcie_isr, pcie); - ret = devm_request_pci_bus_resources(dev, &pcie->resources); if (ret) goto error; @@ -916,7 +584,7 @@ static int mobiveil_pcie_probe(struct platform_device *pdev) list_splice_init(&pcie->resources, &bridge->windows); bridge->dev.parent = dev; bridge->sysdata = pcie; - bridge->busnr = pcie->root_bus_nr; + bridge->busnr = pcie->rp.root_bus_nr; bridge->ops = &mobiveil_pcie_ops; bridge->map_irq = of_irq_parse_and_map_pci; bridge->swizzle_irq = pci_common_swizzle; @@ -944,25 +612,3 @@ static int mobiveil_pcie_probe(struct platform_device *pdev) pci_free_resource_list(&pcie->resources); return ret; } - -static const struct of_device_id mobiveil_pcie_of_match[] = { - {.compatible = "mbvl,gpex40-pcie",}, - {}, -}; - -MODULE_DEVICE_TABLE(of, mobiveil_pcie_of_match); - -static struct platform_driver mobiveil_pcie_driver = { - .probe = mobiveil_pcie_probe, - .driver = { - .name = "mobiveil-pcie", - .of_match_table = mobiveil_pcie_of_match, - .suppress_bind_attrs = true, - }, -}; - -builtin_platform_driver(mobiveil_pcie_driver); - -MODULE_LICENSE("GPL v2"); -MODULE_DESCRIPTION("Mobiveil PCIe host controller driver"); -MODULE_AUTHOR("Subrahmanya Lingappa "); diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-plat.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-plat.c new file mode 100644 index 000000000000..216c62f35568 --- /dev/null +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-plat.c @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * PCIe host controller driver for Mobiveil PCIe Host controller + * + * Copyright (c) 2018 Mobiveil Inc. + * Author: Subrahmanya Lingappa + * Refactor: Zhiqiang Hou + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "pcie-mobiveil.h" + +static int mobiveil_pcie_probe(struct platform_device *pdev) +{ + struct mobiveil_pcie *pcie; + struct device *dev = &pdev->dev; + + pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL); + if (!pcie) + return -ENOMEM; + + pcie->pdev = pdev; + + return mobiveil_pcie_host_probe(pcie); +} + +static const struct of_device_id mobiveil_pcie_of_match[] = { + {.compatible = "mbvl,gpex40-pcie",}, + {}, +}; + +MODULE_DEVICE_TABLE(of, mobiveil_pcie_of_match); + +static struct platform_driver mobiveil_pcie_driver = { + .probe = mobiveil_pcie_probe, + .driver = { + .name = "mobiveil-pcie", + .of_match_table = mobiveil_pcie_of_match, + .suppress_bind_attrs = true, + }, +}; + +builtin_platform_driver(mobiveil_pcie_driver); + +MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("Mobiveil PCIe host controller driver"); +MODULE_AUTHOR("Subrahmanya Lingappa "); diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.c b/drivers/pci/controller/mobiveil/pcie-mobiveil.c new file mode 100644 index 000000000000..ee678a60825d --- /dev/null +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.c @@ -0,0 +1,228 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * PCIe host controller driver for Mobiveil PCIe Host controller + * + * Copyright (c) 2018 Mobiveil Inc. + * Author: Subrahmanya Lingappa + * Refactor: Zhiqiang Hou + */ + +#include +#include +#include +#include +#include + +#include "pcie-mobiveil.h" + +/* + * mobiveil_pcie_sel_page - routine to access paged register + * + * Registers whose address greater than PAGED_ADDR_BNDRY (0xc00) are paged, + * for this scheme to work extracted higher 6 bits of the offset will be + * written to pg_sel field of PAB_CTRL register and rest of the lower 10 + * bits enabled with PAGED_ADDR_BNDRY are used as offset of the register. + */ +static void mobiveil_pcie_sel_page(struct mobiveil_pcie *pcie, u8 pg_idx) +{ + u32 val; + + val = readl(pcie->csr_axi_slave_base + PAB_CTRL); + val &= ~(PAGE_SEL_MASK << PAGE_SEL_SHIFT); + val |= (pg_idx & PAGE_SEL_MASK) << PAGE_SEL_SHIFT; + + writel(val, pcie->csr_axi_slave_base + PAB_CTRL); +} + +static void *mobiveil_pcie_comp_addr(struct mobiveil_pcie *pcie, u32 off) +{ + if (off < PAGED_ADDR_BNDRY) { + /* For directly accessed registers, clear the pg_sel field */ + mobiveil_pcie_sel_page(pcie, 0); + return pcie->csr_axi_slave_base + off; + } + + mobiveil_pcie_sel_page(pcie, OFFSET_TO_PAGE_IDX(off)); + return pcie->csr_axi_slave_base + OFFSET_TO_PAGE_ADDR(off); +} + +static int mobiveil_pcie_read(void __iomem *addr, int size, u32 *val) +{ + if ((uintptr_t)addr & (size - 1)) { + *val = 0; + return PCIBIOS_BAD_REGISTER_NUMBER; + } + + switch (size) { + case 4: + *val = readl(addr); + break; + case 2: + *val = readw(addr); + break; + case 1: + *val = readb(addr); + break; + default: + *val = 0; + return PCIBIOS_BAD_REGISTER_NUMBER; + } + + return PCIBIOS_SUCCESSFUL; +} + +static int mobiveil_pcie_write(void __iomem *addr, int size, u32 val) +{ + if ((uintptr_t)addr & (size - 1)) + return PCIBIOS_BAD_REGISTER_NUMBER; + + switch (size) { + case 4: + writel(val, addr); + break; + case 2: + writew(val, addr); + break; + case 1: + writeb(val, addr); + break; + default: + return PCIBIOS_BAD_REGISTER_NUMBER; + } + + return PCIBIOS_SUCCESSFUL; +} + +u32 csr_read(struct mobiveil_pcie *pcie, u32 off, size_t size) +{ + void *addr; + u32 val; + int ret; + + addr = mobiveil_pcie_comp_addr(pcie, off); + + ret = mobiveil_pcie_read(addr, size, &val); + if (ret) + dev_err(&pcie->pdev->dev, "read CSR address failed\n"); + + return val; +} + +void csr_write(struct mobiveil_pcie *pcie, u32 val, u32 off, size_t size) +{ + void *addr; + int ret; + + addr = mobiveil_pcie_comp_addr(pcie, off); + + ret = mobiveil_pcie_write(addr, size, val); + if (ret) + dev_err(&pcie->pdev->dev, "write CSR address failed\n"); +} + +bool mobiveil_pcie_link_up(struct mobiveil_pcie *pcie) +{ + if (pcie->ops->link_up) + return pcie->ops->link_up(pcie); + + return (csr_readl(pcie, LTSSM_STATUS) & + LTSSM_STATUS_L0_MASK) == LTSSM_STATUS_L0; +} + +void program_ib_windows(struct mobiveil_pcie *pcie, int win_num, u64 cpu_addr, + u64 pci_addr, u32 type, u64 size) +{ + u32 value; + u64 size64 = ~(size - 1); + + if (win_num >= pcie->ppio_wins) { + dev_err(&pcie->pdev->dev, + "ERROR: max inbound windows reached !\n"); + return; + } + + value = csr_readl(pcie, PAB_PEX_AMAP_CTRL(win_num)); + value &= ~(AMAP_CTRL_TYPE_MASK << AMAP_CTRL_TYPE_SHIFT | + WIN_SIZE_MASK << WIN_SIZE_SHIFT); + value |= (type << AMAP_CTRL_TYPE_SHIFT) | (1 << AMAP_CTRL_EN_SHIFT) | + (lower_32_bits(size64) & WIN_SIZE_MASK << WIN_SIZE_SHIFT); + csr_writel(pcie, value, PAB_PEX_AMAP_CTRL(win_num)); + + csr_writel(pcie, upper_32_bits(size64), + PAB_EXT_PEX_AMAP_SIZEN(win_num)); + + csr_writel(pcie, lower_32_bits(cpu_addr), + PAB_PEX_AMAP_AXI_WIN(win_num)); + csr_writel(pcie, upper_32_bits(cpu_addr), + PAB_EXT_PEX_AMAP_AXI_WIN(win_num)); + + csr_writel(pcie, lower_32_bits(pci_addr), + PAB_PEX_AMAP_PEX_WIN_L(win_num)); + csr_writel(pcie, upper_32_bits(pci_addr), + PAB_PEX_AMAP_PEX_WIN_H(win_num)); + + pcie->ib_wins_configured++; +} + +/* + * routine to program the outbound windows + */ +void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, u64 cpu_addr, + u64 pci_addr, u32 type, u64 size) +{ + + u32 value; + u64 size64 = ~(size - 1); + + if (win_num >= pcie->apio_wins) { + dev_err(&pcie->pdev->dev, + "ERROR: max outbound windows reached !\n"); + return; + } + + /* + * program Enable Bit to 1, Type Bit to (00) base 2, AXI Window Size Bit + * to 4 KB in PAB_AXI_AMAP_CTRL register + */ + value = csr_readl(pcie, PAB_AXI_AMAP_CTRL(win_num)); + value &= ~(WIN_TYPE_MASK << WIN_TYPE_SHIFT | + WIN_SIZE_MASK << WIN_SIZE_SHIFT); + value |= 1 << WIN_ENABLE_SHIFT | type << WIN_TYPE_SHIFT | + (lower_32_bits(size64) & WIN_SIZE_MASK << WIN_SIZE_SHIFT); + csr_writel(pcie, value, PAB_AXI_AMAP_CTRL(win_num)); + + csr_writel(pcie, upper_32_bits(size64), PAB_EXT_AXI_AMAP_SIZE(win_num)); + + /* + * program AXI window base with appropriate value in + * PAB_AXI_AMAP_AXI_WIN0 register + */ + csr_writel(pcie, lower_32_bits(cpu_addr) & (~AXI_WINDOW_ALIGN_MASK), + PAB_AXI_AMAP_AXI_WIN(win_num)); + csr_writel(pcie, upper_32_bits(cpu_addr), + PAB_EXT_AXI_AMAP_AXI_WIN(win_num)); + + csr_writel(pcie, lower_32_bits(pci_addr), + PAB_AXI_AMAP_PEX_WIN_L(win_num)); + csr_writel(pcie, upper_32_bits(pci_addr), + PAB_AXI_AMAP_PEX_WIN_H(win_num)); + + pcie->ob_wins_configured++; +} + +int mobiveil_bringup_link(struct mobiveil_pcie *pcie) +{ + int retries; + + /* check if the link is up or not */ + for (retries = 0; retries < LINK_WAIT_MAX_RETRIES; retries++) { + if (mobiveil_pcie_link_up(pcie)) + return 0; + + usleep_range(LINK_WAIT_MIN, LINK_WAIT_MAX); + } + + dev_err(&pcie->pdev->dev, "link never came up\n"); + + return -ETIMEDOUT; +} diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h new file mode 100644 index 000000000000..eb4cb61291a8 --- /dev/null +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h @@ -0,0 +1,187 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * PCIe host controller driver for Mobiveil PCIe Host controller + * + * Copyright (c) 2018 Mobiveil Inc. + * Author: Subrahmanya Lingappa + * Refactor: Zhiqiang Hou + */ + +#ifndef _PCIE_MOBIVEIL_H +#define _PCIE_MOBIVEIL_H + +#include +#include +#include +#include "../../pci.h" + +/* register offsets and bit positions */ + +/* + * translation tables are grouped into windows, each window registers are + * grouped into blocks of 4 or 16 registers each + */ +#define PAB_REG_BLOCK_SIZE 16 +#define PAB_EXT_REG_BLOCK_SIZE 4 + +#define PAB_REG_ADDR(offset, win) \ + (offset + (win * PAB_REG_BLOCK_SIZE)) +#define PAB_EXT_REG_ADDR(offset, win) \ + (offset + (win * PAB_EXT_REG_BLOCK_SIZE)) + +#define LTSSM_STATUS 0x0404 +#define LTSSM_STATUS_L0_MASK 0x3f +#define LTSSM_STATUS_L0 0x2d + +#define PAB_CTRL 0x0808 +#define AMBA_PIO_ENABLE_SHIFT 0 +#define PEX_PIO_ENABLE_SHIFT 1 +#define PAGE_SEL_SHIFT 13 +#define PAGE_SEL_MASK 0x3f +#define PAGE_LO_MASK 0x3ff +#define PAGE_SEL_OFFSET_SHIFT 10 + +#define PAB_AXI_PIO_CTRL 0x0840 +#define APIO_EN_MASK 0xf + +#define PAB_PEX_PIO_CTRL 0x08c0 +#define PIO_ENABLE_SHIFT 0 + +#define PAB_INTP_AMBA_MISC_ENB 0x0b0c +#define PAB_INTP_AMBA_MISC_STAT 0x0b1c +#define PAB_INTP_INTX_MASK 0x01e0 +#define PAB_INTP_MSI_MASK 0x8 + +#define PAB_AXI_AMAP_CTRL(win) PAB_REG_ADDR(0x0ba0, win) +#define WIN_ENABLE_SHIFT 0 +#define WIN_TYPE_SHIFT 1 +#define WIN_TYPE_MASK 0x3 +#define WIN_SIZE_SHIFT 10 +#define WIN_SIZE_MASK 0x3fffff + +#define PAB_EXT_AXI_AMAP_SIZE(win) PAB_EXT_REG_ADDR(0xbaf0, win) + +#define PAB_EXT_AXI_AMAP_AXI_WIN(win) PAB_EXT_REG_ADDR(0x80a0, win) +#define PAB_AXI_AMAP_AXI_WIN(win) PAB_REG_ADDR(0x0ba4, win) +#define AXI_WINDOW_ALIGN_MASK 3 + +#define PAB_AXI_AMAP_PEX_WIN_L(win) PAB_REG_ADDR(0x0ba8, win) +#define PAB_BUS_SHIFT 24 +#define PAB_DEVICE_SHIFT 19 +#define PAB_FUNCTION_SHIFT 16 + +#define PAB_AXI_AMAP_PEX_WIN_H(win) PAB_REG_ADDR(0x0bac, win) +#define PAB_INTP_AXI_PIO_CLASS 0x474 + +#define PAB_PEX_AMAP_CTRL(win) PAB_REG_ADDR(0x4ba0, win) +#define AMAP_CTRL_EN_SHIFT 0 +#define AMAP_CTRL_TYPE_SHIFT 1 +#define AMAP_CTRL_TYPE_MASK 3 + +#define PAB_EXT_PEX_AMAP_SIZEN(win) PAB_EXT_REG_ADDR(0xbef0, win) +#define PAB_EXT_PEX_AMAP_AXI_WIN(win) PAB_EXT_REG_ADDR(0xb4a0, win) +#define PAB_PEX_AMAP_AXI_WIN(win) PAB_REG_ADDR(0x4ba4, win) +#define PAB_PEX_AMAP_PEX_WIN_L(win) PAB_REG_ADDR(0x4ba8, win) +#define PAB_PEX_AMAP_PEX_WIN_H(win) PAB_REG_ADDR(0x4bac, win) + +/* starting offset of INTX bits in status register */ +#define PAB_INTX_START 5 + +/* supported number of MSI interrupts */ +#define PCI_NUM_MSI 16 + +/* MSI registers */ +#define MSI_BASE_LO_OFFSET 0x04 +#define MSI_BASE_HI_OFFSET 0x08 +#define MSI_SIZE_OFFSET 0x0c +#define MSI_ENABLE_OFFSET 0x14 +#define MSI_STATUS_OFFSET 0x18 +#define MSI_DATA_OFFSET 0x20 +#define MSI_ADDR_L_OFFSET 0x24 +#define MSI_ADDR_H_OFFSET 0x28 + +/* outbound and inbound window definitions */ +#define WIN_NUM_0 0 +#define WIN_NUM_1 1 +#define CFG_WINDOW_TYPE 0 +#define IO_WINDOW_TYPE 1 +#define MEM_WINDOW_TYPE 2 +#define IB_WIN_SIZE ((u64)256 * 1024 * 1024 * 1024) +#define MAX_PIO_WINDOWS 8 + +/* Parameters for the waiting for link up routine */ +#define LINK_WAIT_MAX_RETRIES 10 +#define LINK_WAIT_MIN 90000 +#define LINK_WAIT_MAX 100000 + +#define PAGED_ADDR_BNDRY 0xc00 +#define OFFSET_TO_PAGE_ADDR(off) \ + ((off & PAGE_LO_MASK) | PAGED_ADDR_BNDRY) +#define OFFSET_TO_PAGE_IDX(off) \ + ((off >> PAGE_SEL_OFFSET_SHIFT) & PAGE_SEL_MASK) + +struct mobiveil_pcie; + +struct mobiveil_msi { /* MSI information */ + struct mutex lock; /* protect bitmap variable */ + struct irq_domain *msi_domain; + struct irq_domain *dev_domain; + phys_addr_t msi_pages_phys; + int num_of_vectors; + DECLARE_BITMAP(msi_irq_in_use, PCI_NUM_MSI); +}; + +struct mobiveil_rp_ops { + int (*interrupt_init)(struct mobiveil_pcie *pcie); +}; + +struct root_port { + u8 root_bus_nr; + void __iomem *config_axi_slave_base; /* endpoint config base */ + struct resource *ob_io_res; + struct mobiveil_rp_ops *ops; + int irq; + raw_spinlock_t intx_mask_lock; + struct irq_domain *intx_domain; + struct mobiveil_msi msi; +}; + +struct mobiveil_pab_ops { + int (*link_up)(struct mobiveil_pcie *pcie); +}; + +struct mobiveil_pcie { + struct platform_device *pdev; + struct list_head resources; + void __iomem *csr_axi_slave_base; /* PAB registers base */ + phys_addr_t pcie_reg_base; /* Physical PCIe Controller Base */ + void __iomem *apb_csr_base; /* MSI register base */ + u32 apio_wins; + u32 ppio_wins; + u32 ob_wins_configured; /* configured outbound windows */ + u32 ib_wins_configured; /* configured inbound windows */ + const struct mobiveil_pab_ops *ops; + struct root_port rp; +}; + +int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie); +bool mobiveil_pcie_link_up(struct mobiveil_pcie *pcie); +int mobiveil_bringup_link(struct mobiveil_pcie *pcie); +void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, u64 cpu_addr, + u64 pci_addr, u32 type, u64 size); +void program_ib_windows(struct mobiveil_pcie *pcie, int win_num, u64 cpu_addr, + u64 pci_addr, u32 type, u64 size); +u32 csr_read(struct mobiveil_pcie *pcie, u32 off, size_t size); +void csr_write(struct mobiveil_pcie *pcie, u32 val, u32 off, size_t size); + +static inline u32 csr_readl(struct mobiveil_pcie *pcie, u32 off) +{ + return csr_read(pcie, off, 0x4); +} + +static inline void csr_writel(struct mobiveil_pcie *pcie, u32 val, u32 off) +{ + csr_write(pcie, val, off, 0x4); +} + +#endif /* _PCIE_MOBIVEIL_H */ From patchwork Mon Mar 11 09:32:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847087 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12ACB139A for ; Mon, 11 Mar 2019 09:33:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED8F028E73 for ; Mon, 11 Mar 2019 09:33:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E115228E7E; Mon, 11 Mar 2019 09:33:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7852428E73 for ; Mon, 11 Mar 2019 09:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=frAm/utOg7Sc7i9f+bEN7067EJKx+lX4VIHdDpSP9uI=; b=ih3tQ7ZY5+9pQk NQxEJfCxbnbrdsEbyG08Uwj+aVsqT1TM9JBnb/rbCbqGW7wmRqbF9L7QfLdFiVoS9R1dVWPIdC1Ia FS6p3Tl5QFKBP0BOY/Sz/LBw5cTRpNgBd9OUYE/7sjonvez5bat/6Xrb03dJfCDUOkGwBGuTzrDDG tMHJD1VPRHrUNaUDwMhtVWKesIsz2UdYdA682QeMC1WgeMynk5v5eIDOXb1fhf8+ueVMXOJglwYmo HoXSWDd24Ae9in2AkE3kqsQ/bZSGlA+JQG17kepsNyapxI7eyElZCIpcqAqbsBCV9O+pmRP0urVkf i+kL6upeQTiUUX7KKxlA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HJD-0003v8-I0; Mon, 11 Mar 2019 09:33:23 +0000 Received: from mail-eopbgr70049.outbound.protection.outlook.com ([40.107.7.49] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HId-0000Rr-JC for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:33:20 +0000 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=nGt2kptfSYFWIMpJrzSgidPyvIMtRAfU6GlQDpaCshM=; b=gJ8eeGrdyJAJyx/mCGBjC9dccsRytNaMtAbdkHqjKFl7RasCQjqcjJrL+3r8Dc/mUIPD8ifQDWDVBbf8zTF955M0tTLREu2xmOhl7iA1gyTjC8ksb3KSpAMSxb4K4yUA77p2kwkrS837ZMaTkdVWNZzRHD0U61GzfabD0aEZx6U= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6566.eurprd04.prod.outlook.com (20.179.246.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Mon, 11 Mar 2019 09:32:11 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:32:11 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 17/28] PCI: mobiveil: fix the checking of valid device Thread-Topic: [PATCHv4 17/28] PCI: mobiveil: fix the checking of valid device Thread-Index: AQHU1+1NSbzhbwea50ueS7B7aR1vuw== Date: Mon, 11 Mar 2019 09:32:11 +0000 Message-ID: <20190311093130.7209-18-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3f696517-ce7a-432e-787e-08d6a604700b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6566; x-ms-traffictypediagnostic: AM6PR04MB6566: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6566; 23:9U+afKuykMiupYBandF6T1h7pl0VMCRlf7rCJBN?= =?iso-8859-1?q?MS3nt1MPc8pAE49?= =?iso-8859-1?q?dHHBCQgQ0F9CLmjhJP7CcEyjarsfTTr2P+igKJ2UDtx8ymn3i0O2HX5cty0h?= =?iso-8859-1?q?B+3UTxhKnyOHtZMEDTjKz5c7n3zCQCOEzsFIps+a0nOGPd0ZdEbt1l4VSDQm?= =?iso-8859-1?q?MOu9AmEhUOhIPqmbIUPbGo+41Be+aopHuo8OXlJhLlv1OLAgkapv8ysTy7de?= =?iso-8859-1?q?BcZT7MDX/O1xLrMS3Ef27jE5V78bXQn5uISWZwu5n/idEdFVfZiDHuuq6dL/?= =?iso-8859-1?q?i5pFpqQiTN4PPh1t5tCq3bJ+PXZXLxPF9TIYDyyD+hRZEJdkjfp7kReJ4RI3?= =?iso-8859-1?q?Qlrld4lMpR/lonMAr/tqbO76CqljiNyOlzOdKGQjwGkAkn8qsccRcUEELTZE?= =?iso-8859-1?q?zUQf/46pd7X8/lzJoW8Svixt1FBfoPRWsYiGsGs2neJN89FNA04ihzBhmTVx?= =?iso-8859-1?q?zJxTzDG5oCTlKC9czcPS96Mw9qqhyncCOLlau1fvrUPmqMV+daq3kXw4DOkq?= =?iso-8859-1?q?CNKn2xRPY3FixGjT3U7oAd17eaqGbl9UPfaVycwwTbhFVWRIHKqDP8Fzy83T?= =?iso-8859-1?q?BMJuSPvE+ZjHy1ahTOzKePNCtEhnuQdmQSSpwii0JLcPz+IDFp9HWAHH5BsY?= =?iso-8859-1?q?Zo1GlzzYa5Ko+Zi2n4Cgz6HLiAcU9g3nzMeJ6P/URKupoCLt4vTHL+kKIbD0?= =?iso-8859-1?q?S08zmxAzfensLT7w4+BfAVP5lWOfo+SatfNEZdaxDWUc2JdJZoztD+D0pZN/?= =?iso-8859-1?q?IbX2s8OMfjnHP39P8zJpuHdsjvQLuMX8F5vUhd/GYTzVQ8tvXRdBeDB9bLfN?= =?iso-8859-1?q?xRor7t7PZL9fCLK2vTq/bOwE05LS/2TJXCW5+HTqRqb9E0fi2KQsSPS4ElCD?= =?iso-8859-1?q?EqTJke2yaqaATl8vDhUIlva+t0ojBwxsj3y96+m6nxW23zLGAn3aM4XenTij?= =?iso-8859-1?q?7MUM81r1zyM/VezTet7nMBE3jEBTGvYPQT0pc+ADwETgI7YXW9gQ5r5qI+hb?= =?iso-8859-1?q?XaAWeKwCx6144qe3eL2KfhP80e6CqR82uheP1BE5T50Jqqi5jWxlppI2hphf?= =?iso-8859-1?q?uT4KGfE59TT7d7L+ZPxNOqyNgzEQif3ax6881bfi3k6HcpaS4QhLb/UiNiLj?= =?iso-8859-1?q?mPMTKf4DLLC6TavjiwjouqihovPaBs+0OazQeOcqXDfO57QDw//FrUtNu4VD?= =?iso-8859-1?q?jbwBAJdwFEdxdk2EIKXi9cejrUbaTKuV0KwKuxFZRURw+i6+ntZy5ooCbHL+?= =?iso-8859-1?q?PbtZlCzxGLsusLoDasxBoH7hyOwbOfp3rCGwQdW8+w/W0O+NGNltfKJQiBk3?= =?iso-8859-1?q?AZr3B+oLD39FuLVWnx8BfRnf8xgeYd?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39860400002)(346002)(376002)(136003)(199004)(189003)(6436002)(478600001)(25786009)(99286004)(11346002)(2616005)(476003)(76176011)(3846002)(6116002)(81166006)(81156014)(486006)(71190400001)(71200400001)(2906002)(8676002)(2201001)(5660300002)(97736004)(6486002)(446003)(7416002)(2501003)(86362001)(5024004)(14444005)(256004)(14454004)(316002)(68736007)(26005)(8936002)(6512007)(53936002)(1076003)(66066001)(386003)(54906003)(50226002)(110136005)(102836004)(6506007)(36756003)(105586002)(4326008)(106356001)(186003)(305945005)(52116002)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6566; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: /mnwCYsHzTMw8NxRjkFUaQgpCyUtybhTXHm8aSiIjXrsZrw4xzhg2pe64sjrPWvSfsoz7cVXYPzK4bh/oS1RbDFhLVOglkm7hhYUpr6pjrjMpap5WmVgBkKU8MtIqzyEVbD+9to3o2y3rQtkBRXPsPzhn7dHv9YHUg2fnjEVoLyEYJwQrbs0edHnpEsPR5upqUxZ0ZWV3C+JNH9IGNq2KTmWQRJM7GW1dRzPj2augk7NVZSyyuBL7kB4mfaIRoNBxDPwFWuMWYVKFsinLkwhOReflc46F5EqPQTGAzwyGkLt9we4VtsSlRsDTjGFj/PuM/bg+gSzVRYlrXiDphTBFuYAqh+kn60agU6UvlGGtkiY3OfQcZIi8HStg88QNMdnkMhM+LqY9xSFmeHJ1C29FOJZydE14g0TYhOsLLCA/Zs= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f696517-ce7a-432e-787e-08d6a604700b X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:32:11.4167 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023248_164193_136FCEEF X-CRM114-Status: GOOD ( 12.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang Allow CFG transactions to all functions of Endpoint implemented multiple functions. Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver") Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian --- V4: - Split the link up check to the 18th patch drivers/pci/controller/mobiveil/pcie-mobiveil-host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c index dc5324d94466..74a14f05115e 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c @@ -37,7 +37,7 @@ static bool mobiveil_pcie_valid_device(struct pci_bus *bus, unsigned int devfn) * Do not read more than one device on the bus directly * attached to RC */ - if ((bus->primary == pcie->rp.root_bus_nr) && (devfn > 0)) + if ((bus->primary == pcie->rp.root_bus_nr) && (PCI_SLOT(devfn) > 0)) return false; return true; From patchwork Mon Mar 11 09:32:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49A1417DF for ; Mon, 11 Mar 2019 09:33:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3195828E39 for ; Mon, 11 Mar 2019 09:33:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24E2828E81; Mon, 11 Mar 2019 09:33:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C13C628E3A for ; Mon, 11 Mar 2019 09:33:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zePAQNXJMHTL0/RLUd+XKz3bPKquuy2aY4d8l1qy4ZI=; b=i3O8eu76Q9Wsfe mrox4ttTtpzZfyYeMQWABc77rJKfsethO8LSntwSxHBYb7X7bl01e5iTeIMHHeEQEz+p8vJXFkd+S TqIJivmLGneKeDm8tSCj1kafLwqatA+IIGyPPCtv4lh68/e8XF6s56uEd+5Pt0woprCzUz5K47+zh mlv4GDgVg8tJRL+BlXeIvTf+PzjThxcyk8ykWj/81Fd74hQuNk4bgrbxEkwYK0qz+lqAQ5CFyIFMK q+7d3Bnk3yirozeV0+llilAKk2cJ/aLAi+pqJQfBKzND6kFgGcJRhf2ejAftixJozFVFnZP+SyRn5 Ete0hPurNF1ye3BDuq5w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HIz-0003bS-CV; Mon, 11 Mar 2019 09:33:09 +0000 Received: from mail-eopbgr70051.outbound.protection.outlook.com ([40.107.7.51] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HII-0002hm-9p for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:32:49 +0000 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=IA7rcNmSSO5v+RL22C14TRn1KSNSUYVtFa/zfBl5cVU=; b=jL2mSp/jjJlaws/r44tkyT9pqv41pBm2tv/iFJIt0gzzv0JSFVsi01wthBtxFaE0o5gwiK2HnvGCw+Wfe9SI+d2LIxbhoMR29uZXTaTwpPbLjVEkfzDezooGl/eUVfZpIg9I013+4hWm0iIkNRZqCrcPtzKnYDVf0Z7mZhthu1E= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB4168.eurprd04.prod.outlook.com (52.135.168.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.20; Mon, 11 Mar 2019 09:32:22 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:32:22 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 18/28] PCI: mobiveil: add link up condition check Thread-Topic: [PATCHv4 18/28] PCI: mobiveil: add link up condition check Thread-Index: AQHU1+1UyHtNENDYwUWe6uvqq5FW7w== Date: Mon, 11 Mar 2019 09:32:22 +0000 Message-ID: <20190311093130.7209-19-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 919d5b8d-0311-4904-f456-08d6a604742f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB4168; x-ms-traffictypediagnostic: AM6PR04MB4168: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB4168; 23:7+/6dGO6dxmzi4X2oaUBWeHDxZ2aJuAL0pthg5M?= =?iso-8859-1?q?r6tDjQLZK/wEtTp?= =?iso-8859-1?q?toTdGFyxbqTe50TZpqR3sGdfy420vYgbyoiev20Ww3X58S4aI2qgqZB2Fpqu?= =?iso-8859-1?q?0dMK8FGVdLRvYZj2yiP7acxdEyP2zWJLs/J3c2+xCDCvw7Ibhn4oISklEY3W?= =?iso-8859-1?q?W7RVViKa/DzCpCSEzQrb5bmMasQrTL7FVqGYLqEllk3rhavJsdbY8RVOVZcQ?= =?iso-8859-1?q?BFyf0VfGQZGBaP6qtwW2Q6uYUB3CzRYxL8gXMrY0pMj6N6LQhmVfcYWOzOIs?= =?iso-8859-1?q?Sw1QsDEelhvSPucW9bLKknbyIYwa65udc7LfXc3ZJPwb9ipDI7QkT0Cx7iKo?= =?iso-8859-1?q?xp6MpUSXyuoiIcVntRsQJQPeBdhP7WLcP7I7TN5y/9rNB/9Mjcjxz7I7lsKT?= =?iso-8859-1?q?D6HjNQ5eIVeiwI5sm8SyUG+fQ9RArDi/xtG38iPfD1Zi0j/Am56caS3JkQoq?= =?iso-8859-1?q?aazKLOeBV0NM6MpUloA+YxW/nMa9IRoGkUWPSCydEodDqYiXb2FcbJPXo/K4?= =?iso-8859-1?q?HJsSl34ZK/rnQLXdIebheJO8ssBbuAEjfZf7ZzOfJp89cLDzaEQP1t/I149w?= =?iso-8859-1?q?jiXswVC/rdW5T2aoqk/ye0dzSSis8rRIjv8SniBh/wuhM4DEWzFw7dBZejv2?= =?iso-8859-1?q?1w3JqItwmfYWEGe2IY4gUoUPRxXu5QmeCBMNEa/D+sDdEXYC0NJXiXyoih2n?= =?iso-8859-1?q?gqJxEpyWFqI5Fbbp86GE62o47ur4JRFAMyPBnBSGkY9bq1IbS/na6N3068j0?= =?iso-8859-1?q?aynhHEsF3RmZDMsh+fvm32b3xVsq3Jm/z6ZrhscL9oJVE3tUTVgOz2CyArcH?= =?iso-8859-1?q?g3fYEJhR8vrzOr0Hi6coXTB0afPkYaNmRPs/dXX6GWYgK1i+773o3K1j+Zan?= =?iso-8859-1?q?ooRRoC+/bQF9tEeHrxHtDyNGOZKX7NrvRhDNo/HkyJgK8cJBg2V6DPD337FV?= =?iso-8859-1?q?E6ulDBfsR3VtGW9OvHhWb2/r7TGBxmnIZWxj+MO15r8VjXJ5qxJCkMuaRcZU?= =?iso-8859-1?q?i+IUVkFPV1gWZRRmeKJuKn7qxQW84jslokkA068e4sLGX45W4rtb0BwhV0Zm?= =?iso-8859-1?q?Ou9/mcgRW2dsnrg44+UCpbtJOVoi/v3g/kCUoN3O6SrVQ1OPYoh29rtWJnFi?= =?iso-8859-1?q?ne2yZ1oFnjV3+ravQ92w6LrGNPgUtZPjgTsSFOp7tlaI50hw4K9eDXac+ifK?= =?iso-8859-1?q?C5MRQOO3M5qm6NAPgtoNe36inkaOwg9r0ESLqt/DdqSDCuQPIDuxdq7Gm+qY?= =?iso-8859-1?q?xoE1hyi8sQ0MJ6cYU58WqRxtEdtAL0TCdzRK+enqx0rcoO0ZcvbQ64X7u+mO?= =?iso-8859-1?q?ArOGuxJRI=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(136003)(376002)(366004)(346002)(189003)(199004)(106356001)(476003)(446003)(6512007)(105586002)(7736002)(486006)(11346002)(305945005)(256004)(6486002)(2906002)(25786009)(54906003)(6116002)(110136005)(3846002)(71200400001)(2616005)(2201001)(86362001)(4326008)(71190400001)(68736007)(102836004)(5660300002)(81156014)(36756003)(4744005)(2501003)(7416002)(6506007)(386003)(6436002)(97736004)(53936002)(316002)(186003)(26005)(76176011)(14454004)(8676002)(8936002)(52116002)(478600001)(1076003)(99286004)(50226002)(66066001)(81166006)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB4168; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: NUDGBw78AjQT5PDEUP9QVkWmdRWLWUnkPe61OyJUu+KqnUk9iYnWDop5aD3DqU+hPfsPtG/ew90SOl2l9/m5SfQOx109hk2OUgJaiXaaSCRQcHxeu8efQqhYDGuLZb1bm3zNttJy/znn486P3nHkAJntujr/nyKeiZnGkfE1j5QrvfsCgABYVUxTaPmFPusM4AdzMUR+YvLb+NPHIYPdMqInhxMnkT73iuy36n5nRKlgah+9ICqbkiuwkU4tZvooSFNrfEwojM9spfy7FVpwLsWIYdkV56hzsJJTXYj3kyh6e5wDepN9wL9lAGehJNhify4DDgB5p1Ny33orc+5MgeAvS5DeQeH+UyAwmYMKkNXg9u+v87dVCjPbS05bLZoQO3FyjSNkWcXHYbNPa7QPauMbTqbsh2q6W0gPVpo2bQY= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 919d5b8d-0311-4904-f456-08d6a604742f X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:32:22.8509 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB4168 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023227_159862_605315E1 X-CRM114-Status: GOOD ( 10.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang Avoid to issue CFG transactions to link partner when the PCIe link is not up. Signed-off-by: Hou Zhiqiang --- V4: - Splited from the 17th patch drivers/pci/controller/mobiveil/pcie-mobiveil-host.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c index 74a14f05115e..1ae82e790562 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c @@ -29,6 +29,10 @@ static bool mobiveil_pcie_valid_device(struct pci_bus *bus, unsigned int devfn) { struct mobiveil_pcie *pcie = bus->sysdata; + /* If there is no link, then there is no device */ + if (bus->number > pcie->rp.root_bus_nr && !mobiveil_pcie_link_up(pcie)) + return false; + /* Only one device down on each root port */ if ((bus->number == pcie->rp.root_bus_nr) && (devfn > 0)) return false; From patchwork Mon Mar 11 09:32:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB51E139A for ; Mon, 11 Mar 2019 10:31:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C130228F69 for ; Mon, 11 Mar 2019 10:31:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF0E228F93; Mon, 11 Mar 2019 10:31:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4DA5929065 for ; Mon, 11 Mar 2019 10:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=d0l5/GqSpR9nMBoNM6AiQ9YLnCkYuhNQTPlkytw33C0=; b=AXcuMMpC2h+BYi sGo0mxBEG2iJYQxDIJJtOo044ahZB8P916tM/x/ZBlsP75HliPUrG+C/Q0dXX1AvfPCfKFHB352xY CA3uAo4HB2DglEwZ1vz9ICpXyV3YnaRBCjm9cQojWmEUFl7Pzvtp5na0yXhKnnA4MaFKt57w6NQUq k6S/xZkz6s6XtjC2VxiqxPTKH6DJDyfbsQuKDXhLY9zUm7L1R9sdYAgzTiphzNyN0wNuNT9aFhaVp dGArv9Ozs6lULM5/fmmZ7XPkia6k2BQ3Etun7+XzMK4psrtLx1cXZofGO69T3MaTUj2tI0aT1r2Re Y0zffCWvcc+xtMc48zLw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3ID7-0007Xs-8J; Mon, 11 Mar 2019 10:31:09 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3ICw-0007Mk-S7 for linux-arm-kernel@bombadil.infradead.org; Mon, 11 Mar 2019 10:30:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=MIME-Version:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:Message-ID:Date:Subject:CC:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=DmHknRHL5Tu1K34Eox5Xkx+5cF3U4coO6Rlxd/TOVIk=; b=ut6D1k3FL1E8Z4Z0PvvruBO7Jd Uq3XlI/lZlEFaxnrZfPnnQFm0CgDSatCsLLLbE4qOsVhRltHdSoN/IfJnNRsjXqC498sYFaxE1M14 bovNx8Iowm2JMbNw428Ah4MOshPd+/LhrNe7hfERGOUNlG4Gri3QFsOycqEIWe+a0sp2+ALc+BNV5 Ch9cI6HFywWINX651awzb76odL+o7g1WrC2Pq2Oq/hw5KxbgrAUNzwOksGlp60wv9A/nxxXqGBX7U 8hv3+fSZifWx3MiJmDKjTKmjOxSPWenX88tolrY1F71btngVtC7S8xMZRkUXl20VzLfqxYDrwMjQm pFqkAlgQ==; Received: from mail-eopbgr80071.outbound.protection.outlook.com ([40.107.8.71] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HJC-0008NI-R4 for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:33:28 +0000 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=DmHknRHL5Tu1K34Eox5Xkx+5cF3U4coO6Rlxd/TOVIk=; b=uOnGJeo8WYqndGfpINX1FFjwC02XtFDBo/uD4LlVopl2PvP2s2Bkn5YtSlA/SYjMaKSYRCFtKcaiK56cnhgQlXBMqeS3RMpmxhcB7lqSCGA5jYnlE3XsrzseabrN2LCrlL9V8BHeWziaAvbBDM5pV/rUywAvmgNINRCNfg2AlSA= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6566.eurprd04.prod.outlook.com (20.179.246.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Mon, 11 Mar 2019 09:32:33 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:32:32 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 19/28] PCI: mobiveil: continue to initialize the host upon no PCIe link Thread-Topic: [PATCHv4 19/28] PCI: mobiveil: continue to initialize the host upon no PCIe link Thread-Index: AQHU1+1aTfTjlfwXvUuheVZYtTxEvg== Date: Mon, 11 Mar 2019 09:32:32 +0000 Message-ID: <20190311093130.7209-20-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 73c04ad0-8c1c-4314-ceb6-08d6a6047c4a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6566; x-ms-traffictypediagnostic: AM6PR04MB6566: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6566; 23:1bVwLqC3/94HUEDQeXwmn9uogQOE19evhZzjwhA?= =?iso-8859-1?q?D7WA6+KLx/IMPRb?= =?iso-8859-1?q?sXHCzuN2NsuxB1EpnCZPX/fN/jhSFT4Fdqg8JbqYHFpmOYbgSFcMXbsll9GS?= =?iso-8859-1?q?k9uhPX95zEUUskaf1X2vJMkj6eGHDHIoNVvMfPAKG+5pm7MAH9pWKAUNds+M?= =?iso-8859-1?q?/Be2juvA8e7o9EXeDs7FpP5PYiGGNKu+s5MRzenLX6lAEEdjPSoWFGan13mD?= =?iso-8859-1?q?Rsl/TiXTEO5GIJFvOLn6DgWTBonXg2CsEaaM7o/dMagkKBeiXyRLmVJj+4r1?= =?iso-8859-1?q?4u/3loj7+tQS4/3lQc1uqRZx73TQen3NJU4z2QV2dAK6zSBT94vaPNVSODDk?= =?iso-8859-1?q?B+tUKEFK5jTRgYWMR7kZV7sttES1T3UHgfDsMe1U3zrBbUOIGLCvJLbDkbQQ?= =?iso-8859-1?q?K2uh/HQijxbr8OL0L8NvEQ/XzqN4HY2Zj4Jz/AmDNycIQ5UJotB8S+JEJ5Mi?= =?iso-8859-1?q?RbSaoDOruA15AZRFKMrGMeNUFJ/U5OqmLyaFmTgW8QfN/thgop4jO8OeU0+T?= =?iso-8859-1?q?v730ZpmfOd//+2634pL/PnTZS+/jJ5eORzmEC5DUGs/ZlEXvu+rclvejdd1Y?= =?iso-8859-1?q?Y8Q+B5BAeLh8krDRxu9dZff8oIuty3kUU6vXiYsWUtSQ76qt9HNCwhkS5eHD?= =?iso-8859-1?q?gLGWqqDZLi7zPvKTYVKZXtuyGA2lY8WCQKQuAj9THDFOjSspHPFWOX+f+c6O?= =?iso-8859-1?q?u7jvVze5fHwcVLePojs1RP3p/Zg+/DvgQpUgBpw6e3kTODl8v+FVYEKmyEJG?= =?iso-8859-1?q?qa5z49oW0gG8T8ODXuZDurcK0QEBAtE8wGCLOJQAwt0yqZt2/hMJqgD6pIOi?= =?iso-8859-1?q?sxB/8Fmj0ZXgABhaDPa1TOY1IMynQoytKpqJwoDrkYfCYIKjRlpjqbbcX2LJ?= =?iso-8859-1?q?TacXB83D6jVSu6qf3anItxSr9Db8XeJae9yuVA+dNmAN97YyaMJ2kHoKV7Hx?= =?iso-8859-1?q?mRgTJ5ALjIwUNGCDqxG3RWzvm/LpYe/Q4hq8b2PNo4BsF+ATEqrTO/sv8jEU?= =?iso-8859-1?q?w1i/hnMP3Vljk9FHiNrwcQI8FlUerP4KAMZJuIFWDJfw4UnKM76aP9FOaaOM?= =?iso-8859-1?q?O42YvX0bEaz5+8EUi4kATJ4yrPq2Ih/jshQK6s++LyVhLdghG6gsNdzsa0Pl?= =?iso-8859-1?q?QxZ5sVQGP61bcnho56z3m10kMr3RKi3q4e5kI4uiwWGHxZ8PPhgrIjCk13ys?= =?iso-8859-1?q?O9cRb+jNYc3Fo+XOhwV1tkltS4B7n4BhS9e/07Z0hHED2ecwg4vafT3+w4XD?= =?iso-8859-1?q?YOWzqDfFD4qVPqsn6Y8qfMQqtKN00fSR18JNjk5tekZEe4GA=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(376002)(346002)(39860400002)(366004)(396003)(189003)(199004)(6512007)(8936002)(26005)(68736007)(53936002)(1076003)(316002)(256004)(14454004)(186003)(305945005)(105586002)(4326008)(106356001)(7736002)(52116002)(386003)(66066001)(54906003)(50226002)(6506007)(36756003)(110136005)(102836004)(6116002)(76176011)(3846002)(486006)(81166006)(81156014)(478600001)(6436002)(25786009)(476003)(2616005)(11346002)(99286004)(97736004)(446003)(6486002)(2501003)(86362001)(7416002)(2906002)(71190400001)(71200400001)(2201001)(5660300002)(8676002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6566; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: E9KaClX+37ZmzVG2l7Egy/40AYmlbMjqb9yiDCscgjwwrFVy40eXY9hAppFugCuC9txto7B+O1jsAgQY9J3P0CQUFRCAoe7Vkqqjlw2F2mLvtoa71kz5Xs578UX6nNij44ZW+abSkIIrD93aDsGq2rYBlr7uYI8jRM2oYrD5Qm59z7mJnK8/b/rW0njnxlYuqePburaCsADPPeoEb06af+t2ltGeApnm4x7VOa4aaD7mVed7QQFkVZSOB7ElkHpxHpsPTLEWk7iagOeKqtV1Wfd6T2Zu8qxWwN/tdrWNWUL7GFLeVK5/IiJeyabM1EgmanI8B6jvq1DAmPp3u4apJHK4kAD0AW2RDF18eQIF5bRAt9Yt6TvQhIK0ab07x7jOdc9kp8V9Z/HBF9g+vqrsbqEzIwBSsMe0eyHLGbEW8uI= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73c04ad0-8c1c-4314-ceb6-08d6a6047c4a X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:32:32.9081 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_053322_937824_6CCF2239 X-CRM114-Status: GOOD ( 12.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang Sometimes there is not a PCIe Endpoint in the PCIe slot, so do not exit when the PCIe link is not up. And degrade the print level of link up info. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change drivers/pci/controller/mobiveil/pcie-mobiveil-host.c | 1 - drivers/pci/controller/mobiveil/pcie-mobiveil.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c index 1ae82e790562..d1765d572f44 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c @@ -596,7 +596,6 @@ int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie) ret = mobiveil_bringup_link(pcie); if (ret) { dev_info(dev, "link bring-up failed\n"); - goto error; } /* setup the kernel resources for the newly added PCIe root bus */ diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.c b/drivers/pci/controller/mobiveil/pcie-mobiveil.c index ee678a60825d..370658d6546d 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.c +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.c @@ -222,7 +222,7 @@ int mobiveil_bringup_link(struct mobiveil_pcie *pcie) usleep_range(LINK_WAIT_MIN, LINK_WAIT_MAX); } - dev_err(&pcie->pdev->dev, "link never came up\n"); + dev_info(&pcie->pdev->dev, "link never came up\n"); return -ETIMEDOUT; } From patchwork Mon Mar 11 09:32:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847161 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D59B214DE for ; Mon, 11 Mar 2019 09:48:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB89F28FE3 for ; Mon, 11 Mar 2019 09:48:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF09228FE5; Mon, 11 Mar 2019 09:48:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4882C28FE3 for ; Mon, 11 Mar 2019 09:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SXfx78U98okpEdq42IwnLnocUEIeM4LsbBFFRM1orek=; b=cSxTLk6PCuaC6o N9RQjaZIZyig6NkDrLv9S2aVxq4Mv4mXHhRXJcVjhsR72QhTxiTJMYJaWPmTNGk4yK+eTKB6aYQJk aipKdCaMcYSibwumY/N/2XvRjhxFN5a2tbEKChba3svt4FH6fCYb6F17DBZNvdvTyyOM14Ynoa/2d zxoQUYLk9CpNzlpP5ngIezNYR30at9dOi7K3iOU4uWOxavJE0ini4+rK//DqtJL/qVoGugAEAG5/x jbjm1q34rF0r5gXndpjTKUNR3i+XSY2i6e4/dTnMEwNF/k2fX6TmnqW/6RxS3QQVrarBsiN/be594 dSdWB6sXNjWJ2tgpmMSw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HYF-0005A3-Rx; Mon, 11 Mar 2019 09:48:55 +0000 Received: from mail-eopbgr70049.outbound.protection.outlook.com ([40.107.7.49] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HJB-0000Rr-2Y for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:33:51 +0000 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=djRJedX0YnGMR+kxBuz6xh14Gf7Z72o/ke4jkc9v3Cw=; b=DyzpigMqijpiqAvoKkgqsQF/oxGGmfUYiGs5Jf7Yn/YuYYHGvutYjB9twFJgPcevURnzvLAE0x1rcGkh1Iw5CGp90547uJfjWDG0tjVSd/SErmrN8EL+NJgUxPkTAGUr3daxnSwZc/5J/Y/2q0KFIJx6Jg/v+4eeVz6egjT/9To= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6566.eurprd04.prod.outlook.com (20.179.246.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.16; Mon, 11 Mar 2019 09:32:41 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:32:40 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 20/28] PCI: mobiveil: disabled IB and OB windows set by bootloader Thread-Topic: [PATCHv4 20/28] PCI: mobiveil: disabled IB and OB windows set by bootloader Thread-Index: AQHU1+1fWHXqD4bHmUakTFM3fhqbXg== Date: Mon, 11 Mar 2019 09:32:40 +0000 Message-ID: <20190311093130.7209-21-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a5fbdb15-257a-48b1-6f2e-08d6a60480eb x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6566; x-ms-traffictypediagnostic: AM6PR04MB6566: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6566; 23:kZOQMGleawVldBPA40VGBqc7m6H1+Z7xrUbr5m9?= =?iso-8859-1?q?QbdoQVVAQXwdzKR?= =?iso-8859-1?q?3ECibK170FG37QEV3Gey4Qgvb0XIuZhr3T3b5ZFl+noD/UvTs9yItBV1LxPs?= =?iso-8859-1?q?9zlgE8eUGo8YIZzkVlA0yJIwfNQnMkKmaP24ci3R72pLlg0LXQlWv4//1q/a?= =?iso-8859-1?q?CELfbU9aeLf11dKdQIdEofhtevVYBqsG175a5n90Sks+QAiQrBM2CD89sL3/?= =?iso-8859-1?q?514RcxRVNia5Z0VCe8DLYylBbi/2BMCPht79ulcY33AkC4TeYMIEme6xFUME?= =?iso-8859-1?q?4V2lkL7MNCz43ttYEpY09emtPYB2HPkNr8MU94+FxDCaXA1uWYyDlnh3oRay?= =?iso-8859-1?q?pKXKa3UhTlyCSBo/nGpbynVzGeHdixpYf+KHba8chp/1LJVdt1uiWeLPYdA2?= =?iso-8859-1?q?XPvSFkm7VX93UzYQlTNJTI81p6//xXVJF9iIn1Tc1yqLN36eVzQSp9bf5t4r?= =?iso-8859-1?q?Cz7seH+ufCNya9zXyhk015u2wGkdsJMaHQO7fCLYWpLebv3vlpamcxYLyhea?= =?iso-8859-1?q?odQHZdoOV8jxWZ3SfDmnVlTadbzT+DsZo5Q4cdoAIFul/mbcb7dm72AxCsgx?= =?iso-8859-1?q?h3O9AlptgG6Fd+EK3dTinUs0AIA4ATwqANYd821vYDF3IOZyClZfLqp1fEQ1?= =?iso-8859-1?q?1hYS80r2qwHPeBw+Wgt+sJmluN0iuarjHVUjj6E9ardYN9/BDx8yhrnRyTB6?= =?iso-8859-1?q?fcHPQapznyKc3SIDew5GXn3MFmLMOzzr4HVJThm0OSuDTb57B7yF3CAIYsR9?= =?iso-8859-1?q?Qacr3gmEwD2ThQ5ZMnwuqL3GztDi8x31qzuQO1Ux45s1pKQnC+VUnvDndUqy?= =?iso-8859-1?q?WrJdDuJdm0zoBccGFBuNfinQ7ipv8crSPSYP9X5/HBElpHgqb1h7vy1iLO3L?= =?iso-8859-1?q?hW4ERXTPemqY4zH9OdHR2sHjSjSJG5S1TMHfobwZ59OqY+j9m9IriWq8aovA?= =?iso-8859-1?q?KFf8Yhj1y142WO4hBWnenOdwnPC9xYQl6t0k1TGkwoY32N232riHKL05qCnr?= =?iso-8859-1?q?PxHvyPoxMoUXt5fs0Y47kCbGG/oHembJWgmV4ZyEPvjJ15w+cwV4FUAk+Tgd?= =?iso-8859-1?q?L642Y6LpZBLtTffULkn4IXaWAswzjDTYeONj8ofW57/iEucXoy0JQc3o6mH8?= =?iso-8859-1?q?bNuv2Lgk2ZsE3I6N79g/zpmWjtUzRadWAD1nERz6sSdmG3QNWHpZW/3iq1ie?= =?iso-8859-1?q?Epv0BHkxKrWXVOFAj1KuBoGmUY0ble6mpptgxn1jXJNUDk0qIfPEapK9o4oN?= =?iso-8859-1?q?pHod9mGMMvVjCLvPk9roAxu1I7wPdWrhcNarJ8goOMCPR2LHDyYwpG4HpMi8?= =?iso-8859-1?q?VinlR1oN4=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(376002)(346002)(39860400002)(366004)(396003)(189003)(199004)(6512007)(8936002)(26005)(68736007)(53936002)(1076003)(316002)(14444005)(256004)(14454004)(186003)(305945005)(105586002)(4326008)(106356001)(7736002)(52116002)(386003)(66066001)(54906003)(50226002)(6506007)(36756003)(110136005)(102836004)(6116002)(76176011)(3846002)(486006)(81166006)(81156014)(478600001)(6436002)(25786009)(476003)(2616005)(11346002)(99286004)(97736004)(446003)(6486002)(2501003)(86362001)(7416002)(2906002)(71190400001)(71200400001)(2201001)(5660300002)(8676002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6566; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: VQR7s65k6XKP9vgc8+qRuJy08gPUUKos9KcnjajPfC5WUChq9nIrRE7J8v/g+mVgPXseQ47+gPJaq/GhluPIUuuqksQUwwxf8NuILDm6xgPJBRXzGhAjKR6/ezcGUUc21aH3t9XvnOJUq0zZc46kTiI6ceWveq1GHMsHt5dYX7HzXRlmEKC2ua6F81tV5/bEm0rIrfpiDAkosQOshJSrljvO9iIjznuVD7H5wLEOTWEOgD2E5OGMbx9x9LEfN+JbkdsHW3k8QHbt+llyw8r55kSTBUfZpv9MmlCjSzS6AKZ4T4yXtXLkDn4AhUB0MuCpDWVT1LUXRDMQc/boEvA/EzV4yJ545UlvSZWJgm+xJx+xmHgTuAQD4YX9WNg1ARNIdANXRpkDBqI0d3D0XnHVvQ0m2tyndrau4xoWbGk1oNQ= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a5fbdb15-257a-48b1-6f2e-08d6a60480eb X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:32:40.5316 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6566 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023321_458107_2E9024E1 X-CRM114-Status: UNSURE ( 9.81 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang Disabled all inbound and outbound windows before set up the windows in kernel, in case transactions match the window set by bootloader. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change .../controller/mobiveil/pcie-mobiveil-host.c | 7 +++++++ .../pci/controller/mobiveil/pcie-mobiveil.c | 18 ++++++++++++++++++ .../pci/controller/mobiveil/pcie-mobiveil.h | 2 ++ 3 files changed, 27 insertions(+) diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c index d1765d572f44..d028cdf31d0e 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c @@ -221,6 +221,13 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) { u32 value, pab_ctrl, type; struct resource_entry *win; + int i; + + /* Disable all inbound/outbound windows */ + for (i = 0; i < pcie->apio_wins; i++) + mobiveil_pcie_disable_ob_win(pcie, i); + for (i = 0; i < pcie->ppio_wins; i++) + mobiveil_pcie_disable_ib_win(pcie, i); /* setup bus numbers */ value = csr_readl(pcie, PCI_PRIMARY_BUS); diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.c b/drivers/pci/controller/mobiveil/pcie-mobiveil.c index 370658d6546d..49d471b75925 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.c +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.c @@ -226,3 +226,21 @@ int mobiveil_bringup_link(struct mobiveil_pcie *pcie) return -ETIMEDOUT; } + +void mobiveil_pcie_disable_ib_win(struct mobiveil_pcie *pci, int win_num) +{ + u32 val; + + val = csr_readl(pci, PAB_PEX_AMAP_CTRL(win_num)); + val &= ~(1 << AMAP_CTRL_EN_SHIFT); + csr_writel(pci, val, PAB_PEX_AMAP_CTRL(win_num)); +} + +void mobiveil_pcie_disable_ob_win(struct mobiveil_pcie *pci, int win_num) +{ + u32 val; + + val = csr_readl(pci, PAB_AXI_AMAP_CTRL(win_num)); + val &= ~(1 << WIN_ENABLE_SHIFT); + csr_writel(pci, val, PAB_AXI_AMAP_CTRL(win_num)); +} diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h index eb4cb61291a8..81685840b378 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h @@ -171,6 +171,8 @@ void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, u64 cpu_addr, u64 pci_addr, u32 type, u64 size); void program_ib_windows(struct mobiveil_pcie *pcie, int win_num, u64 cpu_addr, u64 pci_addr, u32 type, u64 size); +void mobiveil_pcie_disable_ob_win(struct mobiveil_pcie *pci, int win_num); +void mobiveil_pcie_disable_ib_win(struct mobiveil_pcie *pci, int win_num); u32 csr_read(struct mobiveil_pcie *pcie, u32 off, size_t size); void csr_write(struct mobiveil_pcie *pcie, u32 val, u32 off, size_t size); From patchwork Mon Mar 11 09:32:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847099 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E8E8139A for ; Mon, 11 Mar 2019 09:33:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8554B28E73 for ; Mon, 11 Mar 2019 09:33:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7962828E82; Mon, 11 Mar 2019 09:33:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 256F128E73 for ; Mon, 11 Mar 2019 09:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1J0fowIqliF/RMazGLwA7YGgB1CfX9ThTVfy58KztoA=; b=T2Ny+8RUyjJf+E Uc4d7C4PwlXmdSpvl0uuHwtTGtER+tv5R6pW+VsGhqnrr1rnDbPR3FzWqmM4feUcrxEIKZulZ4TqS HX8P3RgsKjF+RPkIdM/UFAFRZGpkedqfcqIx/3s16K+nert9l/HzAQSwUD1UtIiQTAsqefepKT+mm i3MhMrmrwirlGGQqC2+Wj090Lvs9hQ5g5IQ14TkyVnzDZm1mSTtPU13JPeqvjnA/EDRd5pNeDuBhW P1F8V72RYR7zQsGT2+nEOIz3+E1uvVzCKIemRapGjbq+fsYr7Ff4jFtMEHolBa96qNnhoT/wz+C0E fXJDFA/t0MkLhTtgP43w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HJc-0004O4-OX; Mon, 11 Mar 2019 09:33:48 +0000 Received: from mail-eopbgr70048.outbound.protection.outlook.com ([40.107.7.48] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HIi-0003GU-Rr for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:33:29 +0000 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=N+LRyQxuKBCpMSVuuYXdi8UF39FveLM4Iq8rCKuymEY=; b=jJtVqEn/ssk3vBjDiRTvhlY29uhhrGtBQRs7bK8nZW8avxSHKsCr0YIhAVqpPSttC6BfWELYVLe/VQvi08XY6RKNGaOV6mU8QZip0DYoKI1FFrdJ3j9RWnOm4I/hqSDGZSU0ivTLI/I0BgTyArYpQhf7wqsxMlzKlksJyq+S76E= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB4168.eurprd04.prod.outlook.com (52.135.168.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.20; Mon, 11 Mar 2019 09:32:49 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:32:49 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 21/28] PCI: mobiveil: add Byte and Half-Word width register accessors Thread-Topic: [PATCHv4 21/28] PCI: mobiveil: add Byte and Half-Word width register accessors Thread-Index: AQHU1+1kIDVQdssEHU+uhZ59DBwaQA== Date: Mon, 11 Mar 2019 09:32:49 +0000 Message-ID: <20190311093130.7209-22-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dbad3283-6072-4fc0-2edb-08d6a604869a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB4168; x-ms-traffictypediagnostic: AM6PR04MB4168: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB4168; 23:6iiv20Ev6GUbZRObeLZj1mGDKf4pHr8D70giOxi?= =?iso-8859-1?q?wuWzyLBrcW8Kd0h?= =?iso-8859-1?q?e76yDDJwKDEVzDlcRg8CDEDWwIMnieGMr8L8WH3tIUAcubGIysCTWAw1ns4X?= =?iso-8859-1?q?NvfjRB0Ut3zhahoPrU+3cG+jJUmQjZY5Gv7V056VCze4rLtQy6ugwCZjKOgr?= =?iso-8859-1?q?EOFnCuN1vPbmKIkZMXE+ZoNHZSQzYp82YGDzQaYbUaIRFxoVIGcwaZdqvR30?= =?iso-8859-1?q?aWL4D9uARjusPdaCmIVOGuuZMHXkS8L5veI2zyfZNqERbyV1uZMGmMtqml/z?= =?iso-8859-1?q?Vj1MR+Bf4pdY9GtHzZNCLDLNbiqvwhF3jN6SgO7Dp3CHPbdKXTX3AiU0NL75?= =?iso-8859-1?q?3W2idCaCGAKj/NwsoVhPXsryk8WDusCwqb0vGy4P6RV/5pJkYXyQXPo2d+M3?= =?iso-8859-1?q?kUODnCKiNk8p+nvpb+P8RbXsFfiNusWLuGIsUkhRMgH5s6dY3W2eprWvQnLx?= =?iso-8859-1?q?XopavbwI907JT1odSAejVanE5eL2lT+4tj+rq/Qp1aNMAeksdrV0c8uQRYns?= =?iso-8859-1?q?CrDuqc3TWE6EdAUPo4unBjucPuQYZoMvNzBq/vKyBZnshxbfDC4EcCz5e8D7?= =?iso-8859-1?q?huOZbkfUGVvG4ntT+KQTLEtTNztwI2eRrbGwB7smi68BoWp+THcJYLX8rR5c?= =?iso-8859-1?q?tHOXmAlYfdXrQmQ181Zcb1CQZRn57OkZNx4E/dgtBgFKhGrp2GCrsq4TETAz?= =?iso-8859-1?q?whVbM8agYoZpFCenAhM1NsFYSubG8SegJHIVuNbgvLWTm1MWmt8ZgrrrzFo9?= =?iso-8859-1?q?B2dlvgBAXlqIR9HuVrLwuQoETE8sLm9rW7pjzUGSK9o5TEZ6lqDdlFgpk0sq?= =?iso-8859-1?q?dlutc0IHt2RiGSh+Xi3fFE7klEKsNGZhdz2UTxVUS3a8KW2Pj2JNPZOSpFzy?= =?iso-8859-1?q?DNatbeQdXheCGIlpz/52nNsxzTi+41bZ6J1P3HIWx3XzWCePDgYuyqfX4wAu?= =?iso-8859-1?q?uIlB4JaRVN9Mhux8MFEoVliuDDZ8+IXJaWl1HgOQbIhsAteK8HAW/xGe1KxS?= =?iso-8859-1?q?fXnZegMDRYd18ABEA552LsheQx39eipFDQvx1aGUTRw0CI7xmHV52gNI7fIl?= =?iso-8859-1?q?QRwoP529wABbQafJBwhff6mQLnXy6Jl8Vuqau0NXA1LrM3MbkCb4LblLRQTa?= =?iso-8859-1?q?cFxBaLICA1iQGvBd524Zeg3IElRRje35nqHuaw7eJ1oRuJ8Cj50QWoEXGP7Y?= =?iso-8859-1?q?kMSRhuaDm8PLRrLvKCR43yf/CEM3VrmkUSz1dounJ8TfHn3jsYHbOqwh2Wr6?= =?iso-8859-1?q?xJDNuqlC/eMPIxUtdYr/7UOlAPYN72P41dgaUdg8oCGK3q2w=3D=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(136003)(376002)(366004)(346002)(189003)(199004)(106356001)(476003)(446003)(6512007)(105586002)(7736002)(486006)(11346002)(305945005)(256004)(6486002)(2906002)(25786009)(54906003)(6116002)(110136005)(3846002)(71200400001)(2616005)(2201001)(86362001)(4326008)(71190400001)(68736007)(102836004)(5660300002)(81156014)(36756003)(2501003)(7416002)(6506007)(386003)(6436002)(97736004)(53936002)(316002)(186003)(26005)(76176011)(14454004)(8676002)(8936002)(52116002)(478600001)(1076003)(99286004)(50226002)(66066001)(81166006)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB4168; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: PJjDrI+/iyZcLkljKuiiwNRWftZpASGNQsArgOlAFiglwYg6SWaDnKSHHdqmlCmmlM1Iw/nHGtQZhSeBEwX+tAW0LL1b32ecC6jkAKz/ikTAqLtMBFX4LB18fMgwp7+sc06rD+iYJmdmQS9nG82eOWfyBfqKvK6HJzcAQd0eaezHIrw/uifE/Fs4I+iiltJuZiMgdt8s8wQ3AsVWtfoCrboM2o4wseBFUtHow+prsuBoibppNcBoGuiyZck+RjCVABUo0ljpXgcmu8U8qWs3VjHf5un7SNXHsn0+MvkDfm7kJ8/kW4dEcWJ63dNEO6TOSNE0LVG+dqWwfVgmPt1S5sYrcqcutyrY5NDDBd35SfcA3zva44iVC2K6njFp3ceOzF9zcElskC/HHLS0CN4rwFbhcDrs+4W3OWsz4ARnmcU= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbad3283-6072-4fc0-2edb-08d6a604869a X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:32:49.0857 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB4168 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023253_339596_D59FFBF5 X-CRM114-Status: UNSURE ( 8.62 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang As there are some Byte and Half-Work width registers in PCIe configuration space, add Byte and Half-Word width register accessors. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian Reviewed-by: Subrahmanya Lingappa --- V4: - no change .../pci/controller/mobiveil/pcie-mobiveil.h | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h index 81685840b378..933c2f34bc52 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h @@ -181,9 +181,29 @@ static inline u32 csr_readl(struct mobiveil_pcie *pcie, u32 off) return csr_read(pcie, off, 0x4); } +static inline u32 csr_readw(struct mobiveil_pcie *pcie, u32 off) +{ + return csr_read(pcie, off, 0x2); +} + +static inline u32 csr_readb(struct mobiveil_pcie *pcie, u32 off) +{ + return csr_read(pcie, off, 0x1); +} + static inline void csr_writel(struct mobiveil_pcie *pcie, u32 val, u32 off) { csr_write(pcie, val, off, 0x4); } +static inline void csr_writew(struct mobiveil_pcie *pcie, u32 val, u32 off) +{ + csr_write(pcie, val, off, 0x2); +} + +static inline void csr_writeb(struct mobiveil_pcie *pcie, u32 val, u32 off) +{ + csr_write(pcie, val, off, 0x1); +} + #endif /* _PCIE_MOBIVEIL_H */ From patchwork Mon Mar 11 09:32:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847113 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CFE8814DE for ; Mon, 11 Mar 2019 09:34:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7C7C28D47 for ; Mon, 11 Mar 2019 09:34:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A982B28D62; Mon, 11 Mar 2019 09:34:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0A10D28D47 for ; Mon, 11 Mar 2019 09:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=60FS9v4hk/YD/pGera3TVMOQ6+3rth5FCbubALB7dLM=; b=ZZqWIQBQEFAX/4 J75m/7HOuU0k49cm4W9r6pfCUb2P9l+SgxYXM7Iu8teQtnrFx11VD83pmB15tKV2HX5RAfAM+Wp0T 6PMCotRzZTW9TwVwHacjN0gjdJdmxidwLxottPxK+AWEW4AVYRN1FJQYlFGlGVzLGMLkny0w+gQbP VURRuBDm7hbUwg42uv7NaUdjxNgz7ZqiqpWJzyCe4MgiAg37Pa44njYMRisSYiZCXwayvdr5+2Xrs NoTMBkBvY9jPUq5WAL6DYIepmaeZmOci3IebDHQGzzu4XJzxJQe+FaTR52sKrAW7ab+4UDaQauPNT 8jwCsvQrtRmpDWgx/aWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HK7-00054c-Fy; Mon, 11 Mar 2019 09:34:19 +0000 Received: from mail-eopbgr70048.outbound.protection.outlook.com ([40.107.7.48] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HJJ-0003GU-Tf for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:34:02 +0000 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=Mwq4DogXXuQC1jDXHppEhLMKOvQm4SLl8Dw1Ilx4cnw=; b=SGsUcs3//zRPwTdHZi7d5pvdSXI4KX8Cz4NabZl1/OMLMYJevZoFlUp4E4wxaAP6semOAbYnrj6J1d1auJKkVsDgOsNMaIBP9XOIKvEnCZ4h/hoYXNUEIgiLUr0MAF2KA/LPt96YAMH8JOLFNgCv6gPYk8roOYH3O8MWD7npo9I= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB4168.eurprd04.prod.outlook.com (52.135.168.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.20; Mon, 11 Mar 2019 09:32:57 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:32:57 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 22/28] PCI: mobiveil: make mobiveil_host_init can be used to re-init host Thread-Topic: [PATCHv4 22/28] PCI: mobiveil: make mobiveil_host_init can be used to re-init host Thread-Index: AQHU1+1pcpzAuc+rfEi+Yu/+RO94xQ== Date: Mon, 11 Mar 2019 09:32:57 +0000 Message-ID: <20190311093130.7209-23-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d36aeac5-ae63-40f1-fb12-08d6a6048b4c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB4168; x-ms-traffictypediagnostic: AM6PR04MB4168: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB4168; 23:NO3AY5qwEkKSLM67ciI+Cd7CVesTrb345npIvLe?= =?iso-8859-1?q?5/QfnIK0bQtw0t/?= =?iso-8859-1?q?pdlNgfun7deG0xtBiLYT0ifDz56jvALGpalc1Lq5zqdqbakCHabiL9/8S7Ay?= =?iso-8859-1?q?yrjt2rECFvXA3xY7PeJ15vQPghBZvLuEa0o7alhmuX8er2bEOO5Xvba+3+rz?= =?iso-8859-1?q?8gNEPZsYT0M1KZWgzxJlogn0g9IYI/erRF2cdclGnBT09TjMe2YBcvZZzD5M?= =?iso-8859-1?q?e8KOUl+lvY5K3JTyhHhaQIu35m6CitiM5MwxSqMC/PF7t+F4wNw9Jr8Q/Uxy?= =?iso-8859-1?q?/3ui8eZ4wSp4Xrm0HJnRqwgEftcF0NeaIShJPY3Til6dzSA2co1jk2j2MyaH?= =?iso-8859-1?q?OVm4gt31GmJZ6e2X7CgvJH1eRTYGe439147aps9hnqZP0OXzUcZQAiYBnSVJ?= =?iso-8859-1?q?Jt9BLMApZWHd90Gg7pA6MJi0A7K8VKJo/q+pFU9WW/5Xsh5eg+j9vztRDpBX?= =?iso-8859-1?q?mwVxA9jjZsqEXhUb7vrD4H8SkJAMHafUFO6ZlsN3uOGqAURTj8zzXZzKYIG+?= =?iso-8859-1?q?Yp7yE5Q0D4tZ7DI54HwYBytoTI5uELwtGA91dicCuvl3F9QFsKDqIFrqVkz9?= =?iso-8859-1?q?Xy/3xPaDnZftvKmnSxP+/tV1J8ZBRkvPeuR2/57lxA59nOHnieYChq9M0ZPj?= =?iso-8859-1?q?fq5yFmFAy/vZHa0BALmuTwR2KGDM0Wrf5+wiopvZiek/hObtSyrRw/zzltXr?= =?iso-8859-1?q?ibBbLbnOEOXjWi+U9CZeXlH4lU8e5VbYbveH7Wvfjsj8n68BeCpYfr2I/7+9?= =?iso-8859-1?q?B1utbbhQ7EJxXFGQYxXV7ACBm6PismcRM58jJuWvNimGxDhiJxL6rez67AIl?= =?iso-8859-1?q?6x0/592O+hNatMV9vugonLlCYpqXmRdvr+Tx+l4CniU2TAD3wxUxYKuQhymd?= =?iso-8859-1?q?xf+U2soVqZnNJrXUQyIsPIMrxjc0U0EGwYY3/CnVs+ThK4xGXs9CvGImFD/p?= =?iso-8859-1?q?MJoe8KrSfoFeFZr81CQxa4cs5JhvfTGM0aTXV+qqLxLXdyjJj4Ejq3mJ2PsG?= =?iso-8859-1?q?+N9R2iJushOg5z44IGcKii3fzgK3wQ2S1E2k6heYkY1VW3Slj15BxqQnWLxE?= =?iso-8859-1?q?QvZWJqHtbxggImiiXSfVFtbgsnxwyfRbi5M2jidzrt1bB3NhCNgBX7ho7LsJ?= =?iso-8859-1?q?K8zXYBy6kAYUWGy++an0LODMxW0METYCUIafb0CLkcIUSd5u2kKSQTpSE5UT?= =?iso-8859-1?q?hzXWcggaXpcJwcuPmYkWw83BawqzrPu/0Ama48dJa/ez6/25Y4Or4zEySwIS?= =?iso-8859-1?q?mxYs0Z/DaSrlJx6cVclAbyKfpeqf9AHXjR6o+nQdlRVJm73MuiOHUSxuO7dD?= =?iso-8859-1?q?UwDsZTxbQ=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(136003)(376002)(366004)(346002)(189003)(199004)(106356001)(476003)(446003)(6512007)(105586002)(7736002)(486006)(11346002)(14444005)(305945005)(256004)(6486002)(2906002)(25786009)(54906003)(6116002)(110136005)(3846002)(71200400001)(2616005)(2201001)(86362001)(4326008)(71190400001)(68736007)(102836004)(5660300002)(81156014)(36756003)(2501003)(7416002)(6506007)(386003)(6436002)(97736004)(53936002)(316002)(186003)(26005)(76176011)(14454004)(8676002)(8936002)(52116002)(478600001)(1076003)(99286004)(50226002)(66066001)(81166006)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB4168; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: lFvATVmRb6mqGgUfKPRWeu55SauS7avvIueEYqWLLEbTuVAHaxhN/HLHv3jEHBHVFYr0n/5F9T3B+MfamlRIiT/R8ToziW/82HwLUjSRdqC62OpC90JVqoJZJx56ql1QKxvrkpYhajGNy8f8D4Fox/8r0+bDC29Qn5F2k0LAwgDkGDE4btr17+W2YiHgsBDe7Gb/3Kmu+PoPLu5BMPqlcujC86ftFF/qqtKbJzDBP9+MFDwGnNQAaW9pGAkvb2e6K36RHTelrS3xOMc+ZgI74jsLMHrUAIq91zz7OBcWs7BCdKWEjAW6dXblzAbitwqJ7CY7MzQ6p1VZvRd1YpaE4ocJ5/E3ADtwLBmVaoI0ntzhCNlA7w1KQiPj9xSawsO2JP9sxSBADTz6Shdu/QDKe258RPwr7wvt3IAFJX+NpCY= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d36aeac5-ae63-40f1-fb12-08d6a6048b4c X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:32:57.1045 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB4168 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023330_166059_E619347D X-CRM114-Status: GOOD ( 16.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang Make the mobiveil_host_init function can be used to re-init host controller's PAB and GPEX CSR register block, as NXP integrated Mobiveil IP has to reset and then re-init the PAB and GPEX CSR registers upon Hot-reset. Signed-off-by: Hou Zhiqiang Reviewed-by: Subrahmanya Lingappa --- V4: - no change .../controller/mobiveil/pcie-mobiveil-host.c | 41 ++++++++++--------- .../pci/controller/mobiveil/pcie-mobiveil.h | 3 +- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c index d028cdf31d0e..e8d0c4989013 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c @@ -217,7 +217,7 @@ static void mobiveil_pcie_enable_msi(struct mobiveil_pcie *pcie) writel_relaxed(1, pcie->apb_csr_base + MSI_ENABLE_OFFSET); } -static int mobiveil_host_init(struct mobiveil_pcie *pcie) +int mobiveil_host_init(struct mobiveil_pcie *pcie, bool reinit) { u32 value, pab_ctrl, type; struct resource_entry *win; @@ -229,11 +229,16 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) for (i = 0; i < pcie->ppio_wins; i++) mobiveil_pcie_disable_ib_win(pcie, i); - /* setup bus numbers */ - value = csr_readl(pcie, PCI_PRIMARY_BUS); - value &= 0xff000000; - value |= 0x00ff0100; - csr_writel(pcie, value, PCI_PRIMARY_BUS); + pcie->ib_wins_configured = 0; + pcie->ob_wins_configured = 0; + + if (!reinit) { + /* setup bus numbers */ + value = csr_readl(pcie, PCI_PRIMARY_BUS); + value &= 0xff000000; + value |= 0x00ff0100; + csr_writel(pcie, value, PCI_PRIMARY_BUS); + } /* * program Bus Master Enable Bit in Command Register in PAB Config @@ -279,7 +284,7 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) program_ib_windows(pcie, WIN_NUM_0, 0, 0, MEM_WINDOW_TYPE, IB_WIN_SIZE); /* Get the I/O and memory ranges from DT */ - resource_list_for_each_entry(win, &pcie->resources) { + resource_list_for_each_entry(win, pcie->resources) { if (resource_type(win->res) == IORESOURCE_MEM) { type = MEM_WINDOW_TYPE; } else if (resource_type(win->res) == IORESOURCE_IO) { @@ -550,8 +555,6 @@ int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie) resource_size_t iobase; int ret; - INIT_LIST_HEAD(&pcie->resources); - ret = mobiveil_pcie_parse_dt(pcie); if (ret) { dev_err(dev, "Parsing DT failed, ret: %x\n", ret); @@ -565,34 +568,35 @@ int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie) /* parse the host bridge base addresses from the device tree file */ ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, - &pcie->resources, &iobase); + &bridge->windows, &iobase); if (ret) { dev_err(dev, "Getting bridge resources failed\n"); return ret; } + pcie->resources = &bridge->windows; + /* * configure all inbound and outbound windows and prepare the RC for * config access */ - ret = mobiveil_host_init(pcie); + ret = mobiveil_host_init(pcie, false); if (ret) { dev_err(dev, "Failed to initialize host\n"); - goto error; + return ret; } ret = mobiveil_pcie_interrupt_init(pcie); if (ret) { dev_err(dev, "Interrupt init failed\n"); - goto error; + return ret; } - ret = devm_request_pci_bus_resources(dev, &pcie->resources); + ret = devm_request_pci_bus_resources(dev, pcie->resources); if (ret) - goto error; + return ret; /* Initialize bridge */ - list_splice_init(&pcie->resources, &bridge->windows); bridge->dev.parent = dev; bridge->sysdata = pcie; bridge->busnr = pcie->rp.root_bus_nr; @@ -608,7 +612,7 @@ int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie) /* setup the kernel resources for the newly added PCIe root bus */ ret = pci_scan_root_bus_bridge(bridge); if (ret) - goto error; + return ret; bus = bridge->bus; @@ -618,7 +622,4 @@ int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie) pci_bus_add_devices(bus); return 0; -error: - pci_free_resource_list(&pcie->resources); - return ret; } diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h index 933c2f34bc52..0f5303962e88 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h @@ -152,7 +152,7 @@ struct mobiveil_pab_ops { struct mobiveil_pcie { struct platform_device *pdev; - struct list_head resources; + struct list_head *resources; void __iomem *csr_axi_slave_base; /* PAB registers base */ phys_addr_t pcie_reg_base; /* Physical PCIe Controller Base */ void __iomem *apb_csr_base; /* MSI register base */ @@ -165,6 +165,7 @@ struct mobiveil_pcie { }; int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie); +int mobiveil_host_init(struct mobiveil_pcie *pcie, bool reinit); bool mobiveil_pcie_link_up(struct mobiveil_pcie *pcie); int mobiveil_bringup_link(struct mobiveil_pcie *pcie); void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, u64 cpu_addr, From patchwork Mon Mar 11 09:33:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847157 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C46C214DE for ; Mon, 11 Mar 2019 09:47:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABA5E28FE1 for ; Mon, 11 Mar 2019 09:47:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F30828FE3; Mon, 11 Mar 2019 09:47:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2206128FE1 for ; Mon, 11 Mar 2019 09:47:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oqS4rQp3wMYc9MR5zlyLu2VKncFGSoppVNmHbyzxJg0=; b=hXlRP09tblJGsS 9q3eBFZE50W7w2cyHjDpX+3MbUQmT/YT4RLmwI6yUX8ZVeCJeasgFPNXIDFUu/m+vCmAvpzFchmlQ AxN35JL+29PxLhGJsdVf0VH0N7Chv0LEWfUajH2rnMyVymDvZTpmHI+DFTwSxFqIETludL6C7tuZX EhJQfiiFw7YIjPEJFUnbA0OJrHH5P0TC0jtbTtUyIMbyRJJcFQGD2uoKQ1wKrsOdjs4wtxCpkQbXk /Pj+vfhlWDGeY/CEezVA6VMtc0zZddWVVOem4AUlzss2T7+fXg8IModFnqI3UB1AlRG11YBEFGZsI JdsW4j0J7RrM4A7KWN2g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HWz-0003ul-Ga; Mon, 11 Mar 2019 09:47:37 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HWX-00034c-Ks for linux-arm-kernel@bombadil.infradead.org; Mon, 11 Mar 2019 09:47:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:Message-ID:Date:Subject:CC:To:From:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yiRBbfaVqsMtqMMt0rjSLQ2wvRtVXSvzn2ROeF3OF4o=; b=S8mNV6GHzCh4TaTLttP1xkTnY9 ETUNoewPdWJYNiN575ohWY2nZAcPpkHRqsh38svs7CJ5amH8NUWImeSk8Dk+Rb4xAgr6dUWhxFlhJ DYE1KDzLIN4DmyHPja/GB//+52cKROTXYGj5S4BzK17fhetuKK4tH4BiPz5vH4dNOqfUnIxJjY1Au 8/Y4pkR66XqjY9Mlq0JtLvrBtvNnU3DRR8gGVlVMkoBIommbr/m1c5JLdSjsOTokP7j2N093tU/JI hXIc+BF90cikMGsS3g8+JFG0Rt3XMTEUKQDKfH5hUNTEDT5Hq85sq/AdhR8NpD5NksUN7xQ+adTWg XG/wu4Fw==; Received: from mail-eopbgr70042.outbound.protection.outlook.com ([40.107.7.42] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HIz-0003o5-Om for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:33:12 +0000 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=yiRBbfaVqsMtqMMt0rjSLQ2wvRtVXSvzn2ROeF3OF4o=; b=cj0g/jvtVcwpL0rhzFS/Gy3VmmNG7Zw6ePreIg693z8L4GprC3dwZqMGSZDfG4YlRYjmySclECtZT648mLuq8Kv/6Y96fm2jRt7GinNSX/hFsRPIMK5EJ0DK/5gVTvcHLpAO9W/RSzqJsPjYnIRn6eKYGecS+yRgBXrq2d0OvxY= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6150.eurprd04.prod.outlook.com (20.179.6.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Mon, 11 Mar 2019 09:33:06 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:33:06 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 23/28] dt-bindings: pci: Add NXP Layerscape SoCs PCIe Gen4 controller Thread-Topic: [PATCHv4 23/28] dt-bindings: pci: Add NXP Layerscape SoCs PCIe Gen4 controller Thread-Index: AQHU1+1u2iPsWkLxw02FlhClA/G34A== Date: Mon, 11 Mar 2019 09:33:05 +0000 Message-ID: <20190311093130.7209-24-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a549a305-a584-4795-aeec-08d6a6049016 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6150; x-ms-traffictypediagnostic: AM6PR04MB6150: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6150; 23:CTLr0tQlzIXWEc2SKFypLhggX8qj1FtJwMXvl+L?= =?iso-8859-1?q?D5h9qQ7djzkHNK2?= =?iso-8859-1?q?QB4iN1bxzO9sZGyiR4lIbd1GVnMWtYqe8HkS9jwBjR1nlyvNFTk7X8pORBRS?= =?iso-8859-1?q?/Ky4I5py/LwRHhT4xD9iZQu43B6bBObe5f1LPlRrE8RJYuge+j1mPi8heXP4?= =?iso-8859-1?q?YG7UYBIzB1bLXmb4ocanyq0nrWIKy0eRW7ijrjGRH066Y8LCwS9fZDiN9NRB?= =?iso-8859-1?q?2vL2ZjtCA1suLsb8CVPpSHzM0E9C3LGxY25yxcsN83xS/DSNQXfVxFZdbdFM?= =?iso-8859-1?q?ufBs/IFVE/Mlit9V+Wa2pf+t1fb0Tup/UXYfGEBQiH0OWvsrmpKbfFnJdg6N?= =?iso-8859-1?q?Wkkg+5hfIdabaZa63LeFnkOVag5NJkDNlOATbZgXFOYvOJ/URyKgD1wPMZv1?= =?iso-8859-1?q?4KM4mSmCpXyFztWIfE3n2heuS3x+OYAsgTq3+dHfNS4iHgh6FytZTRjoDD3r?= =?iso-8859-1?q?TKcqwoOCQUrrklTdK8g7kGJI+NL6udzJtjzMKoVBkAFpTNqMwFYqkazdmMle?= =?iso-8859-1?q?zkOuCn51yR3fC7Pz7G4Do8Zt82qJRNgoMFRc1jvVuKqpdH6C9Y9G6/0wIxdK?= =?iso-8859-1?q?NKCHYbiQUk5Qu9Zge+HEHDrIZw7jcivFC84fSmiZqirjUxMBRZckW5YVucIJ?= =?iso-8859-1?q?x9NIc0f/xv7AsdJEdgPx/fF/eRFjRxocqlJSdJ7AUTZMYLcAc5zQKIfbca3H?= =?iso-8859-1?q?fo8uD2he+u7zU/F1CmLGX02T3JpPEmhutG9FWUatDmAVlBTvPa39GqOYuKP2?= =?iso-8859-1?q?80XIxJ04o5ybdo+5m3iitv7tUm6s1upY/+NApnJhAGL0iZlqGyAGPajmvZGu?= =?iso-8859-1?q?QE9OmyG3RUwDZPSANWnhFXgHQKaNHYMduQkK02ZKRU6YgajqKVhbO5pchkJc?= =?iso-8859-1?q?Hw5XKRGc16TxXqIuOsR2D/4MvaoZQ5Tf99+Kt7pPgpzG2XNOTm6ci28AIo69?= =?iso-8859-1?q?Da9RDwdnuJg01FnNG7TLcToU/n2m9BFsxZ+tvrJpRmgJMwUORPd4qs782wUs?= =?iso-8859-1?q?nvpoVKY5/UZVmkPsOI1t+mrBi+N8cyRq2Rx9KbumTOPsyAPDeOLZ0o3EleTS?= =?iso-8859-1?q?MF1N1tW0H4KZ1yeZwk+P2hRJPi2H7UZX1enkZb/BUYu3uGija18NiZD4f2fQ?= =?iso-8859-1?q?F62ZmxgH4tOb7KPOnm/jSzf3RNDkgj29aNwpmjHHSFDX37DZ+bS2Cxn0Uz3H?= =?iso-8859-1?q?GN9sNSK8Z/ei6+WGee7o83u/QqTuzGhBxmeQuLI4vbQP9pM0S41f14XUFoL+?= =?iso-8859-1?q?pw9mGV5jTcoK4XWtXIsaG1q5hp1F8I5FrzXwdriKrRR3aObI+OwnNwcDMHte?= =?iso-8859-1?q?hbFo6drFs=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6029001)(136003)(376002)(39860400002)(346002)(396003)(366004)(199004)(189003)(86362001)(54906003)(110136005)(6506007)(386003)(52116002)(99286004)(102836004)(316002)(4326008)(2201001)(50226002)(2501003)(97736004)(2906002)(66066001)(186003)(26005)(5660300002)(11346002)(76176011)(446003)(6486002)(36756003)(6436002)(25786009)(81166006)(81156014)(8676002)(478600001)(476003)(1076003)(7416002)(105586002)(305945005)(2616005)(71190400001)(71200400001)(3846002)(68736007)(6512007)(6116002)(8936002)(53936002)(7736002)(486006)(14454004)(256004)(106356001)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6150; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: XjUxmaFd/nk/lp+AvrhVrZ4S8vtuKKMdAa6uL2MeLEXvVkHbMDpdjv1Ufy88JMkdJfiEa0rgpHM2HeH/dyam9Iro1rnQVnHfbCKWSN7P7QdjY3uRLW+w3C9mVexJVgtd4DQGuroiSGVP2vN1LWH8TniQgX7bRssrgZ/EXaMRtplEvhCNbnp52e32/HR5J0VCC6ZPaJqGltwJyFT10o+MfEJypGALhW0vkWL4O13JKR0I6DFok8CK37oCse12q3cKaBl9pKf17GoHbjGfe7hT4l2Zesk5i7CZn7XlpaWrFiQHN6T3ucdPaLGN7cjWODhcCQLA1+yqvF8V2BCxNidjnpAmgA1fbAVl+sFPezndwHnVKciO11q16rsTKg2sU8Jenri5pRqiIORoL1k1Y95sTyn8JMjC8T0vpNW9XAijb/g= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a549a305-a584-4795-aeec-08d6a6049016 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:33:05.9238 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6150 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_093309_860819_888E273C X-CRM114-Status: GOOD ( 18.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang Add PCIe Gen4 controller DT bindings of NXP Layerscape SoCs. Signed-off-by: Hou Zhiqiang --- V4: - no change .../bindings/pci/layerscape-pci-gen4.txt | 52 +++++++++++++++++++ MAINTAINERS | 8 +++ 2 files changed, 60 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/layerscape-pci-gen4.txt diff --git a/Documentation/devicetree/bindings/pci/layerscape-pci-gen4.txt b/Documentation/devicetree/bindings/pci/layerscape-pci-gen4.txt new file mode 100644 index 000000000000..b40fb5d15d3d --- /dev/null +++ b/Documentation/devicetree/bindings/pci/layerscape-pci-gen4.txt @@ -0,0 +1,52 @@ +NXP Layerscape PCIe Gen4 controller + +This PCIe controller is based on the Mobiveil PCIe IP and thus inherits all +the common properties defined in mobiveil-pcie.txt. + +Required properties: +- compatible: should contain the platform identifier such as: + "fsl,lx2160a-pcie" +- reg: base addresses and lengths of the PCIe controller register blocks. + "csr_axi_slave": Bridge config registers + "config_axi_slave": PCIe controller registers +- interrupts: A list of interrupt outputs of the controller. Must contain an + entry for each entry in the interrupt-names property. +- interrupt-names: It could include the following entries: + "intr": The interrupt that is asserted for controller interrupts + "aer": Asserted for aer interrupt when chip support the aer interrupt with + none MSI/MSI-X/INTx mode,but there is interrupt line for aer. + "pme": Asserted for pme interrupt when chip support the pme interrupt with + none MSI/MSI-X/INTx mode,but there is interrupt line for pme. +- dma-coherent: Indicates that the hardware IP block can ensure the coherency + of the data transferred from/to the IP block. This can avoid the software + cache flush/invalid actions, and improve the performance significantly. +- msi-parent : See the generic MSI binding described in + Documentation/devicetree/bindings/interrupt-controller/msi.txt. + +Example: + + pcie@3400000 { + compatible = "fsl,lx2160a-pcie"; + reg = <0x00 0x03400000 0x0 0x00100000 /* controller registers */ + 0x80 0x00000000 0x0 0x00001000>; /* configuration space */ + reg-names = "csr_axi_slave", "config_axi_slave"; + interrupts = , /* AER interrupt */ + , /* PME interrupt */ + ; /* controller interrupt */ + interrupt-names = "aer", "pme", "intr"; + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + apio-wins = <8>; + ppio-wins = <8>; + dma-coherent; + bus-range = <0x0 0xff>; + msi-parent = <&its>; + ranges = <0x82000000 0x0 0x40000000 0x80 0x40000000 0x0 0x40000000>; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0000 0 0 1 &gic 0 0 GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 2 &gic 0 0 GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 3 &gic 0 0 GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 4 &gic 0 0 GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 1013e74b14f2..2d18c7213991 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11835,6 +11835,14 @@ L: linux-arm-kernel@lists.infradead.org S: Maintained F: drivers/pci/controller/dwc/*layerscape* +PCI DRIVER FOR NXP LAYERSCAPE GEN4 CONTROLLER +M: Hou Zhiqiang +L: linux-pci@vger.kernel.org +L: linux-arm-kernel@lists.infradead.org +S: Maintained +F: Documentation/devicetree/bindings/pci/layerscape-pci-gen4.txt +F: drivers/pci/controller/mobibeil/pci-layerscape-gen4.c + PCI DRIVER FOR GENERIC OF HOSTS M: Will Deacon L: linux-pci@vger.kernel.org From patchwork Mon Mar 11 09:33:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847227 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5094E139A for ; Mon, 11 Mar 2019 10:31:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3709829056 for ; Mon, 11 Mar 2019 10:31:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B4BA28DD5; Mon, 11 Mar 2019 10:31:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1A13429056 for ; Mon, 11 Mar 2019 10:31:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-ID:In-Reply-To: References:Message-ID:Date:Subject:To:From:Reply-To:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iGj5X5H5o3L7BgkDOJlFKaofqu48b624WR9nk+wZcNI=; b=BjgEg8L5WeKldX cb9FfEz2QwLTK3tk078WvgqwsznngjlwDcmz9XO6h10tFdRKleleM3CfQEx/WcWi04MCn+yC0kaQI uIbyK7EBnu50zTV4nXRvSkR1vLahuDmnJaHfQvCSA/NO7owkUhWOrQBUdbXM0Ac5H+2dANTommy9C W8XM7mujZJGdYOVuNwumZfwYDk5Yk7EGBIB70Yghv76mclpFC+SkCMAJiEfX6FHX146YMttMBUA6X j0956BElLvaC81jP/DcVekezpviKogIwtT+zZOAvAOabQjwusn997UTMNS34VbLZtmwq4lJLb2xZ3 CYtmIU3EePTNl/LdquiA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3ICx-0007Mq-Bv; Mon, 11 Mar 2019 10:30:59 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3ICu-0007Mk-V7 for linux-arm-kernel@bombadil.infradead.org; Mon, 11 Mar 2019 10:30:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=MIME-Version:Content-Transfer-Encoding: Content-ID:Content-Type:In-Reply-To:References:Message-ID:Date:Subject:CC:To: From:Sender:Reply-To:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KlvgI4vjWrXN3wTH/unQCDqQ0Jb+0CLzhWG3W/Se6ws=; b=MSik9hxVyw44I+lTYrndpXCoVN XMudB/0t2HzRRYOdoPr+QmEkKwh0y3nkznfRyik4brJB6Q3GvdofNksJD+JGFQP11GbI+ocMNhG6P sEJXhtwyMHWGWU/eVCs5j/KD1K4Mf80d+evrVWcfQglOj1BQhaZ15oruEujcU+YqbRhTsnRg7mb4T gjNgckh7WozqZVvbIGOLQCsTRMgDExOt45moVjda/JtWL74e94IBl0wmIeT8yY4YElVQM31zbJmE/ gp9EGpdTAlw/Ee0rXWDqbcH1xiKxdIeIhvD3xtpqvoAfbZ+YdTFnfDYcmDELUaorA/B4fke/rTvkQ /NHGz7NQ==; Received: from mail-eopbgr150072.outbound.protection.outlook.com ([40.107.15.72] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HJs-0008QK-Lp for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:34:07 +0000 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=KlvgI4vjWrXN3wTH/unQCDqQ0Jb+0CLzhWG3W/Se6ws=; b=P0Snu7l/N9HonZVxglDivCtR2c9FfhkNik83j0ESmU2IytVegHktw1u0xQ7WwDNP/z3GW9KJSoPDWN2fkcz5OgrlJKS/0Jh38wZc0DWw4+xXc0JnGkjNSVN+ffY2TKopyPNxQ8PXsOe0Mi4Thg/Xjg4Jcgg3PZBM6mymv0dVtLA= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB4168.eurprd04.prod.outlook.com (52.135.168.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.20; Mon, 11 Mar 2019 09:33:16 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:33:16 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 24/28] PCI: mobiveil: add PCIe Gen4 RC driver for NXP Layerscape SoCs Thread-Topic: [PATCHv4 24/28] PCI: mobiveil: add PCIe Gen4 RC driver for NXP Layerscape SoCs Thread-Index: AQHU1+10ahUatRnHHkyEO3RvMSNYKQ== Date: Mon, 11 Mar 2019 09:33:16 +0000 Message-ID: <20190311093130.7209-25-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6fb97a9c-f462-43c0-327e-08d6a604962c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB4168; x-ms-traffictypediagnostic: AM6PR04MB4168: x-microsoft-exchange-diagnostics: =?utf-8?q?1=3BAM6PR04MB4168=3B23=3AA6PbTtx?= =?utf-8?q?+NnD2In4P2CvQ0fsYEaxbQ+WoGot0Lwz/tUovL3UyDs9qYeF2/J180f4xCJU3OyKa?= =?utf-8?q?Dxuoxv1t1iWjAR5unZ5GbFYAuEOsYRHFi5bI3OnBk2pAYDpz2mjH0mkvp6lvJsJef?= =?utf-8?q?vipZD8FO0LCf/+ZLyHBP1heIngihUjC6TlR53AMGCC49WN2lQ7Uw4A2gfB1FfOd08?= =?utf-8?q?kqRXxMPIor1ALSZxhFmxvktf8OemaF/hlrZFfCO4YtyprXAIfI8YUPUgM3ug+LysB?= =?utf-8?q?v2DN/YncyG0wtpcYPk+k8b/t9mS8Nc/sAfwefmA2ni10evBtAWnaIvTKDKdyDRF8t?= =?utf-8?q?eCUtvWzCPzH2Lu3ksn7BtXpl0wHXDN5PdFN9vRyRAOBdj6JWr4mAkE4maMoiImE5i?= =?utf-8?q?hYvUoYQZ/WDYgWEFlBnz8z9mM20bhnstpDMfaVENm1/sD4Ww9/jAeuV119k2paui0?= =?utf-8?q?KOOPSlQrN2CtGWK6taAZcUDvHI7pFg9shoTXdQjK4C+9KJvoEtWGLk9KU4BqRkBKC?= =?utf-8?q?KfSuX12xP2hm2RA5uUNgCeVTqgsyiPGVyXDpt2aZAIXHpc1fo5Cc3gZ9kBknkdjz0?= =?utf-8?q?O168y88VDYuzURUz1Y8Kgjz+JJ4JWlc2LXwpxsEjvTnm1RTZi8SUZKKGQ3R4ygslO?= =?utf-8?q?gEcYAC9jLGojxTS8lXzEudPRMC7QrHr2wbedE+E0Oy07GA4724yd4eIT7lDUaE55X?= =?utf-8?q?hgaYfTjriyJeC/uF4YwUhakBKSiWD2szJ/3Ri5kahXZXb38fPE5j9HMnTeZcGkomA?= =?utf-8?q?diUolH7SVEo1i7494AFG4oeNJkG+jk+YytvVEDkA5GeuKxOxX8Zl/YKYiTUvdo5wv?= =?utf-8?q?kXvwDydGtvRpAAaIBX+F9oFzH4iG9M2a0Gf44+IQJkwJZtiquuGVoW7nLUmEWXuPH?= =?utf-8?q?qromue0mqasT8Hjp9OXH8+GxWv6QVRf8anNNRfzhAeRhcwJZpyOJRdW9D30qkkp7z?= =?utf-8?q?bBrPXhcL8614r92Y9luqnxthl9PvlP8qjz22wiTV3T4XIF09jSqOC4Wnflv8ooTyf?= =?utf-8?q?8GVwxk7XOgFu5r0YLUwvlZq6qPsvUA+DImiW3oDSnM9A/iei4kIXUYHOaxY8JMHHz?= =?utf-8?q?j4vKv0naF7/UWdyHA7HNWHl+w2LtTdGqtSKarf7+5tptMeztjsVxKxfh3yETIpGev?= =?utf-8?q?WIYpo2yNLWFlzt7Ov5biE98vOzTVgvPlPu9V7T65GhYtJwu6r7x0ONfd9BfwxAu8c?= =?utf-8?q?IVROH4TiCgkomYuQFYsYFbIq5ut65UBpBFm1Q/Y4DcKaQ42FE0NFwvdBGodxAoDgK?= =?utf-8?q?EPgrbLRHG05aMI/6gpbqz2o7dz6FO+pQEHvx/?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6029001)(39860400002)(396003)(136003)(376002)(366004)(346002)(189003)(199004)(106356001)(476003)(446003)(6512007)(105586002)(7736002)(486006)(11346002)(14444005)(305945005)(256004)(6486002)(2906002)(25786009)(54906003)(6116002)(110136005)(3846002)(71200400001)(2616005)(2201001)(86362001)(4326008)(71190400001)(68736007)(102836004)(5660300002)(81156014)(36756003)(2501003)(7416002)(6506007)(386003)(6436002)(97736004)(53936002)(316002)(186003)(26005)(76176011)(14454004)(8676002)(8936002)(52116002)(478600001)(1076003)(99286004)(50226002)(66066001)(81166006)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB4168; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: pDqRgHRUrvI+w9HtjErGdG2H3vowkoxuZha/OVzLMPv9NvfeT8P+2AAxsxkYTCCx1CD7XeYNifWEUn1Aji7PIQn2hI0a8gAtKZIpkRKA70WI7qCL8/HOhF4ttkZueAm6YdbiRc2AuxNwd22gu4V/vCQsLyyWyFsPYHehADpz7Tn3XhojY3ymaw7dhBE4kmrZ7R1II/j2UYdO4OTI1aiHpUshn4JWYZJeL8YdxOElfTdnStC+3ss9IGKQJyGWALhLpQV3U4jQQAIXSS4T9Y9m39Qh8LCifLvWZMXttdKItL9E8tXtMp2xn/WwqbrS8Kd18F7GNMm45NC3EqVMtDIoJeF6R7R5m5XOjmCfaOBl3W8N0z77YiWKKptpo6y+fJcE8I42auU1w9/sn8pAdeQjmUrBKBvXqeWuN3yN4Ng+e3k= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6fb97a9c-f462-43c0-327e-08d6a604962c X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:33:16.3433 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB4168 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_053404_938512_912A6E9E X-CRM114-Status: GOOD ( 21.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang This PCIe controller is based on the Mobiveil GPEX IP, which is compatible with the PCI Expressâ„¢ Base Specification, Revision 4.0. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian --- V4: - no change drivers/pci/controller/mobiveil/Kconfig | 10 + drivers/pci/controller/mobiveil/Makefile | 1 + .../controller/mobiveil/pci-layerscape-gen4.c | 254 ++++++++++++++++++ .../pci/controller/mobiveil/pcie-mobiveil.h | 16 +- 4 files changed, 279 insertions(+), 2 deletions(-) create mode 100644 drivers/pci/controller/mobiveil/pci-layerscape-gen4.c diff --git a/drivers/pci/controller/mobiveil/Kconfig b/drivers/pci/controller/mobiveil/Kconfig index 64343c07bfed..3ddb7d6163a9 100644 --- a/drivers/pci/controller/mobiveil/Kconfig +++ b/drivers/pci/controller/mobiveil/Kconfig @@ -21,4 +21,14 @@ config PCIE_MOBIVEIL_PLAT Soft IP. It has up to 8 outbound and inbound windows for address translation and it is a PCIe Gen4 IP. +config PCI_LAYERSCAPE_GEN4 + bool "Freescale Layerscpe PCIe Gen4 controller" + depends on PCI + depends on OF && (ARM64 || ARCH_LAYERSCAPE) + depends on PCI_MSI_IRQ_DOMAIN + select PCIE_MOBIVEIL_HOST + help + Say Y here if you want PCIe Gen4 controller support on + Layerscape SoCs. The PCIe controller can work in RC or + EP mode according to RCW[HOST_AGT_PEX] setting. endmenu diff --git a/drivers/pci/controller/mobiveil/Makefile b/drivers/pci/controller/mobiveil/Makefile index 9fb6d1c6504d..ff66774ccac4 100644 --- a/drivers/pci/controller/mobiveil/Makefile +++ b/drivers/pci/controller/mobiveil/Makefile @@ -2,3 +2,4 @@ obj-$(CONFIG_PCIE_MOBIVEIL) += pcie-mobiveil.o obj-$(CONFIG_PCIE_MOBIVEIL_HOST) += pcie-mobiveil-host.o obj-$(CONFIG_PCIE_MOBIVEIL_PLAT) += pcie-mobiveil-plat.o +obj-$(CONFIG_PCI_LAYERSCAPE_GEN4) += pci-layerscape-gen4.o diff --git a/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c b/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c new file mode 100644 index 000000000000..174cbcac4059 --- /dev/null +++ b/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c @@ -0,0 +1,254 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * PCIe host controller driver for NXP Layerscape SoCs + * + * Copyright 2018 NXP + * + * Author: Zhiqiang Hou + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pcie-mobiveil.h" + +/* LUT and PF control registers */ +#define PCIE_LUT_OFF (0x80000) +#define PCIE_PF_OFF (0xc0000) +#define PCIE_PF_INT_STAT (0x18) +#define PF_INT_STAT_PABRST (31) + +#define PCIE_PF_DBG (0x7fc) +#define PF_DBG_LTSSM_MASK (0x3f) +#define PF_DBG_WE (31) +#define PF_DBG_PABR (27) + +#define LS_PCIE_G4_LTSSM_L0 0x2d /* L0 state */ + +#define to_ls_pcie_g4(x) platform_get_drvdata((x)->pdev) + +struct ls_pcie_g4 { + struct mobiveil_pcie *pci; + struct delayed_work dwork; + int irq; +}; + +static inline u32 ls_pcie_g4_lut_readl(struct ls_pcie_g4 *pcie, u32 off) +{ + return ioread32(pcie->pci->csr_axi_slave_base + PCIE_LUT_OFF + off); +} + +static inline void ls_pcie_g4_lut_writel(struct ls_pcie_g4 *pcie, + u32 off, u32 val) +{ + iowrite32(val, pcie->pci->csr_axi_slave_base + PCIE_LUT_OFF + off); +} + +static inline u32 ls_pcie_g4_pf_readl(struct ls_pcie_g4 *pcie, u32 off) +{ + return ioread32(pcie->pci->csr_axi_slave_base + PCIE_PF_OFF + off); +} + +static inline void ls_pcie_g4_pf_writel(struct ls_pcie_g4 *pcie, + u32 off, u32 val) +{ + iowrite32(val, pcie->pci->csr_axi_slave_base + PCIE_PF_OFF + off); +} + +static bool ls_pcie_g4_is_bridge(struct ls_pcie_g4 *pcie) +{ + struct mobiveil_pcie *mv_pci = pcie->pci; + u32 header_type; + + header_type = csr_readb(mv_pci, PCI_HEADER_TYPE); + header_type &= 0x7f; + + return header_type == PCI_HEADER_TYPE_BRIDGE; +} + +static int ls_pcie_g4_link_up(struct mobiveil_pcie *pci) +{ + struct ls_pcie_g4 *pcie = to_ls_pcie_g4(pci); + u32 state; + + state = ls_pcie_g4_pf_readl(pcie, PCIE_PF_DBG); + state = state & PF_DBG_LTSSM_MASK; + + if (state == LS_PCIE_G4_LTSSM_L0) + return 1; + + return 0; +} + +static void ls_pcie_g4_reinit_hw(struct ls_pcie_g4 *pcie) +{ + struct mobiveil_pcie *mv_pci = pcie->pci; + u32 val, act_stat; + int to = 100; + + /* Poll for pab_csb_reset to set and PAB activity to clear */ + do { + usleep_range(10, 15); + val = ls_pcie_g4_pf_readl(pcie, PCIE_PF_INT_STAT); + act_stat = csr_readl(mv_pci, PAB_ACTIVITY_STAT); + } while (((val & 1 << PF_INT_STAT_PABRST) == 0 || act_stat) && to--); + if (to < 0) { + dev_err(&mv_pci->pdev->dev, "poll PABRST&PABACT timeout\n"); + return; + } + + /* clear PEX_RESET bit in PEX_PF0_DBG register */ + val = ls_pcie_g4_pf_readl(pcie, PCIE_PF_DBG); + val |= 1 << PF_DBG_WE; + ls_pcie_g4_pf_writel(pcie, PCIE_PF_DBG, val); + + val = ls_pcie_g4_pf_readl(pcie, PCIE_PF_DBG); + val |= 1 << PF_DBG_PABR; + ls_pcie_g4_pf_writel(pcie, PCIE_PF_DBG, val); + + val = ls_pcie_g4_pf_readl(pcie, PCIE_PF_DBG); + val &= ~(1 << PF_DBG_WE); + ls_pcie_g4_pf_writel(pcie, PCIE_PF_DBG, val); + + mobiveil_host_init(mv_pci, true); + + to = 100; + while (!ls_pcie_g4_link_up(mv_pci) && to--) + usleep_range(200, 250); + if (to < 0) + dev_err(&mv_pci->pdev->dev, "PCIe link trainning timeout\n"); +} + +static irqreturn_t ls_pcie_g4_handler(int irq, void *dev_id) +{ + struct ls_pcie_g4 *pcie = (struct ls_pcie_g4 *)dev_id; + struct mobiveil_pcie *mv_pci = pcie->pci; + u32 val; + + val = csr_readl(mv_pci, PAB_INTP_AMBA_MISC_STAT); + if (!val) + return IRQ_NONE; + + if (val & PAB_INTP_RESET) + schedule_delayed_work(&pcie->dwork, msecs_to_jiffies(1)); + + csr_writel(mv_pci, val, PAB_INTP_AMBA_MISC_STAT); + + return IRQ_HANDLED; +} + +static int ls_pcie_g4_interrupt_init(struct mobiveil_pcie *mv_pci) +{ + struct ls_pcie_g4 *pcie = to_ls_pcie_g4(mv_pci); + u32 val; + int ret; + + pcie->irq = platform_get_irq_byname(mv_pci->pdev, "intr"); + if (pcie->irq < 0) { + dev_err(&mv_pci->pdev->dev, "Can't get 'intr' irq.\n"); + return pcie->irq; + } + ret = devm_request_irq(&mv_pci->pdev->dev, pcie->irq, + ls_pcie_g4_handler, IRQF_SHARED, + mv_pci->pdev->name, pcie); + if (ret) { + dev_err(&mv_pci->pdev->dev, "Can't register PCIe IRQ.\n"); + return ret; + } + + /* Enable interrupts */ + val = PAB_INTP_INTX_MASK | PAB_INTP_MSI | PAB_INTP_RESET | + PAB_INTP_PCIE_UE | PAB_INTP_IE_PMREDI | PAB_INTP_IE_EC; + csr_writel(mv_pci, val, PAB_INTP_AMBA_MISC_ENB); + + return 0; +} + +static void ls_pcie_g4_reset(struct work_struct *work) +{ + struct delayed_work *dwork = container_of(work, struct delayed_work, + work); + struct ls_pcie_g4 *pcie = container_of(dwork, struct ls_pcie_g4, dwork); + struct mobiveil_pcie *mv_pci = pcie->pci; + u16 ctrl; + + ctrl = csr_readw(mv_pci, PCI_BRIDGE_CONTROL); + ctrl &= ~PCI_BRIDGE_CTL_BUS_RESET; + csr_writew(mv_pci, ctrl, PCI_BRIDGE_CONTROL); + ls_pcie_g4_reinit_hw(pcie); +} + +static struct mobiveil_rp_ops ls_pcie_g4_rp_ops = { + .interrupt_init = ls_pcie_g4_interrupt_init, +}; + +static const struct mobiveil_pab_ops ls_pcie_g4_pab_ops = { + .link_up = ls_pcie_g4_link_up, +}; + +static int __init ls_pcie_g4_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct mobiveil_pcie *mv_pci; + struct ls_pcie_g4 *pcie; + struct device_node *np = dev->of_node; + int ret; + + if (!of_parse_phandle(np, "msi-parent", 0)) { + dev_err(dev, "failed to find msi-parent\n"); + return -EINVAL; + } + + pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL); + if (!pcie) + return -ENOMEM; + + mv_pci = devm_kzalloc(dev, sizeof(*mv_pci), GFP_KERNEL); + if (!mv_pci) + return -ENOMEM; + + mv_pci->pdev = pdev; + mv_pci->ops = &ls_pcie_g4_pab_ops; + mv_pci->rp.ops = &ls_pcie_g4_rp_ops; + pcie->pci = mv_pci; + + platform_set_drvdata(pdev, pcie); + + INIT_DELAYED_WORK(&pcie->dwork, ls_pcie_g4_reset); + + ret = mobiveil_pcie_host_probe(mv_pci); + if (ret) { + dev_err(dev, "fail to probe!\n"); + return ret; + } + + if (!ls_pcie_g4_is_bridge(pcie)) + return -ENODEV; + + return 0; +} + +static const struct of_device_id ls_pcie_g4_of_match[] = { + { .compatible = "fsl,lx2160a-pcie", }, + { }, +}; + +static struct platform_driver ls_pcie_g4_driver = { + .driver = { + .name = "layerscape-pcie-gen4", + .of_match_table = ls_pcie_g4_of_match, + .suppress_bind_attrs = true, + }, +}; + +builtin_platform_driver_probe(ls_pcie_g4_driver, ls_pcie_g4_probe); diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h index 0f5303962e88..0ccd6cee5f8f 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h @@ -41,6 +41,8 @@ #define PAGE_LO_MASK 0x3ff #define PAGE_SEL_OFFSET_SHIFT 10 +#define PAB_ACTIVITY_STAT 0x81c + #define PAB_AXI_PIO_CTRL 0x0840 #define APIO_EN_MASK 0xf @@ -49,8 +51,18 @@ #define PAB_INTP_AMBA_MISC_ENB 0x0b0c #define PAB_INTP_AMBA_MISC_STAT 0x0b1c -#define PAB_INTP_INTX_MASK 0x01e0 -#define PAB_INTP_MSI_MASK 0x8 +#define PAB_INTP_RESET (0x1 << 1) +#define PAB_INTP_MSI (0x1 << 3) +#define PAB_INTP_INTA (0x1 << 5) +#define PAB_INTP_INTB (0x1 << 6) +#define PAB_INTP_INTC (0x1 << 7) +#define PAB_INTP_INTD (0x1 << 8) +#define PAB_INTP_PCIE_UE (0x1 << 9) +#define PAB_INTP_IE_PMREDI (0x1 << 29) +#define PAB_INTP_IE_EC (0x1 << 30) +#define PAB_INTP_MSI_MASK PAB_INTP_MSI +#define PAB_INTP_INTX_MASK (PAB_INTP_INTA | PAB_INTP_INTB |\ + PAB_INTP_INTC | PAB_INTP_INTD) #define PAB_AXI_AMAP_CTRL(win) PAB_REG_ADDR(0x0ba0, win) #define WIN_ENABLE_SHIFT 0 From patchwork Mon Mar 11 09:33:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847109 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9BB7817DF for ; Mon, 11 Mar 2019 09:34:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8222628D57 for ; Mon, 11 Mar 2019 09:34:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7608F28E19; Mon, 11 Mar 2019 09:34:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EACA928D57 for ; Mon, 11 Mar 2019 09:34:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0i+kjvFXIDoTeErCYSx1vTTxTcraeDfFAUpEVSKqhaQ=; b=PdS/96onfy2EIh JsaiwhprFDhAuwvOFr5lGEGtld7eQYL7KM6SpbkltZwG2NF2losTIb+9bd5YVHgI6nUaJT48wK4LU VqatB6ht+g70lxAamxMlmXo04KnFHwCxOOhy1PhiQ8xjHJt9LHxHhOc6suljoYkUzSHapCYtNi4hQ RoZj0c7QsrEV41zR7RxPIk1LwiyjMmFJrgumQTUjifFl1WLOXrbeETo2tYGS9hj1clnN+c4uGdhA+ a/+35g5AgjO5TFIpktazeU71gT+voqbN3uEOJJy5aOqiC6Tih0FOCiD3JhKe91GBbZAPn3NQFCMEa PfQ1p5eXWUJUm2UpOpnw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HJw-0004p1-Pn; Mon, 11 Mar 2019 09:34:08 +0000 Received: from mail-eopbgr70088.outbound.protection.outlook.com ([40.107.7.88] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HJG-0003wT-Ck for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:33:59 +0000 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=BCujfAVAR0+e0LhiMltBI07/ARcHfZEoOLM2FMrtt3I=; b=dzhZM+vsJjE3OSJsMLuDaa7U+wbSdmM9WEpF3EGD3GTL09do6kVNidt20Djc0hEeEWl+TMsiBYtEhP9nlaTcz584qqZxOhwysPvnytgLdH0Z+yeUwAxchFqzf2ALltQJNmMrEWK+QTkOlGBoTDNkknK6UB2ZGla1U/isTfjuS/Y= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6150.eurprd04.prod.outlook.com (20.179.6.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Mon, 11 Mar 2019 09:33:23 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:33:23 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 25/28] PCI: mobiveil: ls_pcie_g4: add Workaround for A-011577 Thread-Topic: [PATCHv4 25/28] PCI: mobiveil: ls_pcie_g4: add Workaround for A-011577 Thread-Index: AQHU1+14+TCeS3tabUCUvLQeJSezBA== Date: Mon, 11 Mar 2019 09:33:23 +0000 Message-ID: <20190311093130.7209-26-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d4743724-3a80-421c-aa65-08d6a6049ad7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6150; x-ms-traffictypediagnostic: AM6PR04MB6150: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6150; 23:uSlOiEeHCDzmfSZPbNkuQRUu4o+sI23MPIft6rn?= =?iso-8859-1?q?LrE0XnGv0DMOV6n?= =?iso-8859-1?q?0q84sjBQ7nnd+VReCRMZN6D1u8Xj03Sl5Ojjl1jsR+AYjH2OnECtBDy6F1u9?= =?iso-8859-1?q?iNdlN5jRDN3ccXootFe88DQFu7YsCMyP+dVUxOB7K1e9DxaDKOQQ+iUqG+X6?= =?iso-8859-1?q?uCboznRrsRTGTADVjXTxsTCmIfwduwt1TJdNMp2oTEAm2Y/96Uqb3CCgEk0O?= =?iso-8859-1?q?AQRREKVr2MVnOXHrqIrEU7HV+sAVoG8cohkA+gNaZLRoG0gzYBBdg9ahqMjG?= =?iso-8859-1?q?TTLWQ4/PTEIf6H+0KLNhCZ+RXv9oizpfzekF9mDiLHPRNIrP8P02m7IhR7xc?= =?iso-8859-1?q?0BcvO1SLCOdLONdU5W6oS63u0DQ9F4LrckoMos1VE69hkGOK5Zz1H3fzCnnk?= =?iso-8859-1?q?1qcN5jiEO7L7Lhoe/2NliUuaEs8glEWuh2XXq8FmVo2RIVTMdqCbFwvQSqxX?= =?iso-8859-1?q?MlT8NfzjtDItJUXfv3wcDJm2zrlQGCJCLYHjGUHWPbU4kbxR4+p7r06vlp+H?= =?iso-8859-1?q?yI9KKOxPOTH9ekNVYdpDPq7ZgGEtV2KZ88igyc1e1O0EiZGYUqGpjxS2V39a?= =?iso-8859-1?q?uoQscjctVmlCnYhHR3CwfBYcORwzKvTIE3+ylOk+QUPxNHM86Bf8bWrcU8HV?= =?iso-8859-1?q?MI4E/d0AW3vo9G/RMP0ubZ/qy9E/Ht+InojP3ebsfCEQPK3NPn/zTXfQOPFY?= =?iso-8859-1?q?gsrnN5sy9iH3CY2ktvcfIR8HiqfrP7NQMp6d6tNG3G17YZgOcHihOeZmjjZ2?= =?iso-8859-1?q?ir8W2xF3Dr4It0nXrTn+hyUultJs+fsAwaznV2OSy0w9q09LONS+c+85UhZY?= =?iso-8859-1?q?q4jp2WJd9BfnYu4oILdoTNjKjXGjxV3Ga7gAUJaQBBow4d3qosHFhWkE6Ah0?= =?iso-8859-1?q?PNyp09ecZXnoNVtxHIiondKMJ1Mz/kuVU9oSv8HYhbU3E/K/OXdY9XQ1hBq9?= =?iso-8859-1?q?3uMheDc7rrg6+xFXaNhxPeG4PvWBpH0qoKh1jR5VZOPtnDRmOP0GsYj9Ofb5?= =?iso-8859-1?q?fzXVJFj884gnMFP59HKfrgSmv8MXeHxn6EmKWPCCqRezrqISXPuWsRCK37f9?= =?iso-8859-1?q?RaEFlJgyfwZ06gmggdiqP5hKAZaAkwQ5tTBPXe02aJi7K2PeJdGQK/X/uDpw?= =?iso-8859-1?q?XdUUviKDscfBOwBe/cTLF2zSIGx0M0JTbZ6Xw4RXwZOkYdxUfQAH5bPJj8nA?= =?iso-8859-1?q?CRFhe2xEZrIg9fQZostyWV7vb/84nUJTIrS71E3Xm3KVBeydFpQBr7l1CZ3n?= =?iso-8859-1?q?si6PCscSekcxciuiKrDuZxfgODaFLpiRpxyMK/HQobDECSHlYE3F44Vcqh7n?= =?iso-8859-1?q?txXcdyhCU=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(376002)(39860400002)(346002)(396003)(366004)(199004)(189003)(86362001)(54906003)(110136005)(6506007)(386003)(52116002)(99286004)(102836004)(316002)(4326008)(2201001)(50226002)(2501003)(97736004)(2906002)(66066001)(186003)(26005)(5660300002)(11346002)(76176011)(446003)(6486002)(36756003)(6436002)(25786009)(81166006)(81156014)(8676002)(478600001)(476003)(1076003)(7416002)(105586002)(305945005)(2616005)(71190400001)(71200400001)(3846002)(68736007)(6512007)(6116002)(8936002)(53936002)(7736002)(486006)(14454004)(14444005)(256004)(106356001)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6150; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: aeikiPdgOrm2uWNn3xczUhMbvEU83A0IRuN0DVmjjQgo8NJ0fGHOztTc8HWj67tTXW0zXU1FKpOe/+y3JO4lWHd/n7OoP5X9Q5yphcUyspwR4EOlqPMfoS48JXFHIpRxNrQMZ6hAW5m4GDxirmx0h1Xlhtw7iTP+EHOOY4iFU86QNq63j5FkhoSbFcXAflbvkaJROLSa6evrwTMwhdAOSoyngo1Ip5AypkqCDPowPAHs8AdII0d0RqLf5YDbkj+h2KGNZ9z6ka6KuAZBwtzOd0U5BmCYo0vcWWC5QaoG6jtYGUyprGwKsosVjBYXG+jCJNmf6RShCpUWYCz1uUuJ8ad+VbN0Klanhy3/BxI+3Uw+Nwna7JvfGhzZDP5jYMaZUe3vCZcfEhntq/aUHbkkkXWFYqEK/WvigNYj4AeKd5I= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4743724-3a80-421c-aa65-08d6a6049ad7 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:33:23.0541 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6150 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023327_028410_DC74D10F X-CRM114-Status: GOOD ( 15.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang PCIe configuration access to non-existent function triggered SERROR interrupt exception. Workaround: Disable error reporting on AXI bus during the Vendor ID read transactions in enumeration. This ERRATA is only for LX2160A Rev1.0, and it will be fixed in Rev2.0. Signed-off-by: Hou Zhiqiang --- V4: - no change .../controller/mobiveil/pci-layerscape-gen4.c | 37 +++++++++++++++++++ .../controller/mobiveil/pcie-mobiveil-host.c | 17 ++++++++- .../pci/controller/mobiveil/pcie-mobiveil.h | 3 ++ 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c b/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c index 174cbcac4059..d2c5dbbd5e3c 100644 --- a/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c +++ b/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c @@ -22,8 +22,13 @@ #include "pcie-mobiveil.h" +#define REV_1_0 (0x10) + /* LUT and PF control registers */ #define PCIE_LUT_OFF (0x80000) +#define PCIE_LUT_GCR (0x28) +#define PCIE_LUT_GCR_RRE (0) + #define PCIE_PF_OFF (0xc0000) #define PCIE_PF_INT_STAT (0x18) #define PF_INT_STAT_PABRST (31) @@ -41,6 +46,7 @@ struct ls_pcie_g4 { struct mobiveil_pcie *pci; struct delayed_work dwork; int irq; + u8 rev; }; static inline u32 ls_pcie_g4_lut_readl(struct ls_pcie_g4 *pcie, u32 off) @@ -76,6 +82,15 @@ static bool ls_pcie_g4_is_bridge(struct ls_pcie_g4 *pcie) return header_type == PCI_HEADER_TYPE_BRIDGE; } +static int ls_pcie_g4_host_init(struct mobiveil_pcie *pci) +{ + struct ls_pcie_g4 *pcie = to_ls_pcie_g4(pci); + + pcie->rev = csr_readb(pci, PCI_REVISION_ID); + + return 0; +} + static int ls_pcie_g4_link_up(struct mobiveil_pcie *pci) { struct ls_pcie_g4 *pcie = to_ls_pcie_g4(pci); @@ -188,12 +203,34 @@ static void ls_pcie_g4_reset(struct work_struct *work) ls_pcie_g4_reinit_hw(pcie); } +static int ls_pcie_g4_read_other_conf(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 *val) +{ + struct mobiveil_pcie *pci = bus->sysdata; + struct ls_pcie_g4 *pcie = to_ls_pcie_g4(pci); + int ret; + + if (pcie->rev == REV_1_0 && where == PCI_VENDOR_ID) + ls_pcie_g4_lut_writel(pcie, PCIE_LUT_GCR, + 0 << PCIE_LUT_GCR_RRE); + + ret = pci_generic_config_read(bus, devfn, where, size, val); + + if (pcie->rev == REV_1_0 && where == PCI_VENDOR_ID) + ls_pcie_g4_lut_writel(pcie, PCIE_LUT_GCR, + 1 << PCIE_LUT_GCR_RRE); + + return ret; +} + static struct mobiveil_rp_ops ls_pcie_g4_rp_ops = { .interrupt_init = ls_pcie_g4_interrupt_init, + .read_other_conf = ls_pcie_g4_read_other_conf, }; static const struct mobiveil_pab_ops ls_pcie_g4_pab_ops = { .link_up = ls_pcie_g4_link_up, + .host_init = ls_pcie_g4_host_init, }; static int __init ls_pcie_g4_probe(struct platform_device *pdev) diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c index e8d0c4989013..5f51bc2dd6d7 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c @@ -79,9 +79,20 @@ static void __iomem *mobiveil_pcie_map_bus(struct pci_bus *bus, return pcie->rp.config_axi_slave_base + where; } +static int mobiveil_pcie_config_read(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 *val) +{ + struct mobiveil_pcie *pcie = bus->sysdata; + struct root_port *rp = &pcie->rp; + + if (bus->number > rp->root_bus_nr && rp->ops->read_other_conf) + return rp->ops->read_other_conf(bus, devfn, where, size, val); + + return pci_generic_config_read(bus, devfn, where, size, val); +} static struct pci_ops mobiveil_pcie_ops = { .map_bus = mobiveil_pcie_map_bus, - .read = pci_generic_config_read, + .read = mobiveil_pcie_config_read, .write = pci_generic_config_write, }; @@ -309,6 +320,10 @@ int mobiveil_host_init(struct mobiveil_pcie *pcie, bool reinit) value |= (PCI_CLASS_BRIDGE_PCI << 16); csr_writel(pcie, value, PAB_INTP_AXI_PIO_CLASS); + /* Platform specific host init */ + if (pcie->ops->host_init) + return pcie->ops->host_init(pcie); + return 0; } diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h index 0ccd6cee5f8f..ab43de5e4b2b 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h @@ -145,6 +145,8 @@ struct mobiveil_msi { /* MSI information */ struct mobiveil_rp_ops { int (*interrupt_init)(struct mobiveil_pcie *pcie); + int (*read_other_conf)(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 *val); }; struct root_port { @@ -160,6 +162,7 @@ struct root_port { struct mobiveil_pab_ops { int (*link_up)(struct mobiveil_pcie *pcie); + int (*host_init)(struct mobiveil_pcie *pcie); }; struct mobiveil_pcie { From patchwork Mon Mar 11 09:33:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847163 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CAD3F14DE for ; Mon, 11 Mar 2019 09:49:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0103285F7 for ; Mon, 11 Mar 2019 09:49:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A45CC2888B; Mon, 11 Mar 2019 09:49:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 41851285F7 for ; Mon, 11 Mar 2019 09:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uoBOSUkya0Fs5ppdfFaYMqAJ18QQCRHRoZv+IytM1h4=; b=CaPXvYMlBxn+Il 2pX0NEbUIQoDhWfE4eof/RZZsAMbeB3bQBNjHDzR4JGThGuO3pxdxX0wuMLuBCD212mLyPOV9IUet VdCMFrQ72VjZoxoyd7MrMwa0pzXS0EnY1Cmcr/giJIDzc3yh+DdL45Ub7XBnOSSzjCqJt86k5jcCm 44OP8t95aM5b5pajKIEfaYmFjXH6nITc8Aybxxo/TP5U2uxYIpNZ5ajCS2dhVKuRHz1UsGqM/Tmxx aBBu81iqWWmyPErRRMT6lQsx42iaXav7FJw+8kWs/pg1eOk8ulU/140LR5Aif/PeiTtnoLDc2cPed 6nJglMddTFQphmwK5hGg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HYI-0005Eh-VW; Mon, 11 Mar 2019 09:48:58 +0000 Received: from mail-eopbgr70088.outbound.protection.outlook.com ([40.107.7.88] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HJn-0003wT-R4 for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:34:35 +0000 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=nLvJkSyJEgQwdB3bjsAFqxbk/Ck/q1vQGqz79i97C7Q=; b=c7yrVRe3m5e9MeLrLJ/e2wNUdl7skodIu5GebepqZff7pZctcHlwEyig3Sh2LjXLNqFFybojpqUyvauRdp5wUDtMoCu424Ijgpyf/CqWI6HxOCG0yNv1KuQBIMuLGykpg3pfhYDU6Ox2NpP5aSpKtu2xT46p1N7HtpdAswPLOTE= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6150.eurprd04.prod.outlook.com (20.179.6.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Mon, 11 Mar 2019 09:33:32 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:33:32 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 26/28] PCI: mobiveil: ls_pcie_g4: add Workaround for A-011451 Thread-Topic: [PATCHv4 26/28] PCI: mobiveil: ls_pcie_g4: add Workaround for A-011451 Thread-Index: AQHU1+1+Au0UBiXI7EyjDN9yTIIANA== Date: Mon, 11 Mar 2019 09:33:32 +0000 Message-ID: <20190311093130.7209-27-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 73ffcf20-f27f-4173-ee58-08d6a604a04b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6150; x-ms-traffictypediagnostic: AM6PR04MB6150: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6150; 23:EY5sy2vPsIXwcr4DE9RBaBbB3PSk0tGRCBxjTOd?= =?iso-8859-1?q?UOdG9JzMkrfdWPL?= =?iso-8859-1?q?wB6oYOBBHrU48fJcZfzybIqxb2TpiZ5NcpUsOQMGr4JrcAMvYpyjXkyhcSYZ?= =?iso-8859-1?q?gEa7Zk4mvB/kVvLGevm7f+6HXHqYbAUW46UbmsNwEFq6u/LQ/MKdUuVyfyXv?= =?iso-8859-1?q?xac9MnSn5FVF0KfPkb5GR+j+1XCQOOP1Bf/O87liiKXdE22JUi6fPly0+BZ1?= =?iso-8859-1?q?qAemzjWBdborBedQ7RkXIOnFI1SvNiXOMwz/WOpSTQ0GG4WfBo5jRSy+K8Ci?= =?iso-8859-1?q?vnnOg90lgceK2FZtTLeXH5kQzCH0OVRGMye29kb2KqAO779yk7bpH4TPZSmX?= =?iso-8859-1?q?ZiGvMK2DPF2Yl3mdB+i00us27wF7fLbwEWadEzlHtBeNFwXZvEpismVKpRei?= =?iso-8859-1?q?eJvG7Ng1fuQXsOl5aUN36w7DRcahUnjw1b4oBci5zpn219zX5guIK8tAX5EU?= =?iso-8859-1?q?VEiHZ4y05SDWpERJeo8+VDKx5S8gcNoxbHX8qiyrIEAv4w0NAnKiooASFwso?= =?iso-8859-1?q?jtr8hY7Lhy4JMRkjSn49ImOWnHpVsTglVNgwEhUCQmWpG81Kt+ICDwJknbBz?= =?iso-8859-1?q?veFXdTFyog5RfHH0rEElYz5FrYw4ZazpSGfDkmNo9iS3hutYimHsHwfXjKEb?= =?iso-8859-1?q?BLa84bfQ3ad2fpnFPtWQZp+ayZQ3iRHmH6GqdgmCJ/uODTfQhh+8XuD2wPKz?= =?iso-8859-1?q?xzujGXb9LIHeIWG+LvOs+8pUV9bSuCP7OT4jVP3y2oHhsovs+S9MC7txvSIR?= =?iso-8859-1?q?diA9y739D9PazcvPeOo0wfgkDEE9gXmxs+GaooJkR645rddmJg5zSoKhZHdC?= =?iso-8859-1?q?0Y9jqYOwJETyZZJv+X5i39oGuTAQmS9sZysW7yQUrM6nYv3aQ4HNl6fhNWXD?= =?iso-8859-1?q?Q9P2loUY6tpfSRetUCJLfbgLfNzl8KxDJMuPRf4a9uE3t+sHgB/SreHjk8R9?= =?iso-8859-1?q?CsA+rFcB1nx+MGQ5UjN7qIjapj5boF9B6+qMlysdyVgobqyeDlx/9C6WbWXe?= =?iso-8859-1?q?RPJ4oxE+/MZkEYYk6QjsT1JwTAZN0NN99Vle+p/ZTjo0n/cXxCTIy8QSVEqf?= =?iso-8859-1?q?K6nlVpSwk73FmMHsG44e4w9mG5vol2GUSLvb9CBY6ZJm16rwEWh64DxdGvo4?= =?iso-8859-1?q?+lu+c/FiXVJkWX/3ao9yv8p0Jd+Ble+PezAK+TzI9PNt7VAARVJalDkQ37d7?= =?iso-8859-1?q?+LodQL2FhUm/BT56Jtw5YVMAetsLgSXtneSe/HtC6pit1g3I0dlub5Q2kO03?= =?iso-8859-1?q?ogn8/SdGaHQx8PA/gphSQ+hINp2SX8m/ucztuu7LqAmlbrim9KMn5SYgAHtN?= =?iso-8859-1?q?wif3uwXOI=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(376002)(39860400002)(346002)(396003)(366004)(199004)(189003)(86362001)(54906003)(110136005)(6506007)(386003)(52116002)(99286004)(102836004)(316002)(4326008)(2201001)(50226002)(2501003)(97736004)(2906002)(66066001)(186003)(26005)(5660300002)(11346002)(76176011)(446003)(6486002)(36756003)(6436002)(25786009)(81166006)(81156014)(8676002)(478600001)(476003)(1076003)(7416002)(105586002)(305945005)(2616005)(71190400001)(71200400001)(3846002)(68736007)(6512007)(6116002)(8936002)(53936002)(7736002)(486006)(14454004)(14444005)(256004)(106356001)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6150; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: z0mPmf/7BZeKeIeeFBrej/Qv2bDJso0awLKYaIk/boeAT8hyEIkeRAG0iegwoorjRYaN19MZ3dtLd59h4vytHTyH7nQLd8SqIUWZlbZkXDdUFjfN0ICoVNvfH9QrLK8F8tjyG0Yi4xvSIqByYOQEsuhgQ/Kd6vHIu2qcPUhK4rLwgAbAfVU7Z/GKVqkkjqjNvoxJJtyALHyl6bdN+8FPauOeYclXP9r5XpFbM1TG0xf61ob69GZJs9nYCqYYZVo0NBuu5P7pgXrn6BWSC2GREp3bXsQ455pO8pWe7HU8mbQRBQ07DflaTLhL54DJiUvaSzwxtbh5nboXrMvnr3zAm9E/yU2GYrlu02L9TfYxPRCGadNl6RJxg73cSE3yoluLHSuyzBjdGVQ5ChdvDHuwi6CQhPuMp/mSgh6Rynw1mDo= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73ffcf20-f27f-4173-ee58-08d6a604a04b X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:33:32.2757 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6150 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023400_090807_DFF21A18 X-CRM114-Status: GOOD ( 13.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang When LX2 PCIe controller is sending multiple split completions and ACK latency expires indicating that ACK should be send at priority. But because of large number of split completions and FC update DLLP, the controller does not give priority to ACK transmission. This results into ACK latency timer timeout error at the link partner and the pending TLPs are replayed by the link partner again. Workaround: 1. Reduce the ACK latency timeout value to a very small value. 2. Restrict the number of completions from the LX2 PCIe controller to 1, by changing the Max Read Request Size (MRRS) of link partner to the same value as Max Packet size (MPS). This patch implemented part 1, the part 2 can be set by kernel parameter 'pci=pcie_bus_perf' This ERRATA is only for LX2160A Rev1.0, and it will be fixed in Rev2.0. Signed-off-by: Hou Zhiqiang --- V4: - no change .../pci/controller/mobiveil/pci-layerscape-gen4.c | 15 +++++++++++++++ drivers/pci/controller/mobiveil/pcie-mobiveil.h | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c b/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c index d2c5dbbd5e3c..20ce146788ca 100644 --- a/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c +++ b/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c @@ -82,12 +82,27 @@ static bool ls_pcie_g4_is_bridge(struct ls_pcie_g4 *pcie) return header_type == PCI_HEADER_TYPE_BRIDGE; } +static void workaround_A011451(struct ls_pcie_g4 *pcie) +{ + struct mobiveil_pcie *mv_pci = pcie->pci; + u32 val; + + /* Set ACK latency timeout */ + val = csr_readl(mv_pci, GPEX_ACK_REPLAY_TO); + val &= ~(ACK_LAT_TO_VAL_MASK << ACK_LAT_TO_VAL_SHIFT); + val |= (4 << ACK_LAT_TO_VAL_SHIFT); + csr_writel(mv_pci, val, GPEX_ACK_REPLAY_TO); +} + static int ls_pcie_g4_host_init(struct mobiveil_pcie *pci) { struct ls_pcie_g4 *pcie = to_ls_pcie_g4(pci); pcie->rev = csr_readb(pci, PCI_REVISION_ID); + if (pcie->rev == REV_1_0) + workaround_A011451(pcie); + return 0; } diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h index ab43de5e4b2b..f0e2e4ae09b5 100644 --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h @@ -85,6 +85,10 @@ #define PAB_AXI_AMAP_PEX_WIN_H(win) PAB_REG_ADDR(0x0bac, win) #define PAB_INTP_AXI_PIO_CLASS 0x474 +#define GPEX_ACK_REPLAY_TO 0x438 +#define ACK_LAT_TO_VAL_MASK 0x1fff +#define ACK_LAT_TO_VAL_SHIFT 0 + #define PAB_PEX_AMAP_CTRL(win) PAB_REG_ADDR(0x4ba0, win) #define AMAP_CTRL_EN_SHIFT 0 #define AMAP_CTRL_TYPE_SHIFT 1 From patchwork Mon Mar 11 09:33:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847115 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EFFD614DE for ; Mon, 11 Mar 2019 09:34:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D467C28F4B for ; Mon, 11 Mar 2019 09:34:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C696228FB5; Mon, 11 Mar 2019 09:34:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 101F128F4B for ; Mon, 11 Mar 2019 09:34:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RFwMayroIrQYOXUjXrrfvncfwWCnU+XfpSFfQ8c8DVo=; b=pGg4/s+4uRL+Uj CTE8Z51WC8c7dR6cPL4XyAagwloW3f4YKE57sKYEwREuC0515BM3N2o83xf+fxjSPp8kEzsT4pGsM GxZb4XWmEua3mE9QWJV9MV0mBlNT4SiqfRWy0HmACJyC7gR7sAq9mtfYE6itZsQfEATwRpeyMpv4s 9kUNWHA0kPgfS5dqdt7QraHxhkntK99l71SOqZfoGBf2SRaqTbURVvo5L8S0L53ibHhi1PjdcBNaT uRFmuHzCQICMs1JbCodv6aJ9pFa4qMeDJeMtxzFCk+9F/TCLjBQCj1Q/r7JgU4cQ/C0+lNbuqnkLc 0WOZEhkpF2yyrLbMlkdQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HKb-0005Si-Lv; Mon, 11 Mar 2019 09:34:49 +0000 Received: from mail-eopbgr20084.outbound.protection.outlook.com ([40.107.2.84] helo=EUR02-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HKO-0005Ov-3Z for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:34:48 +0000 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=wFq5S7SuaSi6j1HeK7buuJeG8wLjCiZSFq8eSwJLtys=; b=HHfr8uvcqMkUjS4MPLZgRkGYJpR+6iWk32aUMCg0vDkrpj68GqAMUrJVO7b9GSNFzmtLicUJHwUK4xj8PIKNCAMnt9gDag+xCM3nCdoLG4MX1xJ4rXFenKQoI6n+r+XgYSN2YeiduicPeTtgv01FsBVAKwZ99CQW29t425JeVXc= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6150.eurprd04.prod.outlook.com (20.179.6.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Mon, 11 Mar 2019 09:33:40 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:33:40 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 27/28] arm64: dts: freescale: lx2160a: add pcie DT nodes Thread-Topic: [PATCHv4 27/28] arm64: dts: freescale: lx2160a: add pcie DT nodes Thread-Index: AQHU1+2DZMvSNaCO8UigSIZD6qGo0g== Date: Mon, 11 Mar 2019 09:33:40 +0000 Message-ID: <20190311093130.7209-28-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8a7c29d3-37a5-417d-3e8f-08d6a604a516 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6150; x-ms-traffictypediagnostic: AM6PR04MB6150: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6150; 23:+PKeJXscydKLxTgh458P3ap8al0ofnWaplnuDqQ?= =?iso-8859-1?q?M/Rm2Hf1kI1O/ZJ?= =?iso-8859-1?q?aPN5tAsGDL9WZ9X4bskdouHUxUuliRHT+ZJuh92MDbEtJEev3vYovr6b3E2I?= =?iso-8859-1?q?mlRN9aji3oFYpvrDYifMGAHMjCkI6hRXmv+Z5mM5O0SNsx0umzHpFf+jKnKl?= =?iso-8859-1?q?4UASp9fN9w8TIDdQ7MjtyH9JtjqwNk0RCddmOMgEFTphjrmysm4kTmPOZ2Ub?= =?iso-8859-1?q?AvvIfGDDISIhTNDqUtHYuU95l7+zs1JPq0z79HogDCMWIfU475PXi4EPnq+J?= =?iso-8859-1?q?82Epvt1TK73lx5DtRIqxFr4zp8IYxtWk0+fNhUq1gjokIZzmCnXexxuVC3qz?= =?iso-8859-1?q?ikr1uagJWJmFlKFZIdCp7rHH6U5PU+vAUpEqUiBXUR0uFYL7/D2u1fwNIG02?= =?iso-8859-1?q?tmdEqB0acQaiRkQxqTFpSP3TvhxQkwMO3QwXm1rUqgQ2a+A4wrMMbXByhCS2?= =?iso-8859-1?q?4htKY2M/4lbpWAHoYeZ701A1PTiXs4JzUXoVN1U00y20j1dCyOv3z4qMkLTd?= =?iso-8859-1?q?LnEG+wSLdMRPVwbLm5FMgEa+kVUqbG+oH8XMnkvaZBzIBMZv/gwplVHedJ58?= =?iso-8859-1?q?ekQPv6/u8eJGLyW+DoDWbhqflXGTmeuuOFJJC29XqJ1bt0Xx/nkCks9rkEio?= =?iso-8859-1?q?Rvq30+WCthFYX//ZRsDmSurOYwkncY4n+ktHpIFeuCHGMJbiROb5lgdbbMq9?= =?iso-8859-1?q?W/hJh7i7NVbAIGA0L493kjduXF2cBOFS3R6RHIi2+nfX6z4pWJ3jMvnCihkM?= =?iso-8859-1?q?uxpGNVBYLY+p+2of7nzurVr67aRU/Zwj+7+5Dhgci2UsG4tpd8psLgiIVX5+?= =?iso-8859-1?q?AHABRbCTxWze/EqcH7SSqtNddDYcX6WO7hqd8d4s2V2w1CWzfKJ4J7qtXRTw?= =?iso-8859-1?q?PPmTDRJ3v8l4m45wcolay63rna3uX6rTTbQJOyG8j9hqfFmq0o39FpdEt0An?= =?iso-8859-1?q?HyGplCAgLe9inwbPlzzRKDk7zVaKD7Qs9s2Q/Errf/cal+k56VJQn2Tb0C+P?= =?iso-8859-1?q?DhecO1fAyp4GPhmTkntr1m69ql4NvXAS7mr2rSps8nXA/2vEBANpJL9MXiL0?= =?iso-8859-1?q?If9xaBp+wuc923qbh6joDuvi7g1/8Gfe+RrnfDxuewyVzXvh95fTSgDTfvnz?= =?iso-8859-1?q?lAOzCALccoMV+1M7OguOZiizIpd+BVsXKCLNbYksCc/5gp9ygMt5gdVgWtaV?= =?iso-8859-1?q?aD8eIHIuMEw7kDKHktdzpxwaELSQhOeY+D6yFJmDCgj9cbzCYf5xr/G2Ptl0?= =?iso-8859-1?q?6ydLs9thKGllQBAd0JW8WmDh+d/MjSK6jKnfohxfUl+2HG9jMYB+T7qeWdPB?= =?iso-8859-1?q?DBs2KcghY=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(376002)(39860400002)(346002)(396003)(366004)(199004)(189003)(86362001)(54906003)(110136005)(6506007)(386003)(52116002)(99286004)(102836004)(316002)(4326008)(2201001)(50226002)(2501003)(97736004)(2906002)(66066001)(186003)(26005)(5660300002)(11346002)(76176011)(446003)(6486002)(36756003)(6436002)(25786009)(81166006)(81156014)(8676002)(478600001)(476003)(1076003)(7416002)(105586002)(305945005)(2616005)(71190400001)(71200400001)(3846002)(68736007)(6512007)(6116002)(8936002)(53936002)(7736002)(486006)(14454004)(14444005)(256004)(106356001)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6150; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Eam34eUbrM0aUdLgcWoaaBw4gLHGcxbCum0e3jF0atbVNfUem71TIOVSiJ0+oq/IgjEa2kbH3+4hRHmBvjAeb4pkBFG8UGSUyg0iwPwawCxOAb5LE4QYi4iJoC6cW+/28dku9nmQjpRuDSbqEUL9z4ycBYb8Ih3YbHnwtSgspJbzuaHaP+D/zo5Db3HRKzKQWvcLU9fFKCpDQ3fgAyhrQquoTxMBmnD11y6YwFI1trjeeankiOKTvlpYxmglcozfgXocdyGas1pog28PJ3Glbzqr7E4q3hx0/2M72XUiNAyD5AQZ6p57RC9pgo3/O2AlC+DkOGGk2nFtgqOSX+gy2sfyrGgo6X4RFhloAe1Kb0ROdlgCJjYsfRS3pEO+1F0gkzx9lZE7UMKjsTJkkvg4rw3r38Knf2fK5uVaZvA6d5M= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a7c29d3-37a5-417d-3e8f-08d6a604a516 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:33:40.7047 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6150 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023436_300993_9887E335 X-CRM114-Status: UNSURE ( 9.34 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang The LX2160A integrated 6 PCIe Gen4 controllers. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian --- V4: - no change .../arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 163 ++++++++++++++++++ 1 file changed, 163 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi index fe87204850b5..3a64f6eb8ce9 100644 --- a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi @@ -895,5 +895,168 @@ }; }; }; + + pcie@3400000 { + compatible = "fsl,lx2160a-pcie"; + reg = <0x00 0x03400000 0x0 0x00100000 /* controller registers */ + 0x80 0x00000000 0x0 0x00001000>; /* configuration space */ + reg-names = "csr_axi_slave", "config_axi_slave"; + interrupts = , /* AER interrupt */ + , /* PME interrupt */ + ; /* controller interrupt */ + interrupt-names = "aer", "pme", "intr"; + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + dma-coherent; + apio-wins = <8>; + ppio-wins = <8>; + bus-range = <0x0 0xff>; + ranges = <0x82000000 0x0 0x40000000 0x80 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */ + msi-parent = <&its>; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0000 0 0 1 &gic 0 0 GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 2 &gic 0 0 GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 3 &gic 0 0 GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 4 &gic 0 0 GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + pcie@3500000 { + compatible = "fsl,lx2160a-pcie"; + reg = <0x00 0x03500000 0x0 0x00100000 /* controller registers */ + 0x88 0x00000000 0x0 0x00001000>; /* configuration space */ + reg-names = "csr_axi_slave", "config_axi_slave"; + interrupts = , /* AER interrupt */ + , /* PME interrupt */ + ; /* controller interrupt */ + interrupt-names = "aer", "pme", "intr"; + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + dma-coherent; + apio-wins = <8>; + ppio-wins = <8>; + bus-range = <0x0 0xff>; + ranges = <0x82000000 0x0 0x40000000 0x88 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */ + msi-parent = <&its>; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0000 0 0 1 &gic 0 0 GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 2 &gic 0 0 GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 3 &gic 0 0 GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 4 &gic 0 0 GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + pcie@3600000 { + compatible = "fsl,lx2160a-pcie"; + reg = <0x00 0x03600000 0x0 0x00100000 /* controller registers */ + 0x90 0x00000000 0x0 0x00001000>; /* configuration space */ + reg-names = "csr_axi_slave", "config_axi_slave"; + interrupts = , /* AER interrupt */ + , /* PME interrupt */ + ; /* controller interrupt */ + interrupt-names = "aer", "pme", "intr"; + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + dma-coherent; + apio-wins = <256>; + ppio-wins = <24>; + bus-range = <0x0 0xff>; + ranges = <0x82000000 0x0 0x40000000 0x90 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */ + msi-parent = <&its>; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0000 0 0 1 &gic 0 0 GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 2 &gic 0 0 GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 3 &gic 0 0 GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 4 &gic 0 0 GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + pcie@3700000 { + compatible = "fsl,lx2160a-pcie"; + reg = <0x00 0x03700000 0x0 0x00100000 /* controller registers */ + 0x98 0x00000000 0x0 0x00001000>; /* configuration space */ + reg-names = "csr_axi_slave", "config_axi_slave"; + interrupts = , /* AER interrupt */ + , /* PME interrupt */ + ; /* controller interrupt */ + interrupt-names = "aer", "pme", "intr"; + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + dma-coherent; + apio-wins = <8>; + ppio-wins = <8>; + bus-range = <0x0 0xff>; + ranges = <0x82000000 0x0 0x40000000 0x98 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */ + msi-parent = <&its>; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0000 0 0 1 &gic 0 0 GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 2 &gic 0 0 GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 3 &gic 0 0 GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 4 &gic 0 0 GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + pcie@3800000 { + compatible = "fsl,lx2160a-pcie"; + reg = <0x00 0x03800000 0x0 0x00100000 /* controller registers */ + 0xa0 0x00000000 0x0 0x00001000>; /* configuration space */ + reg-names = "csr_axi_slave", "config_axi_slave"; + interrupts = , /* AER interrupt */ + , /* PME interrupt */ + ; /* controller interrupt */ + interrupt-names = "aer", "pme", "intr"; + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + dma-coherent; + apio-wins = <256>; + ppio-wins = <24>; + bus-range = <0x0 0xff>; + ranges = <0x82000000 0x0 0x40000000 0xa0 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */ + msi-parent = <&its>; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0000 0 0 1 &gic 0 0 GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 2 &gic 0 0 GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 3 &gic 0 0 GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 4 &gic 0 0 GIC_SPI 132 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + pcie@3900000 { + compatible = "fsl,lx2160a-pcie"; + reg = <0x00 0x03900000 0x0 0x00100000 /* controller registers */ + 0xa8 0x00000000 0x0 0x00001000>; /* configuration space */ + reg-names = "csr_axi_slave", "config_axi_slave"; + interrupts = , /* AER interrupt */ + , /* PME interrupt */ + ; /* controller interrupt */ + interrupt-names = "aer", "pme", "intr"; + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + dma-coherent; + apio-wins = <8>; + ppio-wins = <8>; + bus-range = <0x0 0xff>; + ranges = <0x82000000 0x0 0x40000000 0xa8 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */ + msi-parent = <&its>; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0000 0 0 1 &gic 0 0 GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 2 &gic 0 0 GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 3 &gic 0 0 GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>, + <0000 0 0 4 &gic 0 0 GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + }; }; From patchwork Mon Mar 11 09:33:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 10847117 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 573FD14DE for ; Mon, 11 Mar 2019 09:35:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B8D528F4C for ; Mon, 11 Mar 2019 09:35:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B4A528FA4; Mon, 11 Mar 2019 09:35:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7D44728F4C for ; Mon, 11 Mar 2019 09:35:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=w0dAv16dmJzLy7GJnnVxDAdL0NsGtJCfbBpNlGfdawA=; b=Ier1b/MxzjunI0 g/7zIvmdpQdSHEAEfSfAOFo3cULQzoIYFj6QqjFuZWr1nwBw+lgSkTrUrkIlVmdCE54SdyQuohbO0 ftXxeEWHKeMb0+esKB9O+61z5k+3lRkQ2EQ4Ht6aXfKlWjbHsAA9XP39TPSrN+82L7f0qV6ga+xgs 7bA1qEGCpP554iLDhOl1VnfbAla2HnoPXnTFgK0GjXspx7YlYpjUhRAnN1BOLKFPsSOmP2k1bhutM 7wlUnlbw9zgROMI0e9TLFFoC+LQYgWlsp9P+H835XVd7fxi+p49gwLnMWkWfcQRWB/X46BRffLrIM +Zx3rxcfASicWiOaGOog==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HKp-0005ko-Dp; Mon, 11 Mar 2019 09:35:03 +0000 Received: from mail-eopbgr70088.outbound.protection.outlook.com ([40.107.7.88] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3HKO-0003wT-3e for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 09:34:49 +0000 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=wzsl5id2rqcEfxnP4104xXTqJNWv/ApEvJWcFG3HxCg=; b=UCYfdr0p2V+ytMgfHe0pJpmlYBPEh9BOHFOhrNH2fec69P7C2U3l0n0f9kZuN3DzBNHbE9uwlsvOIalVzhWTREtC/OZT2sXE4dUkrOKigXKRNdlx/AQv/Z4rwCm8RP/JgHKYQmJOLMraxKh6rHBnHDWWDLJ21Z+QqIwD5CT/iN8= Received: from AM6PR04MB5781.eurprd04.prod.outlook.com (20.179.3.19) by AM6PR04MB6150.eurprd04.prod.outlook.com (20.179.6.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Mon, 11 Mar 2019 09:33:49 +0000 Received: from AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7]) by AM6PR04MB5781.eurprd04.prod.outlook.com ([fe80::30cc:e034:1f7a:2cc7%2]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 09:33:48 +0000 From: "Z.q. Hou" To: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" Subject: [PATCHv4 28/28] arm64: defconfig: Enable CONFIG_PCI_LAYERSCAPE_GEN4 Thread-Topic: [PATCHv4 28/28] arm64: defconfig: Enable CONFIG_PCI_LAYERSCAPE_GEN4 Thread-Index: AQHU1+2HcERJ2aEe3kK7WSp8MTRCMA== Date: Mon, 11 Mar 2019 09:33:48 +0000 Message-ID: <20190311093130.7209-29-Zhiqiang.Hou@nxp.com> References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0015.apcprd03.prod.outlook.com (2603:1096:203:2e::27) To AM6PR04MB5781.eurprd04.prod.outlook.com (2603:10a6:20b:ad::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=zhiqiang.hou@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [119.31.174.73] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2b40309c-861a-42e0-4c43-08d6a604aa0d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB6150; x-ms-traffictypediagnostic: AM6PR04MB6150: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; AM6PR04MB6150; 23:Vzw2uYodh1uP8mWNXii7jj2m+XFIYGACgmnpPYB?= =?iso-8859-1?q?wzsd3w7osu1kMpc?= =?iso-8859-1?q?7dcVEmAURCyreb5ItEyt++S1C7PftNuF+V4uJd5oMTUhFZo2JrhXKbFMemRI?= =?iso-8859-1?q?+XUSIVvmOwiNDTxWV5TEBKZEpoENbtXfmXM1zek3wVL+w6TfA5BrU+YQRtPO?= =?iso-8859-1?q?WD3tjAcr2FNYj0DBCR5dWKfOhaDd9t+lxSvOJFw3slsNqP+5gf2oObSeJDrZ?= =?iso-8859-1?q?Vx0tBsSZNh2SBav7bmO3CG/omtPtfBHDShGQ8/yDBJx85nB3bAIFacVLI/gT?= =?iso-8859-1?q?nNTzZPIab7Hmps18oqV1dN2+7W3D5fPBF5DYTpolYXJ84UBoNDhNaxX5WZPC?= =?iso-8859-1?q?0wVuutXnrpyJbNDWXbFgPA0ZEppYe31Xq/M2zeQzO4aPdKWqCRThAkWuX5zP?= =?iso-8859-1?q?JKH/KKcAGE8KB47/BoL4h8lA4dVukpreAyK0WdFGJuwOtuU6Uht2G6ANdFCz?= =?iso-8859-1?q?dFB7kTzlQJXewElWiJ4KZBihaZF6Fb4lQHxEsKzeK7FYQQgAtzMGTeeryXeu?= =?iso-8859-1?q?1QZno+RjdNjXyjlhlM5N8D+ishFGMsgESnzm4ZrG443BiBPZaiL5cMy7anrD?= =?iso-8859-1?q?uMLHoeU1LApUaAPux7E+lk68WUXit6CKm65AHwWEqs4SkdANV3JpINuMSwpw?= =?iso-8859-1?q?vEqwpwDTpXEHKLpZtW2Ih8CMBl6f4crA4OmUkn2zz8NX7obE0aD9/GNaARKW?= =?iso-8859-1?q?AfzgT6pwu7VbIP2dhKVq49+q7h5rSfpTT/4LLGYEe/8mXBhkWacAHGZ2XF3V?= =?iso-8859-1?q?9MEm6/cz4JGyUEnrBoFWd+88ZJHKvVB7D9wwsQcsnBbI5WlDEhCc6dYKlTmo?= =?iso-8859-1?q?38YCgjtc9dqT2/WDlT9i6wCgD4JPMay0Lxe5iaxh3DXmXDFAShWu1DExqwh+?= =?iso-8859-1?q?EjuFyNSM1xVu/NX3RZFH2B9ly6TSXgFru0Xbmhy1FdaULwqoSe6ly7Ei4f7i?= =?iso-8859-1?q?4sUyfvI+UpglAXmT860Ec20WvqlP3iRbc69IdxzQaJ/pKdP9Zx70+4wn3ReG?= =?iso-8859-1?q?/R8AgLm67yvdaaCZ8UDzz4pGnPvxtasjvRXQvnccM0Owt9L00SKBgyNkfQiW?= =?iso-8859-1?q?W4KtL23iril+tvo1+DqKZBqP3zTK5K+cy73U2BTGdO841v0VJNbMRLGuWkZd?= =?iso-8859-1?q?XTZVG+wSvnI5+gEI8Md/Ys8V9eCoKbO2DZyuA4dxA8yS9Le8EoEehCcPvSX8?= =?iso-8859-1?q?uEdFPyktp4+bCqWRW2PDGztwnENLZSZgweKWXAuZYqRf3Xpy1bmgGnlUKOJt?= =?iso-8859-1?q?nZpXYagoctFHiM71muOdnFkhUcGSxqbxILIC/sXuK7grtHZXGxhvNRlkS4aF?= =?iso-8859-1?q?e03zjU7ws=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(376002)(39860400002)(346002)(396003)(366004)(199004)(189003)(86362001)(54906003)(110136005)(6506007)(386003)(52116002)(99286004)(102836004)(316002)(4326008)(2201001)(50226002)(2501003)(97736004)(2906002)(66066001)(186003)(26005)(5660300002)(11346002)(76176011)(446003)(6486002)(36756003)(6436002)(25786009)(81166006)(81156014)(8676002)(478600001)(476003)(4744005)(1076003)(7416002)(105586002)(305945005)(2616005)(71190400001)(71200400001)(3846002)(68736007)(6512007)(6116002)(8936002)(53936002)(7736002)(486006)(14454004)(256004)(106356001)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB6150; H:AM6PR04MB5781.eurprd04.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Shq1jW+LHY/rKn2ooU4pTffJn/j+Q2uWgUoHKItT+lDyIL7btS5t7KdRfUz2V1gpVKIwux5omaUlz4Pu79D22qEGciDFlk2EQ4IuVebFQrx4dP9yl7yrt0DeZ0Cvdlsxaf4Hya8CTHOy4p/Kb28I1LVUoRGweLSSyJPRFa4XU4YaNm6YEj1dPVsKZh5Hl3o4RtXnQu2al95y17aMUEK9kvBeizikVydboLhlQxiekz9Iz7WT5STIVzr7/Bo2hnMyilNeNdBMlyQtVb9c0WMR25Z9lSZNc8lE2FUX3emHbGxyYs0y26/zcxmJs+0IeRzwAEHr1CtANK+vyADgV5Qny/u5lEI3QwUJe/0jI5s37c4jyDlKvdJqcQMyWZtrq9aUJkPfCI+LZ/oMp+G9QoELlc3uUqPe0N1Wnny26xqOcT0= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b40309c-861a-42e0-4c43-08d6a604aa0d X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 09:33:48.9346 (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-Transport-CrossTenantHeadersStamped: AM6PR04MB6150 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_023436_472597_C7851D73 X-CRM114-Status: GOOD ( 10.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "M.h. Lian" , "Z.q. Hou" , Xiaowei Bao , Mingkai Hu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang Enable the PCIe Gen4 controller driver for Layerscape SoCs. Signed-off-by: Hou Zhiqiang Reviewed-by: Minghuan Lian --- V4: - no change arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 2d9c39033c1a..e294978aad5d 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -82,6 +82,7 @@ CONFIG_PCI_HOST_THUNDER_PEM=y CONFIG_PCI_HOST_THUNDER_ECAM=y CONFIG_PCIE_ROCKCHIP_HOST=m CONFIG_PCI_LAYERSCAPE=y +CONFIG_PCI_LAYERSCAPE_GEN4=y CONFIG_PCI_HISI=y CONFIG_PCIE_QCOM=y CONFIG_PCIE_ARMADA_8K=y