Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4841845imm; Fri, 18 May 2018 11:34:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrjo1JMoQg0/liXcOrqINYWWb4Bj50Rxhnt7NEKX/CmC+XO1gqo9ONqaYDfL2jC3Tm5b0tV X-Received: by 2002:a65:4b02:: with SMTP id r2-v6mr8253428pgq.82.1526668496365; Fri, 18 May 2018 11:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526668496; cv=none; d=google.com; s=arc-20160816; b=b9aixQOxLuL5Di7/r08/lRwaDiZBpEpzssV7/DAw+JvmA4jnqNDQEsFZ4tJap5627P aVcQnkT+Rz8LRNGRmkQQoBXTC4Ap2rdzSzz8WFoIKDJuxsZZP8E0JVPpZ/HDpPrV9OpG 7fZodemqd4EimhbmZocq9gViSxW+RhH3ZBoU0yd7n3BUk5YpyuctbW7JnwYkWpuAmYuF h95zXDv9MFxJWGu490DQy8VmYf5uKdTQguOWWAo8B6YkSSJ47IVnUqC494bbctzaYT9p h9qB791nejnyouId0cyiDGlUL24G+IDFT/4kD6ax/GetTDiaaurEY2NfUvyWXP+Qi+va 8vAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=AUD2UPjFW/+1He/9rFSHKqvPj56fsyx7SITwYzI0Ts4=; b=lZT5sM7R1PN5HURCO5PNQh0uDNax8U/l7E9j+n2+KpFcZEngjsNai9sS65X+4lmkbW Vv+2eoYbPXpJQv5LGX6MIKXZ8sDSVdeKjmLr1qOw7tiKbBwVTiSOiJ23e+dlElPFJlkb tEJY+OMUIPE70elgzsgoZH0vU3Tohp9/4ejptoa87oi1JhQPYqemsgcuxQ6qTdjL6wQK NF3iqNh6rtzcWb8BhTOr7FVwXzRbbZSBgoQJP0I4jGNcDecz/sU0WiIDUJe/39eXkDgg 4siTSQi8BPJ+j5YjgGIiX6bKJpVWMBxr7KuCm+CGoj3t8KsFz/A+lJn7lfWMlJ+FGCxH ebvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=AglTtPwe; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7-v6si7618138plt.149.2018.05.18.11.34.41; Fri, 18 May 2018 11:34:56 -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=@broadcom.com header.s=google header.b=AglTtPwe; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752106AbeERSeY (ORCPT + 99 others); Fri, 18 May 2018 14:34:24 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:46053 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751891AbeERSeT (ORCPT ); Fri, 18 May 2018 14:34:19 -0400 Received: by mail-qt0-f193.google.com with SMTP id j42-v6so11475885qtj.12 for ; Fri, 18 May 2018 11:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=AUD2UPjFW/+1He/9rFSHKqvPj56fsyx7SITwYzI0Ts4=; b=AglTtPwe5jMbXBLbHSjDbgYE3jQk7UEmRh6CIPlAW0EOugRWmzC3oOh9hhbCQ/36S9 eSh4McalYD4gCQ4CcOOtP2D22HaUb4pTl5uWwrN2MsXQ348FRTPHWUAGYXMmc5NqkUuZ oJmv6mTbuDgeESK9s5JfIc0w+9BHTilZJeqRU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AUD2UPjFW/+1He/9rFSHKqvPj56fsyx7SITwYzI0Ts4=; b=MF05uqn4vEHpjZ/CQBoC3ZB3C/AJn8VWHyf55PjFgekBuhTm+Wf0jjJshO7Su0jHcG AuJJennRXRhM4JQJv44Ga9mlafRgnYp8YcGBrd8fW907uNqp1QYR9C4MQkIHLW4oiPuq fLPOXhNBOSgjaIT/LBVhz4Lcts3rA7FGa87DXQggBkipEzKBZ573V5GyyQzWaVgDNNxY 4jm8rMey62pc9mLinnvYDFXAhbYWAECxKVhzeDfwERv+omliu1HIX7FnUGqgfqvjfBha VVJ7svqjOhCzFlxWaX+BdEDM3alJpk7Up1vIhbp0C6JU1clY7HCKk+jsEYtIvClO17bu c1wQ== X-Gm-Message-State: ALKqPwf8GwQq5kSghc043U+zWm3CrAmpTd18tRNm3xf+g/JpL9dJPKEs n+8b6qGRXB4fdFzYXgejnFYzOQ== X-Received: by 2002:a0c:c242:: with SMTP id w2-v6mr9607945qvh.91.1526668458719; Fri, 18 May 2018 11:34:18 -0700 (PDT) Received: from lbrmn-lnxub113.ric.broadcom.com ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id q10-v6sm6257555qtk.7.2018.05.18.11.34.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 11:34:17 -0700 (PDT) From: Scott Branden To: Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , Ray Jui Cc: BCM Kernel Feedback , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Scott Branden Subject: [PATCH] arm64: dts: stingray: use NUM_SATA to configure number of sata ports Date: Fri, 18 May 2018 11:34:06 -0700 Message-Id: <1526668446-20048-1-git-send-email-scott.branden@broadcom.com> X-Mailer: git-send-email 2.5.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Scott Branden --- .../boot/dts/broadcom/stingray/bcm958742-base.dtsi | 64 -------------------- .../boot/dts/broadcom/stingray/bcm958742k.dts | 2 + .../boot/dts/broadcom/stingray/bcm958742t.dts | 2 + .../boot/dts/broadcom/stingray/stingray-sata.dtsi | 68 ++++++++++++++++++++++ 4 files changed, 72 insertions(+), 64 deletions(-) diff --git a/arch/arm64/boot/dts/broadcom/stingray/bcm958742-base.dtsi b/arch/arm64/boot/dts/broadcom/stingray/bcm958742-base.dtsi index 8862ec9..cacc25e 100644 --- a/arch/arm64/boot/dts/broadcom/stingray/bcm958742-base.dtsi +++ b/arch/arm64/boot/dts/broadcom/stingray/bcm958742-base.dtsi @@ -72,70 +72,6 @@ <0x00000008 0x80000000 0x1 0x80000000>; /* 6G @ 34G */ }; -&sata0 { - status = "okay"; -}; - -&sata_phy0{ - status = "okay"; -}; - -&sata1 { - status = "okay"; -}; - -&sata_phy1{ - status = "okay"; -}; - -&sata2 { - status = "okay"; -}; - -&sata_phy2{ - status = "okay"; -}; - -&sata3 { - status = "okay"; -}; - -&sata_phy3{ - status = "okay"; -}; - -&sata4 { - status = "okay"; -}; - -&sata_phy4{ - status = "okay"; -}; - -&sata5 { - status = "okay"; -}; - -&sata_phy5{ - status = "okay"; -}; - -&sata6 { - status = "okay"; -}; - -&sata_phy6{ - status = "okay"; -}; - -&sata7 { - status = "okay"; -}; - -&sata_phy7{ - status = "okay"; -}; - &mdio_mux_iproc { mdio@10 { gphy0: eth-phy@10 { diff --git a/arch/arm64/boot/dts/broadcom/stingray/bcm958742k.dts b/arch/arm64/boot/dts/broadcom/stingray/bcm958742k.dts index 77efa28..a515346 100644 --- a/arch/arm64/boot/dts/broadcom/stingray/bcm958742k.dts +++ b/arch/arm64/boot/dts/broadcom/stingray/bcm958742k.dts @@ -32,6 +32,8 @@ /dts-v1/; +#define NUM_SATA 8 + #include "bcm958742-base.dtsi" / { diff --git a/arch/arm64/boot/dts/broadcom/stingray/bcm958742t.dts b/arch/arm64/boot/dts/broadcom/stingray/bcm958742t.dts index 5084b03..6a4d19e 100644 --- a/arch/arm64/boot/dts/broadcom/stingray/bcm958742t.dts +++ b/arch/arm64/boot/dts/broadcom/stingray/bcm958742t.dts @@ -32,6 +32,8 @@ /dts-v1/; +#define NUM_SATA 8 + #include "bcm958742-base.dtsi" / { 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 sata0_port0: sata-port@0 { reg = <0>; @@ -58,7 +62,11 @@ reg-names = "phy"; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 0) + status = "okay"; +#else status = "disabled"; +#endif sata0_phy0: sata-phy@0 { reg = <0>; @@ -73,7 +81,11 @@ interrupts = ; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 1) + status = "okay"; +#else status = "disabled"; +#endif sata1_port0: sata-port@0 { reg = <0>; @@ -88,7 +100,11 @@ reg-names = "phy"; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 1) + status = "okay"; +#else status = "disabled"; +#endif sata1_phy0: sata-phy@0 { reg = <0>; @@ -103,7 +119,11 @@ interrupts = ; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 2) + status = "okay"; +#else status = "disabled"; +#endif sata2_port0: sata-port@0 { reg = <0>; @@ -118,7 +138,11 @@ reg-names = "phy"; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 2) + status = "okay"; +#else status = "disabled"; +#endif sata2_phy0: sata-phy@0 { reg = <0>; @@ -133,7 +157,11 @@ interrupts = ; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 3) + status = "okay"; +#else status = "disabled"; +#endif sata3_port0: sata-port@0 { reg = <0>; @@ -148,7 +176,11 @@ reg-names = "phy"; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 3) + status = "okay"; +#else status = "disabled"; +#endif sata3_phy0: sata-phy@0 { reg = <0>; @@ -163,7 +195,11 @@ interrupts = ; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 4) + status = "okay"; +#else status = "disabled"; +#endif sata4_port0: sata-port@0 { reg = <0>; @@ -178,7 +214,11 @@ reg-names = "phy"; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 4) + status = "okay"; +#else status = "disabled"; +#endif sata4_phy0: sata-phy@0 { reg = <0>; @@ -193,7 +233,11 @@ interrupts = ; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 5) + status = "okay"; +#else status = "disabled"; +#endif sata5_port0: sata-port@0 { reg = <0>; @@ -208,7 +252,11 @@ reg-names = "phy"; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 5) + status = "okay"; +#else status = "disabled"; +#endif sata5_phy0: sata-phy@0 { reg = <0>; @@ -223,7 +271,11 @@ interrupts = ; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 6) + status = "okay"; +#else status = "disabled"; +#endif sata6_port0: sata-port@0 { reg = <0>; @@ -238,7 +290,11 @@ reg-names = "phy"; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 6) + status = "okay"; +#else status = "disabled"; +#endif sata6_phy0: sata-phy@0 { reg = <0>; @@ -253,7 +309,11 @@ interrupts = ; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 7) + status = "okay"; +#else status = "disabled"; +#endif sata7_port0: sata-port@0 { reg = <0>; @@ -268,11 +328,19 @@ reg-names = "phy"; #address-cells = <1>; #size-cells = <0>; +#if (NUM_SATA > 7) + status = "okay"; +#else status = "disabled"; +#endif sata7_phy0: sata-phy@0 { reg = <0>; #phy-cells = <0>; }; }; + +#if (NUM_SATA > 8) +#error "NUM_SATA > 8" +#endif }; -- 2.5.0