From patchwork Thu Jan 10 10:05:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Ma X-Patchwork-Id: 10755493 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E04DD6C2 for ; Thu, 10 Jan 2019 10:11:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDD3D2943F for ; Thu, 10 Jan 2019 10:11:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C22F529447; Thu, 10 Jan 2019 10:11:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 657D42943F for ; Thu, 10 Jan 2019 10:11:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=Mw/GhBemX+v2Z0sIMKSKpNScXUKVEb2s7UdiMvvm32g=; b=UUC W3N54Ko74czVfWbAmlgO4I4WPvVC1FlZg6R1m1TYdIcjh8VQlvS7LtVk5ccS2yyzXMyr8xw1OKuar Lz5UEXkUgJ2lUwNpAcWswMSQqcp3YOOoiBmTvBnIM0TVjVaMm0331e38480xbxK+q7jTc60XoDCdr Rb+4T4p8AxZX72M961UG3nE62696LAc2jMy+qzoe7JBFzATnSEN61z481vEhRBsCk94AWLmrNYc47 aVGpYDlxKrQNKPpmPsfPvwiltvz6effplYjYmPbHol4tESOGP2lAt1vITkOvUH0OeZWOTdE1BUZXl Tj1QrjqH11/GbaDtCPRp/4AiIZO414w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghXIv-0006AC-J4; Thu, 10 Jan 2019 10:11:13 +0000 Received: from inva020.nxp.com ([92.121.34.13]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghXIg-0005vt-HU for linux-arm-kernel@lists.infradead.org; Thu, 10 Jan 2019 10:11:01 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 1D4831A03BF; Thu, 10 Jan 2019 11:10:55 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 28CA71A0092; Thu, 10 Jan 2019 11:10:50 +0100 (CET) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 14232402C0; Thu, 10 Jan 2019 18:10:44 +0800 (SGT) From: Peng Ma To: shawnguo@kernel.org, axboe@kernel.dk Subject: [PATCH 1/2] ahci: qoriq: add lx2160 platforms support Date: Thu, 10 Jan 2019 18:05:32 +0800 Message-Id: <20190110100533.33333-1-peng.ma@nxp.com> X-Mailer: git-send-email 2.14.1 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190110_021058_862995_F5698A75 X-CRM114-Status: UNSURE ( 9.71 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, Peng Ma , linux-kernel@vger.kernel.org, leoyang.li@nxp.com, linux-ide@vger.kernel.org, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Lx2160a is a new introduced soc which supports ATA3.0 and Clean up some code Signed-off-by: Peng Ma --- drivers/ata/ahci_qoriq.c | 44 ++++++++++++-------------------------------- 1 files changed, 12 insertions(+), 32 deletions(-) diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c index ce59253..1994bf2 100644 --- a/drivers/ata/ahci_qoriq.c +++ b/drivers/ata/ahci_qoriq.c @@ -57,7 +57,7 @@ enum ahci_qoriq_type { AHCI_LS2080A, AHCI_LS1046A, AHCI_LS1088A, - AHCI_LS2088A, + AHCI_LX2160A, }; struct ahci_qoriq_priv { @@ -73,7 +73,7 @@ struct ahci_qoriq_priv { { .compatible = "fsl,ls2080a-ahci", .data = (void *)AHCI_LS2080A}, { .compatible = "fsl,ls1046a-ahci", .data = (void *)AHCI_LS1046A}, { .compatible = "fsl,ls1088a-ahci", .data = (void *)AHCI_LS1088A}, - { .compatible = "fsl,ls2088a-ahci", .data = (void *)AHCI_LS2088A}, + { .compatible = "fsl,lx2160a-ahci", .data = (void *)AHCI_LX2160A}, {}, }; MODULE_DEVICE_TABLE(of, ahci_qoriq_of_match); @@ -174,12 +174,10 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv) writel(LS1021A_PORT_PHY4, reg_base + PORT_PHY4); writel(LS1021A_PORT_PHY5, reg_base + PORT_PHY5); writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); - if (qpriv->is_dmacoherent) - writel(AHCI_PORT_AXICC_CFG, - reg_base + LS1021A_AXICC_ADDR); break; case AHCI_LS1043A: + case AHCI_LS1046A: if (!qpriv->ecc_addr) return -EINVAL; writel(readl(qpriv->ecc_addr) | ECC_DIS_ARMV8_CH2, @@ -188,8 +186,6 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv) writel(AHCI_PORT_PHY2_CFG, reg_base + PORT_PHY2); writel(AHCI_PORT_PHY3_CFG, reg_base + PORT_PHY3); writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); - if (qpriv->is_dmacoherent) - writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); break; case AHCI_LS2080A: @@ -197,24 +193,10 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv) writel(AHCI_PORT_PHY2_CFG, reg_base + PORT_PHY2); writel(AHCI_PORT_PHY3_CFG, reg_base + PORT_PHY3); writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); - if (qpriv->is_dmacoherent) - writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); - break; - - case AHCI_LS1046A: - if (!qpriv->ecc_addr) - return -EINVAL; - writel(readl(qpriv->ecc_addr) | ECC_DIS_ARMV8_CH2, - qpriv->ecc_addr); - writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1); - writel(AHCI_PORT_PHY2_CFG, reg_base + PORT_PHY2); - writel(AHCI_PORT_PHY3_CFG, reg_base + PORT_PHY3); - writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); - if (qpriv->is_dmacoherent) - writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); break; case AHCI_LS1088A: + case AHCI_LX2160A: if (!qpriv->ecc_addr) return -EINVAL; writel(readl(qpriv->ecc_addr) | ECC_DIS_LS1088A, @@ -223,18 +205,16 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv) writel(AHCI_PORT_PHY2_CFG, reg_base + PORT_PHY2); writel(AHCI_PORT_PHY3_CFG, reg_base + PORT_PHY3); writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); - if (qpriv->is_dmacoherent) - writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); break; + } - case AHCI_LS2088A: - writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1); - writel(AHCI_PORT_PHY2_CFG, reg_base + PORT_PHY2); - writel(AHCI_PORT_PHY3_CFG, reg_base + PORT_PHY3); - writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); - if (qpriv->is_dmacoherent) - writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC); - break; + if (qpriv->is_dmacoherent) { + if (qpriv->type == AHCI_LS1021A) + writel(AHCI_PORT_AXICC_CFG, + reg_base + LS1021A_AXICC_ADDR); + else + writel(AHCI_PORT_AXICC_CFG, + reg_base + PORT_AXICC); } return 0; From patchwork Thu Jan 10 10:05:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Ma X-Patchwork-Id: 10755491 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 455A56C2 for ; Thu, 10 Jan 2019 10:11:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3301E2943F for ; Thu, 10 Jan 2019 10:11:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24B7C29447; Thu, 10 Jan 2019 10:11:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ADE9B2943F for ; Thu, 10 Jan 2019 10:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=w7xTYP+J1kJU+uceOCiZBU3rWIL/dS00NjH+7+wu9gw=; b=UE/LoN4ur0mlx3wFSszBgAUBNI 7Dx0jdt3/Sw98SVnQpLFDesqlzTaTRUtIYmHm0QWJabiVScMCNwhgD6ZSjE+6i8AhM4mnWzxnF6Vq YzJrC+X85hx5wrlmYz29+7Loo075sEXwg81F5oOgCHp08YW1LPQtrF70mKaObbAg8yiOtm41YGOVm 82lbDpCeoW8BCFH2KJ0R8UhwsRoEw2zdOtAztJmH9tVKCI73fvsvOwmu5Q61oivY2PSFYDIimbNYT Rmrk/OTrgdPohp/eC41VPz3/Fa/tBY3ZMk1bzeV/3bt98qfklsboJpcjKAiZ24kS+QEaKKnnfuP88 wAwXThzA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghXIk-0005x0-A9; Thu, 10 Jan 2019 10:11:02 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghXIh-0005vx-5n for linux-arm-kernel@lists.infradead.org; Thu, 10 Jan 2019 10:11:00 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E96502000B9; Thu, 10 Jan 2019 11:10:55 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 3C4DB200059; Thu, 10 Jan 2019 11:10:51 +0100 (CET) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 2569D402C8; Thu, 10 Jan 2019 18:10:45 +0800 (SGT) From: Peng Ma To: shawnguo@kernel.org, axboe@kernel.dk Subject: [PATCH 2/2] arm64: dts: lx2160a: add sata node support Date: Thu, 10 Jan 2019 18:05:33 +0800 Message-Id: <20190110100533.33333-2-peng.ma@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190110100533.33333-1-peng.ma@nxp.com> References: <20190110100533.33333-1-peng.ma@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190110_021059_349793_34CA3E64 X-CRM114-Status: UNSURE ( 8.68 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, Peng Ma , linux-kernel@vger.kernel.org, leoyang.li@nxp.com, linux-ide@vger.kernel.org, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add sata node support and Enable sata support Signed-off-by: Peng Ma --- arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts | 16 +++++++ arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 44 +++++++++++++++++++++ 2 files changed, 60 insertions(+), 0 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts index 6481e5f..aacca27 100644 --- a/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts +++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a-rdb.dts @@ -117,3 +117,19 @@ &usb1 { status = "okay"; }; + +&sata0 { + status = "okay"; +}; + +&sata1 { + status = "okay"; +}; + +&sata2 { + status = "okay"; +}; + +&sata3 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi index a79f5c1..e857a14 100644 --- a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi @@ -762,5 +762,49 @@ ; dma-coherent; }; + + sata0: sata@3200000 { + status = "disabled"; + compatible = "fsl,lx2160a-ahci"; + reg = <0x0 0x3200000 0x0 0x10000>, + <0x7 0x100520 0x0 0x4>; + reg-names = "ahci", "sata-ecc"; + interrupts = ; + clocks = <&clockgen 4 3>; + dma-coherent; + }; + + sata1: sata@3210000 { + status = "disabled"; + compatible = "fsl,lx2160a-ahci"; + reg = <0x0 0x3210000 0x0 0x10000>, + <0x7 0x100520 0x0 0x4>; + reg-names = "ahci", "sata-ecc"; + interrupts = ; + clocks = <&clockgen 4 3>; + dma-coherent; + }; + + sata2: sata@3220000 { + status = "disabled"; + compatible = "fsl,lx2160a-ahci"; + reg = <0x0 0x3220000 0x0 0x10000>, + <0x7 0x100520 0x0 0x4>; + reg-names = "ahci", "sata-ecc"; + interrupts = ; + clocks = <&clockgen 4 3>; + dma-coherent; + }; + + sata3: sata@3230000 { + status = "disabled"; + compatible = "fsl,lx2160a-ahci"; + reg = <0x0 0x3230000 0x0 0x10000>, + <0x7 0x100520 0x0 0x4>; + reg-names = "ahci", "sata-ecc"; + interrupts = ; + clocks = <&clockgen 4 3>; + dma-coherent; + }; }; };