Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1744691imu; Thu, 10 Jan 2019 02:13:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN4/DPQH9JWkKitw0JemJ1IVXIucecGGbNeKV56D1+Ku7mW/5Oujqp+8ZWU5m+KNrC7Xi+v5 X-Received: by 2002:a17:902:70c6:: with SMTP id l6mr9997542plt.30.1547115229911; Thu, 10 Jan 2019 02:13:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547115229; cv=none; d=google.com; s=arc-20160816; b=aVFP8No8hklcZuzaLlhTshm4zFrCFGmEXq7a1Y1SDbne9BvmjDKeX3ndjiLd0yLGmE 5umybUSUdNToCqgGe+ajKQNfF9iV9sUXtDzRLc3ky1k9VSVbCzd0L7PlL2lmqitMe+KL jiC2v87bf1Og+B+PTQH+n5eGt/TDJRy16D0CqVuoEXXmKO9XTiAY3UL/689aKlsKWxeW 3y0iQ0fF77nzs06YWMUfPGi2i0PoxeLh583LAIDHDO2X8O0RdNDbWBMBdMbO967O+H2C Xt+0aUj8aJuHWx65gZWiCLyud6AzbctL+MMYqfPVeBkg+fxE4ZTWc7VH7k18pK10Suxn zRwg== 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; bh=nuiAnG9udmSQFhkHXKdRb/DtpOfjAcWmd9LOQDGqChg=; b=NfPjqBlvPSZ3gbP6l12ZEJ+jfEfw9afCURxnk1kiDjRzFh6ieABBAMC3Rgd+bAOV+M fG4IxKN5q6b/B7bVqpL9f2zsnNO2IYdkO2DbeGW3IBYtNVCVJ4RS5e7a9vAaWiORXpuc hgo9n/K/hi7DPSdZiNojTSR7qWnfAlzx/3uqv2geCXwmWxFY36w8agUMjtHJSzi5N+ch WW2QCS6Uz1uM0bhtJXaF5f4UuTi6WD0oregltNT20Nvla5PIRyafbuYM9gCzkWMm386u FDARQe8loOM9vw9VC4uV5KpulVKqB9QCMrqFh+uKEJaBaUfBYD3Xk0lVi4KI99OXMaMT pcDA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f75si636026pff.131.2019.01.10.02.13.35; Thu, 10 Jan 2019 02:13:49 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728080AbfAJKK6 (ORCPT + 99 others); Thu, 10 Jan 2019 05:10:58 -0500 Received: from inva020.nxp.com ([92.121.34.13]:33172 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726925AbfAJKK6 (ORCPT ); Thu, 10 Jan 2019 05:10:58 -0500 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 Cc: leoyang.li@nxp.com, robh+dt@kernel.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, Peng Ma 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 1.7.1