Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp1403776pxy; Sun, 15 Aug 2021 20:19:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy31x5qZXM8hMH/3YXmDn4t1Wq1MU3TdSlP94rY/tvAbnzwyKF1vKnlIB48tpSHCeoGl6X7 X-Received: by 2002:a05:6638:410e:: with SMTP id ay14mr13273962jab.76.1629083997063; Sun, 15 Aug 2021 20:19:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629083997; cv=none; d=google.com; s=arc-20160816; b=UK85ye6dWgy11QXl51IPWnZXn2kdoyyKqr/udkfcHl0XMODbJ+lYvZdvE/+RubP9wE f8prw6tLRmzG+nZCJb8y0xKMbHbK2jvZvgWJQn+0xqlf/0Fqe9bBzO0BcTjnAqDlZlsT lQsy9V0wohGvoY74XLq/kKtkUjjxkjvM4xPRZqbzyXZRr+wIIdZ9PLWHuYynuMJfk7UY c0mpP6qwL8bl+GEvLT+x3K3hXB/EWvqY+AtHSzXvB2ourjwuKLHMuOgasJoYMkh/yvcv sCUiwytjYoM7XF5s5FiIKbBMVMKeFmpOvGFqWD6b9pFWYPiZQpv0nVI1+QAGQPzUxMdn aUcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=dqYhy6RuarsgIjB5eyNg7Pyfrfiys32zXKIAO09W/ZE=; b=ZXxddb4nA1+3rN0V/lMCM49lAZ4pY1//UUJMei+/BO0YZDSVlh03M59iPQjpUVRufO 5oC0t88PCXL85AVIIPzHtjOOSctyGgxuYE3VWleEoiqWB+4vW9xJ8mgbh5w3QVSmpuve 8krAym/VATAAqmjrfS+QM4oYgUn9ZmcXHzFHHGWTRtfpDuVN40NYWSdmjW1PswScrqJI EpdK4pPOKWGxoKkYuy6T9RRan9eWCyf4TW7bdzO2Uv+PN0bqOlrAC2oxcKRAtbY2jY89 praG+JBrIDGq+Zj64fFCjUD/0wZJY7OyQ54BlBhZTq9+AKbAQVV3xHgNeMBTatQPrmP/ 5GGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si13110612iov.41.2021.08.15.20.19.46; Sun, 15 Aug 2021 20:19:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232045AbhHPDSg (ORCPT + 99 others); Sun, 15 Aug 2021 23:18:36 -0400 Received: from [138.197.143.207] ([138.197.143.207]:45272 "EHLO rosenzweig.io" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S233081AbhHPDSc (ORCPT ); Sun, 15 Aug 2021 23:18:32 -0400 Date: Sun, 15 Aug 2021 17:33:48 -0400 From: Alyssa Rosenzweig To: Rob Herring Cc: PCI , Bjorn Helgaas , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Stan Skowronek , Marc Zyngier , Mark Kettenis , Sven Peter , Hector Martin , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH 2/2] PCI: apple: Add driver for the Apple M1 Message-ID: References: <20210815042525.36878-1-alyssa@rosenzweig.io> <20210815042525.36878-3-alyssa@rosenzweig.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, Thanks for the review. > > +#define CORE_RC_PHYIF_CTL 0x00024 > > +#define CORE_RC_PHYIF_CTL_RUN BIT(0) > > +#define CORE_RC_PHYIF_STAT 0x00028 > > +#define CORE_RC_PHYIF_STAT_REFCLK BIT(4) > > +#define CORE_RC_CTL 0x00050 > > +#define CORE_RC_CTL_RUN BIT(0) > > +#define CORE_RC_STAT 0x00058 > > +#define CORE_RC_STAT_READY BIT(0) > > +#define CORE_FABRIC_STAT 0x04000 > > +#define CORE_FABRIC_STAT_MASK 0x001F001F > > +#define CORE_PHY_CTL 0x80000 > > +#define CORE_PHY_CTL_CLK0REQ BIT(0) > > +#define CORE_PHY_CTL_CLK1REQ BIT(1) > > +#define CORE_PHY_CTL_CLK0ACK BIT(2) > > +#define CORE_PHY_CTL_CLK1ACK BIT(3) > > +#define CORE_PHY_CTL_RESET BIT(7) > > I was going to say these should be a phy driver perhaps, but they are > unused. So for now, just drop them. Removed in v2. CORE_PHY_CTRL is used in the asahi linux bootloader (m1n1, shared between linux+uboot+bsd) to do early pcie bringup. They are indeed not used here, nor are they used in the uboot/bsd drivers. > > +static int apple_pcie_setup_port(struct apple_pcie *pcie, unsigned int i) > > +{ > > + struct fwnode_handle *fwnode = dev_fwnode(pcie->dev); > > Doesn't look like you ever use the fwnode, just get the DT node > pointer. Unless this driver is going to use ACPI someday (and ACPI > changes how PCI is done), there's no point in using fwnode. Dropped in v2. That was a copypaste fail splitting off apple_pcie_setup_port from apple_msi_init in an early revision. > It's preferred to use platform resource api and ioremap over DT functions. > ... > Use devm_platform_ioremap_resource instead. Done in v2. Thanks, Alyssa