Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1000875imu; Thu, 20 Dec 2018 08:32:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/UCqmVg0bO6GLnGVxAFunLgk4nz7Zc7XDd8siIobJomdvDxYRwOC6HUHu5htV61g0iroCuV X-Received: by 2002:a65:6094:: with SMTP id t20mr10698488pgu.285.1545323565803; Thu, 20 Dec 2018 08:32:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545323565; cv=none; d=google.com; s=arc-20160816; b=bxeXkVk6rsllzNopoKBO/0aavtI51aw2kgTiJi2I+44iGJcrbBdlCej0tfpe/d9Y9H Kze/J2zkhs+2fown9sGOIx+iB9CHIEXwgRLCDc4TXMefilzT5WUzxPycCfaKNXZ4xV7e 9XB2ySGN6ETd5dcoo2otS4dM8nUGFnbAof8KEEq/+O1f5K6aa0US8J5qhz/TWcxpub+a 4hINwrHW44rZ655gF1FNm/sueSCLK51m+du6YskAX9ytLYnDRf85VhZ4/m/2F75xuqyd LBIxcCfceT9c9wo3VnAx9KnKmRYI1J2weaYdbbsfJ5vTiW3k60cVcbosPVy3bPMfRUzL OBoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rh2t9gNmjxx8JjNaEynxRmyebUJrRrZzpwDU+lyd4oQ=; b=R+rRNb+KnFDMtar31N1oOetpzxjPaOfV6xlOUsxEVNc+jynME0LeoGMfQqRRF678f2 DI+JSr8j/QbceeayTiJ40zzeCXZdMTcVVKsyX8kKafw3BxOPyuvqVo0mKJeY/RBRhLSq C6C2wsSsJ/UgDYrKPiQBoj69OeKhPsvTRzdMHHVvsmuDhDCIw1H7QGBuqASkJwRexgyv LeILlSXPyXJRmdsvcHQxT8sOC6kAc+/5MCw5WEfFlfNTqWzF7tfhoVBT/nx4JzxChHi4 dHf84RnEBW78moum5uy/G4SpmDsW6fiw6sz6/xCSVWyvUpXWuhXYYmoYw5/EaSxp/YM/ PiEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pdnUMcCF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si19223434pgl.484.2018.12.20.08.32.30; Thu, 20 Dec 2018 08:32:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pdnUMcCF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729137AbeLTPAR (ORCPT + 99 others); Thu, 20 Dec 2018 10:00:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:41194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725681AbeLTPAQ (ORCPT ); Thu, 20 Dec 2018 10:00:16 -0500 Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 86A48218D4; Thu, 20 Dec 2018 15:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545318015; bh=PgdcFzzFJRfg9e6GuRKfjwKRt1qszJo4vAoki4ZdPow=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=pdnUMcCFDBFzHEAMdpyHRqX9GgShwKo+QWg59/9Oe4NJ82DCoTOfLtLzZYMANPtwQ L0sUq2vX5mD6Af6yxTOnQuLhXBpFkmQnsid16WJWPW1iqe/fF8awRHmT6MQ7y6YWYx uTqdoLMVoIEznpEq3UtzC3+ivOhjCz4zQIY5fcgI= Received: by mail-qt1-f182.google.com with SMTP id n21so2087877qtl.6; Thu, 20 Dec 2018 07:00:15 -0800 (PST) X-Gm-Message-State: AA+aEWZD9ZHfvcQaslGzxG/VXmjuRWEdT70KEsKyW5DwZHqucR/NtYdH jX1DIFWQD/fMmHqQCC4HYheZb7t44w32ujKQ6A== X-Received: by 2002:a0c:f212:: with SMTP id h18mr26745039qvk.106.1545318014699; Thu, 20 Dec 2018 07:00:14 -0800 (PST) MIME-Version: 1.0 References: <20181218040702.29231-1-andrew.smirnov@gmail.com> <20181218040702.29231-4-andrew.smirnov@gmail.com> <20181218151533.GA2922@bogus> <1545268969.22930.77.camel@impinj.com> In-Reply-To: <1545268969.22930.77.camel@impinj.com> From: Rob Herring Date: Thu, 20 Dec 2018 09:00:01 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 3/3] PCI: imx6: Add support for i.MX8MQ To: Trent Piepho Cc: Lucas Stach , Andrey Smirnov , Dong Aisheng , Richard Zhu , Chris Healy , NXP Linux Team , "linux-kernel@vger.kernel.org" , devicetree@vger.kernel.org, Lorenzo Pieralisi , Fabio Estevam , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Bjorn Helgaas , Leonard Crestez , linux-pci@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 19, 2018 at 7:22 PM Trent Piepho wrote: > > On Wed, 2018-12-19 at 16:47 -0800, Andrey Smirnov wrote: > > > > > > This series initially added explicit offsets but I suggested a single > > > > "controller-id" because: > > > > * There are multiple bit and byte offsets > > > > * Other imx8 SOCs also have 2x pcie with other bit/byte offsets > > > > > > > > Hiding this behind a compatible string and single "controller-id" seem > > > > preferable to elaborating register maps in dt bindings. It also makes > > > > upgrades simpler: if features are added which use other bits there is no > > > > need to describe them in DT and deal with compatibility headaches. > > > > > > You already have an id for the controllers: the address. Use that if > > > you don't want to put the register offsets in DT. > > > > > > > Lucas, are you on board with this? > > Does address here mean the address from the controller's reg property? Yes. > How do you map that address to the controller's index? A giant table > of every soc so the soc type plus controller register address pair than > can be looked up in the driver? You only need the 2-Nth instance addresses. A non-matching address can be instance 0. > I.e., on iMX8MQ the controller at 0x33800000 is controller 0 and so on > for every possible SoC address combination? > > Not really a fan of that. Well, this was not my first suggestion. > The situation here is that some registers for these controllers are > interleaved, right? I.e., there's one register somewhere where bit 0 > means enable controller 0 and bit 1 means enable controller 1 and so > on. So? The only difference here is an additional mapping step. > Isn't cell-index already the standard device tree property for this > kind of setup? > > I know cell-index was historically also (ab)used in an attempt to > provide a fixed kernel device enumeration order, something now handled > better by chosen node aliases. Don't use cell-index. Consider it a deprecated relic from OF that is not used on FDT (though there probably are some cases it did get used). Rob