Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp328879imu; Tue, 27 Nov 2018 13:05:34 -0800 (PST) X-Google-Smtp-Source: AFSGD/U+Zuf6Qv76+w1qpoSJZbvlKiVJsmjYFXisqKrGdx5qOko88sPKakyVHLEvb0zNXJ4ZIP8D X-Received: by 2002:a63:6906:: with SMTP id e6mr30231561pgc.144.1543352734677; Tue, 27 Nov 2018 13:05:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543352734; cv=none; d=google.com; s=arc-20160816; b=AKdMczO0GNjV+yi+hLRZnfx8Hv0fgtZ+C3RT+xLQKvQ8nXU0PB+z0BQsB2WozgZGXf trUMdn32nZlXNNEZ9kQWojobviEXssKdqjOz0gI2copUcGKdZbi8OYsijD26bcmuB1fb wSP0r+Wwu89UpVQ+ZGtFLAIh/9XOPxqvJ/o8ZTNUaeuMd74nRqHhF9XCCZEgCOKaI2lc OPCKfEPKvnnu5WfZtZF4moOeH+CrA0PSMjbgjEJZU6D7x22QUf426IB3eYe0EBCcm5m9 AS1DH6CZyMxcoCSrVkcdzp257K8acqjvaUsYsYVeAglke6rR3bb50XYPs5UIcrg186Ly m0pw== 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=u4E6AziKpUktxFa6iczYeboLTlCGjBaA9rElEZUd4CY=; b=X+vl1d/5DFPokEG9DSK2eLqunk3TthW/Fkvlt6hd8zOMEIbk/zVmES8vrYGyoaoZyN Sb9kpW1uQ0MAEhU+J+gB4L/IhtR3Q3iPQiDwreLmh5o6G/kNosuSRvLBhs3kHgaa2Waa 1qf195Ci8WR7kSK66/QpT7dY6K/cIfwbkWOjsriPSWB/609m4EvQOaGdN2GnEdJbMiP/ 49zlJiIb4VGCF/OCOfMXucAVEALWYoqD/+6Um6epq9VZxMHV/4yABSvus/qd+blvIosb 84jnl0Hdy6Gc4jactWShIG0e+XMpAQ1XUA5X/FbWSkawmZhtNtsivAAajLLbDH6Ixec7 22+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qDwh57dZ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c136si5061284pfc.141.2018.11.27.13.05.17; Tue, 27 Nov 2018 13:05:34 -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=@gmail.com header.s=20161025 header.b=qDwh57dZ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726622AbeK1IDV (ORCPT + 99 others); Wed, 28 Nov 2018 03:03:21 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:39286 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726234AbeK1IDU (ORCPT ); Wed, 28 Nov 2018 03:03:20 -0500 Received: by mail-wm1-f66.google.com with SMTP id n133so416559wmd.4; Tue, 27 Nov 2018 13:04:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=u4E6AziKpUktxFa6iczYeboLTlCGjBaA9rElEZUd4CY=; b=qDwh57dZ9OBD+u01EL/MLoYuOisq0LxV8OAig8SEnNngyFRFS46u+t8BfKVGb06puk mx1e+yNHXhR3MYejmnTkS+j30C/Rvd9PfgOMgNo56b2y6D1Q3NFLxMkoKRn4Wqa5PmO/ WPoPGsjVT10IaUxifgwRbY21jW7g1yF7ORa9DqAggbHA7iA5xPi2hhH5zzzqatgF3FWC F9SM45paW0aQCUvB2zWC7EDtU6ev8IwQJ/buIifZZGLha090Zv+zZk9GAD7ZhoSb7fpT BMYpixAQbRW1GPrgY0Y2hz12H1JrN4T3t/qoEP+W2HgXMWVDsGNM9HvMjzhpKiEhOVB5 2l6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=u4E6AziKpUktxFa6iczYeboLTlCGjBaA9rElEZUd4CY=; b=ZizzjBofwjccoFylPG+g0earEgg3Z5Zp1Fb+HeSgxI7R8tMz1ysSUlkqIQKBzEtabi J9eQHuYnrna33iZCZuQaYDBinTrA66+tbpYCs2rKiLrP5bmm/uSWortDoiizL0K20io5 N1oTNmdJeMINThn9+AkZVL8X20P8wgRIAYplvQsBCW3WqyI2jtXFPh4SNSYCCTZurkmc HqHgMq+mxuYv1edhZOPzzkT1U37Byox5O2tM9dQ9bv/pBcntKrQBY5ha0kqJLmWd3HiX mRvdod/3O6gQexztJEtaSpJ0Sa7euA12ZBtD0a+PqhZP5y1qcHvVqdej1rk73kwJol+E znPA== X-Gm-Message-State: AA+aEWbiHExwtghuRiZ3RaT2pvYXjD1AvVkhnhyK1qTenXQzDrYH5pfE W5vRtSMQ+RtTTzwBOOihFgHHBDINqEpy/u4uSGA= X-Received: by 2002:a1c:f0e:: with SMTP id 14mr390009wmp.37.1543352648847; Tue, 27 Nov 2018 13:04:08 -0800 (PST) MIME-Version: 1.0 References: <20181117181225.10737-1-andrew.smirnov@gmail.com> <20181117181225.10737-4-andrew.smirnov@gmail.com> In-Reply-To: From: Andrey Smirnov Date: Tue, 27 Nov 2018 13:03:56 -0800 Message-ID: Subject: Re: [PATCH 3/3] PCI: imx: Add support for i.MX8MQ To: Leonard Crestez Cc: Lucas Stach , Richard Zhu , linux-imx@nxp.com, Chris Healy , Dong Aisheng , linux-kernel , Rob Herring , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Fabio Estevam , Mark Rutland , linux-arm-kernel , Bjorn Helgaas , linux-pci@vger.kernel.org, kishon@ti.com, lorenzo.pieralisi@arm.com 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 Tue, Nov 27, 2018 at 2:16 AM Leonard Crestez wrote: > > On 11/26/18 8:24 PM, Andrey Smirnov wrote: > > On Tue, Nov 20, 2018 at 2:49 AM Leonard Crestez wrote: > >> On Sat, 2018-11-17 at 10:12 -0800, Andrey Smirnov wrote: > > >>> + if (of_property_read_u32_array( > >>> + node, "fsl,gpr12-device-type", > >>> + imx6_pcie->device_type, > >>> + ARRAY_SIZE(imx6_pcie->device_type))) { > >>> + dev_err(dev, "Failed to get device type > >>> mask/value\n"); > >>> + return -EINVAL; > >>> + } > >> > >> The device type can be set on multiple SOCs, why are you adding a > >> mandatory property only for 8m? > > > > My thinking was that other SoCs don't really have two controllers, so > > they don't really need to have that property, but, more importantly, > > not forcing them to have this property should preserve backwards > > compatibility with old DTBs. > > The "device_type" registers determine Root Complex versus End Point > mode. This is not yet supported on imx in upstream but it can be done on > many soc versions. > Yeah, I am aware, I wasn't really trying to make it possible to configure IP block to be a EP, that is just an unavoidable consequence of the approach taken. > Looking at other pcie controllers (and dwc core) this is normally done > with a different compatible string with an "-ep" suffix. It feels wrong > to expose bitmasks and values directly in DT instead. > > For this patch you should probably just hardcode RC mode. Hmm, given how the mask/value have to be different for each controller, the only way to hardcode it that I can think of would be to change the property pass a bit offset instead of mask/value pair. Is that what you are suggesting? Thanks, Andrey Smirnov