From patchwork Fri Sep 15 18:43:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 140727 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1350315vqi; Fri, 15 Sep 2023 15:15:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHn32mDGt6UpxmEkwEkxXl7Smh8fTMCKwi4QP1E9hfu3E6pD5lADthOw41BDkV/yDVc7QKk X-Received: by 2002:a17:903:32c5:b0:1c3:3461:75b5 with SMTP id i5-20020a17090332c500b001c3346175b5mr3668348plr.0.1694816148087; Fri, 15 Sep 2023 15:15:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1694816148; cv=pass; d=google.com; s=arc-20160816; b=s1a0JAam6Y1Fll0WNJxfpRndN7VmPTbo9wWIg/srkRv38R7YSyl02HnUbDGGEYjziz qUcs+zeIK6DXWWQB/DpdZLVvVd+BIL2D6jrr7brLi/3qp1ZXHrgMDX9OOgg63IzVKsxg AK9hhION8YFTuofbVNUFnF8VZELNB3aeI1URjq4ee43I8UP3AxAGJ4x2Mm88kJEAZh1z tEUAfWBGr0nH8j3Mv5e5n2IWaN3SwMrHxCysbGvfT84u55DJNJ6U8U5ERK0MrYwt8OBq 28eMQNNqgjMkZVqt9ehCiqH88d7HxP5WwDX79/J1Dxq80ET17X37ocFzwvvx7kl5+TTx UxrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yOAmxkk1FLpr83vxYch5SYzBkOWvzUHP+VAG6W4Homw=; fh=oooHTiAXK44aMf+XQcyrMApjhhRxQuk8M9D/ohRv+pM=; b=h6tCOQBNfOjbntepfXIdWch/S/3SMrUuZfql/dLTPItMNA8XfyUyhVgx3DMtN9hFoJ 7YtJmRmhCUjTxa2JykGexjB8LqsVyQ+WyxmAfWfJqQmqlSRsFq3nCgLdJ+YxwYFrfCs+ FjMMxQ/dMm/zLB9s8Z5RRKDeTI2DPp61GxBTXECnPuUGdUZAYJlXV2xoNdaDukA/g2pc lnmU/Q/WeE+p9Uj0yKDDSZ+ave8f1kT5L8XcdUBMypnwxeVve3a8mERDrdirKAagHYhv AAFz3ISX9asj9Ju0Pe694KKBrzF/G0Z35lhiYANUKJ50D2E8O+D8Nrm1spMsrXCvsjB1 duxA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=niQbs9gx; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id kb14-20020a170903338e00b001a677821130si3852961plb.13.2023.09.15.15.15.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 15:15:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=niQbs9gx; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8FF4580CF544; Fri, 15 Sep 2023 11:47:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236598AbjIOSrA (ORCPT + 30 others); Fri, 15 Sep 2023 14:47:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236965AbjIOSqk (ORCPT ); Fri, 15 Sep 2023 14:46:40 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2087.outbound.protection.outlook.com [40.107.21.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 334432D47; Fri, 15 Sep 2023 11:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VGHFUePS8t/3S0CE6B0Pq+pUHXBNZPTO9Io6yTtVo1FvCwdvOF3w8iFW6oyGlsEX4Q/596QlKIjiJ9XLQYwPZZw37D9OjqCQ1IIYzPvgNo0gE6OI8ESMx29WMe/oQlvO5n9PqhZwPXRo5HRNzvmeASEEaWgPtzD9ZrBwzyGYQShfJMsVdgaHqmQoIBacn8tSxL9Trwg8Euv2BXoK86AmTzihR7z36dNdoe824lK27FZynWuyNcVeSkmxs9fOeVu9tqd5k20K8yvol6H1CLbOZaNlgII64ewgP4U2872CBGpJKAB+r+tI9sVGAP60FD0rBpKSeCHwLg3XOW6dvL32Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yOAmxkk1FLpr83vxYch5SYzBkOWvzUHP+VAG6W4Homw=; b=KwR0jU8yWQCNppinBFjNgM5ODu0hhUKZadRGRJLwZCslkbEpRsXUp7PQKmebdnshihqE3iBngfu+NrPRSQVvTOOsrLQUJg6BLXUGt9A55szb8gMaxMrssSTgbO3QtkPIPgVgrT5giwBWOdxLD8p5sIAQMO5NE9pQBqbvwc+UGgeRrxvNEen1eJBpVAfIO+I3y9AeGBYXta8Y7z1jRX19K5FRgTMEDKwy+JRTFNoT8pZTJ4at/OyYV+xFYQ7e30sav820EaiDvxWXWNoXuKDycZv4Ahwee3HFB9HHT8KnP53wsw4kOaQwQmXl4pbPRwl/Eao+m4ngIgk/9J2hujG/8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yOAmxkk1FLpr83vxYch5SYzBkOWvzUHP+VAG6W4Homw=; b=niQbs9gxA/f+4yw++Ux/+i3keVoGIU7j5Fou+C6EBuFbBFgjcb317RFrpxnYiank0mm8Qm2tys8+8MAgSt7Ea3GKRMdfo689BsEnBQO99t8dAJ2Il/1iFy1ek0d7Urmt02Ks4Ub/LCwjKFVrZVb8FZpznQ42KtEUtgF5I+Lu/Mc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by GV1PR04MB9184.eurprd04.prod.outlook.com (2603:10a6:150:28::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.21; Fri, 15 Sep 2023 18:43:34 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::aa90:117d:c1d0:346a]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::aa90:117d:c1d0:346a%3]) with mapi id 15.20.6792.020; Fri, 15 Sep 2023 18:43:34 +0000 From: Frank Li To: Minghuan Lian , Mingkai Hu , Roy Zang , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , linuxppc-dev@lists.ozlabs.org (open list:PCI DRIVER FOR FREESCALE LAYERSCAPE), linux-pci@vger.kernel.org (open list:PCI DRIVER FOR FREESCALE LAYERSCAPE), linux-arm-kernel@lists.infradead.org (moderated list:PCI DRIVER FOR FREESCALE LAYERSCAPE), linux-kernel@vger.kernel.org (open list) Cc: imx@lists.linux.dev Subject: [PATCH 3/3] PCI: layerscape: add suspend/resume for ls1043a Date: Fri, 15 Sep 2023 14:43:06 -0400 Message-Id: <20230915184306.2374670-3-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230915184306.2374670-1-Frank.Li@nxp.com> References: <20230915184306.2374670-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0186.namprd03.prod.outlook.com (2603:10b6:a03:2ef::11) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|GV1PR04MB9184:EE_ X-MS-Office365-Filtering-Correlation-Id: 5964a72b-a75b-4a12-bcc9-08dbb61baa51 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i9s4GNz6l4Lk12jFDBu8d1S8PBMt0cLW/EFpOHnhzDrfH2KRea4rd3UhVPrwf3TxsNffgB1FO5JVRyndoE7VgE7JjAVvwa0MWFvbVJwDOeQ/O7iGMpmG3A/BN6sQChsQVTQJm+HouWMFsZIKYe7XLrwvN+g8L8QmieYroauRT2yZgqtg6OtcxY7E0XCP+ny92r1ijTwFLhRQKJvzzZOutIjblmuZcFnCVvka2c5DIhGFBuBXv7ySCAqP3xlopSoBSmhG15TxvmjR3H1qNjpllRehulHbtzSDyIdeKKqTSBiNQKwKz/QUAx2lZTuacLLqfL+omp+WcCidwLg+FUx357g//gKIEpQYnytBjO7mpRsPqFnEy9qTgYLQCoLbGq416FJ7a00Rd7bTft/3DYUJc8uBm2Bi1M7IqmLmfbvhGyz8m1wztZ32Lrdf3BfnU1WI2m2oMYXXdNsJ/5ZTKU3dn62xHYdLNiNGX/h49Pj0RQBtiSFTh8CF/32V32Pxwdlau+D0we6cuxiDag7oVv2uyd8sRzDg5Eu4bAY1j48LK34n7sjdC9bjcgUqF9Ik3rTqGTmWI8kn5C3lTs46RdnckJ/gduo8psmBnzNsIjjKkD6M+YpEWiKZsYZEABCzac+wjTE7u+cSUoPNGR7Q+KHV0g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(39860400002)(136003)(376002)(366004)(396003)(451199024)(1800799009)(186009)(15650500001)(478600001)(6512007)(6506007)(6486002)(6666004)(52116002)(2906002)(4326008)(86362001)(8676002)(5660300002)(8936002)(41300700001)(316002)(110136005)(66476007)(66946007)(66556008)(38350700002)(1076003)(2616005)(26005)(921005)(36756003)(83380400001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VCT5wDmLrdnSBPYkhO5FPKNzyOBOHfu9tWKJLfrgl/aHFdYCAkoGDlGFF7bHJ0njq0rZMOwCyTucnSJkxMQ706TXqC6zsku2dJN0K5wRDNef5Y7JwLOnZnOz36Gf0ZX1lfkalOik5ieTXnVzvT8ew0gGZG1QShhz80naivoxayikuXYah6rGWmiT47FBK+US1xZQbiArhKlm2TDbqSc8LKdLDbHPAnRppH8PmHOJYuGtxb/llT/ZYGcMqRiG9lIZLSSQucyNGn0Xq67D7aJ+pBva+JoeJR33hWw+mUpz3x8Hy6VfgT1g12ae77ik29etPTaGWQvcFV8zpk+4CGWc9mgC0OeMgcdPBjC1szMPSKy2hPba8baXiJZ1wIXI7MIggbOfOajI+H5FtD6esxZmUgxZqqNgKk7tzaH/vfDg8nLxfzrgc+BmvcFtN2XeWFYT5hw2VzE3JEM8t6k2wif4SETPhht4qehC9J39vvtyLy32D2Rgyqo3d+hjzTAKcKTT6wPRzaSefgNatGWRgVqvIAnWYbgq4EQplQsP7Sktun/drra21P8MLkp3y0f1X8OZ10MtSK581j0QhfE57+PN1Va0YLElQLwZeZfkxE3eEiZEh/XuXHk20fWqoFSwKFWJMBjKc1y9NzhG0T6eKnGroA2ejR9ENqHuz5KWPWSD9FGQFOVU/SjCdACgYog92THbSw4zOXOd5JT7Aj9cREMW/2m8rXuC2/QOFSvELccbWGxKne94g28iamyyKTKV6syhPOYWCXdMyrg9MyCMQgF3TECL1nApJVa+DzSVUOFcAk4YTDXqEt0NCEPeWaO3lUro6e8JbTD7/+9ZA3aq/5fUJPf/WqAgPqsTmJARcIOrQHd3eRTINAzu6LRFsRCA2l/rzeHr78DWVQNRyhRTjn0A7NIdxB6ZGeH5uSEsBlrFCYtddGuKcZN6+KQ7bvJp7iX4ZlR31r/qKlm/+ZqpsZ/IVnK/RprdPQzeG6La2WBKS1KtwUBRgfkXipgVETGUY2nH2UiBmFtsFGMiHkyCr3JHlDUemTB3yoGI9MGsGR0KYSTqoL3/jGVtiAxRlSgpz2lkJi4Em/CNXYDz/wYWyQDT/2uyf/FPXFFisCZcaS2umXJl5JxL19t61KAa19mb0mCs++NOXansO3IMn1uXH9IKgbeUTIetu5nHT+9sHku/g3y6G+FHnXWK4RcKjIm5QBeXeNIhd/87fEjyttLM3cVueCL/FzryaZqhrVarIBp5o1TO6rRHgHFa4IDcc4XO2DFU0cim9Nbt5tlKi/2E0U3YI+CAKwhE7vw/XxiYglOC77YnXt3BQ/x22p6Ak6Wqf5zBqHLxrArcpG+8VHcKrb+OYGGi0vlayY/2eXw2byzP3Nv3MdIEFCArhTxb+HlMyjjz2bzsLEtlHhEqw1ub7t093U4FAfSImGVw9XCKnu0Oe/C8p3J2eaQGX/4I72ECe9N2fsEVS6If1cIzCMYSyCzphmqBt6r7vgBKqPY5L3VQfDpt8YEAc5uicvPfYR6YIzzibq2VGF9aks+GBMXEcGzRwkhqE5Y9GgJL0qcfVfiuUgbRSnI6eZ64+wQjoaYuQItj X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5964a72b-a75b-4a12-bcc9-08dbb61baa51 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2023 18:43:34.2398 (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-CrossTenant-UserPrincipalName: vTlLAEQjFlNkqHkgpiuyANJd9Q2Xgv+NpOCXhjXX13RU6uJkm8ym2xy6WFphAO9ze8jVD+TwE7OgptqQNfRDLg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9184 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 15 Sep 2023 11:47:39 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777143537661142509 X-GMAIL-MSGID: 1777143537661142509 ls1043a add suspend/resume support. Signed-off-by: Frank Li --- drivers/pci/controller/dwc/pci-layerscape.c | 91 ++++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-layerscape.c b/drivers/pci/controller/dwc/pci-layerscape.c index bc5a8ff1a26ce..debabb9bb41f4 100644 --- a/drivers/pci/controller/dwc/pci-layerscape.c +++ b/drivers/pci/controller/dwc/pci-layerscape.c @@ -41,10 +41,20 @@ #define SCFG_PEXSFTRSTCR 0x190 #define PEXSR(idx) BIT(idx) +/* LS1043A PEX PME control register */ +#define SCFG_PEXPMECR 0x144 +#define PEXPME(idx) BIT(31 - (idx) * 4) + +/* LS1043A PEX LUT debug register */ +#define LS_PCIE_LDBG 0x7fc +#define LDBG_SR BIT(30) +#define LDBG_WE BIT(31) + #define PCIE_IATU_NUM 6 struct ls_pcie_drvdata { const u32 pf_off; + const u32 lut_off; const struct dw_pcie_host_ops *ops; void (*exit_from_l2)(struct dw_pcie_rp *pp); bool pm_support; @@ -54,6 +64,7 @@ struct ls_pcie { struct dw_pcie *pci; const struct ls_pcie_drvdata *drvdata; void __iomem *pf_base; + void __iomem *lut_base; struct regmap *scfg; int index; bool big_endian; @@ -116,6 +127,23 @@ static void ls_pcie_pf_writel(struct ls_pcie *pcie, u32 off, u32 val) iowrite32(val, pcie->pf_base + off); } +static u32 ls_pcie_lut_readl(struct ls_pcie *pcie, u32 off) +{ + if (pcie->big_endian) + return ioread32be(pcie->lut_base + off); + + return ioread32(pcie->lut_base + off); +} + +static void ls_pcie_lut_writel(struct ls_pcie *pcie, u32 off, u32 val) +{ + if (pcie->big_endian) + iowrite32be(val, pcie->lut_base + off); + else + iowrite32(val, pcie->lut_base + off); +} + + static void ls_pcie_send_turnoff_msg(struct dw_pcie_rp *pp) { struct dw_pcie *pci = to_dw_pcie_from_pp(pp); @@ -249,6 +277,54 @@ static int ls1021a_pcie_host_init(struct dw_pcie_rp *pp) return ret; } +static void ls1043a_pcie_send_turnoff_msg(struct dw_pcie_rp *pp) +{ + struct dw_pcie *pci = to_dw_pcie_from_pp(pp); + struct ls_pcie *pcie = to_ls_pcie(pci); + u32 val; + + if (!pcie->scfg) { + dev_dbg(pcie->pci->dev, "SYSCFG is NULL\n"); + return; + } + + /* Send Turn_off message */ + regmap_read(pcie->scfg, SCFG_PEXPMECR, &val); + val |= PEXPME(pcie->index); + regmap_write(pcie->scfg, SCFG_PEXPMECR, val); + + /* There are not register to check ACK, so wait PCIE_PME_TO_L2_TIMEOUT_US */ + mdelay(PCIE_PME_TO_L2_TIMEOUT_US/1000); + + /* Clear Turn_off message */ + regmap_read(pcie->scfg, SCFG_PEXPMECR, &val); + val &= ~PEXPME(pcie->index); + regmap_write(pcie->scfg, SCFG_PEXPMECR, val); +} + +static void ls1043a_pcie_exit_from_l2(struct dw_pcie_rp *pp) +{ + struct dw_pcie *pci = to_dw_pcie_from_pp(pp); + struct ls_pcie *pcie = to_ls_pcie(pci); + u32 val; + + val = ls_pcie_lut_readl(pcie, LS_PCIE_LDBG); + val |= LDBG_WE; + ls_pcie_lut_writel(pcie, LS_PCIE_LDBG, val); + + val = ls_pcie_lut_readl(pcie, LS_PCIE_LDBG); + val |= LDBG_SR; + ls_pcie_lut_writel(pcie, LS_PCIE_LDBG, val); + + val = ls_pcie_lut_readl(pcie, LS_PCIE_LDBG); + val &= ~LDBG_SR; + ls_pcie_lut_writel(pcie, LS_PCIE_LDBG, val); + + val = ls_pcie_lut_readl(pcie, LS_PCIE_LDBG); + val &= ~LDBG_WE; + ls_pcie_lut_writel(pcie, LS_PCIE_LDBG, val); +} + static const struct dw_pcie_host_ops ls_pcie_host_ops = { .host_init = ls_pcie_host_init, .pme_turn_off = ls_pcie_send_turnoff_msg, @@ -265,6 +341,18 @@ static const struct ls_pcie_drvdata ls1021a_drvdata = { .exit_from_l2 = ls1021a_pcie_exit_from_l2, }; +static const struct dw_pcie_host_ops ls1043a_pcie_host_ops = { + .host_init = ls1021a_pcie_host_init, /* the same as ls1021 */ + .pme_turn_off = ls1043a_pcie_send_turnoff_msg, +}; + +static const struct ls_pcie_drvdata ls1043a_drvdata = { + .lut_off = 0x10000, + .pm_support = true, + .ops = &ls1043a_pcie_host_ops, + .exit_from_l2 = ls1043a_pcie_exit_from_l2, +}; + static const struct ls_pcie_drvdata layerscape_drvdata = { .pf_off = 0xc0000, .pm_support = true, @@ -275,7 +363,7 @@ static const struct of_device_id ls_pcie_of_match[] = { { .compatible = "fsl,ls1012a-pcie", .data = &layerscape_drvdata }, { .compatible = "fsl,ls1021a-pcie", .data = &ls1021a_drvdata }, { .compatible = "fsl,ls1028a-pcie", .data = &layerscape_drvdata }, - { .compatible = "fsl,ls1043a-pcie", .data = &ls1021a_drvdata }, + { .compatible = "fsl,ls1043a-pcie", .data = &ls1043a_drvdata }, { .compatible = "fsl,ls1046a-pcie", .data = &layerscape_drvdata }, { .compatible = "fsl,ls2080a-pcie", .data = &layerscape_drvdata }, { .compatible = "fsl,ls2085a-pcie", .data = &layerscape_drvdata }, @@ -314,6 +402,7 @@ static int ls_pcie_probe(struct platform_device *pdev) pcie->big_endian = of_property_read_bool(dev->of_node, "big-endian"); pcie->pf_base = pci->dbi_base + pcie->drvdata->pf_off; + pcie->lut_base = pci->dbi_base + pcie->drvdata->lut_off; if (!ls_pcie_is_bridge(pcie)) return -ENODEV;