Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5913970imm; Tue, 12 Jun 2018 15:55:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKqMPOzQiUPr+c2lONaJcps8/Ae1/CX7OHo4p2jNPfArblHUCsfPHmV/nU1LmLAFj7Kl2rs X-Received: by 2002:a62:be0a:: with SMTP id l10-v6mr2281852pff.180.1528844154442; Tue, 12 Jun 2018 15:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528844154; cv=none; d=google.com; s=arc-20160816; b=v58f9s2PbvciOWMK+VNaEsfrnKCeQkAfFWAh2U/gJeVgUqMYZAjPZ3Bk0emaiTR9jp MX8O7iFuLivLlmkQxVUCbMp1DhYUcW9vgea7R1+4Tj8QjEYg/zEk3aIZYe7qPjLDIIZD o0p7maiJ3e0SHLlOgrYB/tzYl9RBzMb4e17kT1ENCnUveedNpX65QRauRJy7wpDiPxiX z2Lf3sgpjrTxBceihVKL0zVqmkOB8pbZ/+CHDKp9fWl2c6W7+S6DqqSKL2FovX90YPgy +vO0JVyW5RPdDVmeMwmPG5JsNx4YzhtS3Au5E65VSTE9xwegplDzXNqRGbfrAJVL3xlV 8J1A== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=a2kZFLzq3CjDEiCxUkVQVbgRhYgS0PCzn5WcXo/m9co=; b=bbXij7vK+mQcXx0a3z8hDnImfnTB2QU4sTRVEr7FB24OHx5Q3YWIYDKQZuzsiuLyh8 Kr7bzdCUM586RJ3YOes7OpVg8uEpQhcAGzCvKmj/O5ixlqCH66C/tpR4igPHgyq+hljb 1W7SsOBCUMyByM8Xhx9gRf2JWBsbxW3ygWv3+2k+vgBUHzOZEW2Arz38v1uZnuik5bYT StPNvihDqglqXhR+mevs4Ps17QT1DyKc2+7DFTWStHTbdISmFDWEmgxfqwx/uNMa1BAu Fxb9zGxubvnw5Ld2B65Wi6o3OTV/37gFWiSAwRE8dOKBGwFBPNVH1iTG3YJ7OndB3uTb 6MyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=C1IIwlqc; 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 i64-v6si963785pgc.673.2018.06.12.15.55.40; Tue, 12 Jun 2018 15:55:54 -0700 (PDT) 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=C1IIwlqc; 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 S934995AbeFLWzS (ORCPT + 99 others); Tue, 12 Jun 2018 18:55:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:44804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934002AbeFLWzR (ORCPT ); Tue, 12 Jun 2018 18:55:17 -0400 Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) (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 736E320891; Tue, 12 Jun 2018 22:55:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528844116; bh=r4QQnRnvReWaqntBLAoK4hGSb7FIkH6CyMjKOj+qyj8=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=C1IIwlqcqG6kPNl6YhWmT5XCE304nZGhfz+0lH4uKRqIrS1Dp6JSAPNr/hhwmxnHS i/v185YdBijPOtPBV1geeN60TS6sQrWOaC86Rz2+eY+I3Imi43M/vlmXEeygOOXkh6 i1RGfsGi2e+wpt6qsMdT6z2ZgI7Y6/Pe9HzOJVA4= Received: by mail-it0-f52.google.com with SMTP id k17-v6so15433990ita.0; Tue, 12 Jun 2018 15:55:16 -0700 (PDT) X-Gm-Message-State: APt69E0bpnwcYmn4BFWps+NrT8AUGo/KLvDNlbDpzhrcrdTlCT2by/ef CQnh/5XHgDTJ0/7ez1a5gVfp/uMF9m+Ao3yknw== X-Received: by 2002:a24:f04e:: with SMTP id p14-v6mr2459181iti.106.1528844115907; Tue, 12 Jun 2018 15:55:15 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:6403:0:0:0:0:0 with HTTP; Tue, 12 Jun 2018 15:54:55 -0700 (PDT) In-Reply-To: <395f1fe8-76f1-8310-d09e-63e25bca23d2@broadcom.com> References: <1526668446-20048-1-git-send-email-scott.branden@broadcom.com> <395f1fe8-76f1-8310-d09e-63e25bca23d2@broadcom.com> From: Rob Herring Date: Tue, 12 Jun 2018 16:54:55 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arm64: dts: stingray: use NUM_SATA to configure number of sata ports To: Scott Branden Cc: Florian Fainelli , Mark Rutland , Catalin Marinas , Will Deacon , Ray Jui , BCM Kernel Feedback , devicetree@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "linux-kernel@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 Thu, Jun 7, 2018 at 12:53 PM, Scott Branden wrote: > Hi Rob, > > Could you please kindly comment on change below. > > It allows board variants to be added easily via a simple define for > different number of SATA ports. > > > > On 18-06-04 09:22 AM, Florian Fainelli wrote: >> >> On 05/18/2018 11:34 AM, Scott Branden wrote: >>> >>> Move remaining sata configuration to stingray-sata.dtsi and enable >>> ports based on NUM_SATA defined. >>> Now, all that needs to be done is define NUM_SATA per board. >> >> Rob could you review this and let us know if this approach is okay or >> not? Thank you! >> >>> Signed-off-by: Scott Branden >>> --- >>> diff --git a/arch/arm64/boot/dts/broadcom/stingray/stingray-sata.dtsi >>> b/arch/arm64/boot/dts/broadcom/stingray/stingray-sata.dtsi >>> index 8c68e0c..7f6d176 100644 >>> --- a/arch/arm64/boot/dts/broadcom/stingray/stingray-sata.dtsi >>> +++ b/arch/arm64/boot/dts/broadcom/stingray/stingray-sata.dtsi >>> @@ -43,7 +43,11 @@ >>> interrupts = ; >>> #address-cells = <1>; >>> #size-cells = <0>; >>> +#if (NUM_SATA > 0) >>> + status = "okay"; >>> +#else >>> status = "disabled"; >>> +#endif This only works if ports are contiguously enabled (0-N). You might not care, but it is not a pattern that works in general. And I'm not a fan of C preprocessing in DT files in general beyond just defines for single numbers. Rob