ipq806x: remove outdated patches
This commit is contained in:
parent
f05a276d39
commit
c91eb2a930
@ -1,6 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2016 lede-project.org
|
||||
# Copyright (C) 2020 AnYun
|
||||
#
|
||||
|
||||
ruijie_do_flash() {
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
CONFIG_AHCI_IPQ=y
|
||||
CONFIG_ALIGNMENT_TRAP=y
|
||||
# CONFIG_AMBA_PL08X is not set
|
||||
# CONFIG_APQ_GCC_8084 is not set
|
||||
|
||||
@ -1,308 +0,0 @@
|
||||
From c5ea64dcf7b5d45e402e78b9f291d521669b7b80 Mon Sep 17 00:00:00 2001
|
||||
From: Kumar Gala <galak@codeaurora.org>
|
||||
Date: Fri, 30 May 2014 15:35:40 -0500
|
||||
Subject: [PATCH] ata: Add Qualcomm ARM SoC AHCI SATA host controller driver
|
||||
|
||||
Add support for the Qualcomm AHCI SATA controller that exists on several
|
||||
SoC and specifically the IPQ806x family of chips. The IPQ806x SATA support
|
||||
requires the associated IPQ806x SATA PHY Driver to be enabled as well.
|
||||
|
||||
Signed-off-by: Kumar Gala <galak@codeaurora.org>
|
||||
Signed-off-by: Gokul Sriram Palanisamy <gpalan@codeaurora.org>
|
||||
---
|
||||
drivers/ata/ahci.h | 2 +-
|
||||
drivers/ata/ahci_ipq.c | 248 ++++++++++++++++++++++++++++++++++++++
|
||||
drivers/ata/Kconfig | 8 ++++++++
|
||||
drivers/ata/Makefile | 1 +
|
||||
4 files changed, 258 insertions(+), 1 deletions(-)
|
||||
create mode 100644 drivers/ata/ahci_ipq.c
|
||||
|
||||
--- a/drivers/ata/ahci.h
|
||||
+++ b/drivers/ata/ahci.h
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
enum {
|
||||
AHCI_MAX_PORTS = 32,
|
||||
- AHCI_MAX_CLKS = 5,
|
||||
+ AHCI_MAX_CLKS = 6,
|
||||
AHCI_MAX_SG = 168, /* hardware max is 64K */
|
||||
AHCI_DMA_BOUNDARY = 0xffffffff,
|
||||
AHCI_MAX_CMDS = 32,
|
||||
--- /dev/null
|
||||
+++ b/drivers/ata/ahci_ipq.c
|
||||
@@ -0,0 +1,248 @@
|
||||
+/* Copyright (c) 2015 - 2017, The Linux Foundation. All rights reserved.
|
||||
+ *
|
||||
+ * Permission to use, copy, modify, and/or distribute this software for any
|
||||
+ * purpose with or without fee is hereby granted, provided that the above
|
||||
+ * copyright notice and this permission notice appear in all copies.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/pm.h>
|
||||
+#include <linux/device.h>
|
||||
+#include <linux/of_device.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/libata.h>
|
||||
+#include <linux/ahci_platform.h>
|
||||
+#include <linux/acpi.h>
|
||||
+#include <linux/pci_ids.h>
|
||||
+#include "libata.h"
|
||||
+#include "ahci.h"
|
||||
+
|
||||
+#define IPQ_DRV_NAME "ahci-ipq"
|
||||
+
|
||||
+struct ipq_ahci_priv {
|
||||
+ struct platform_device *ahci_pdev;
|
||||
+ struct ahci_host_priv *hpriv;
|
||||
+ void *preg_reset;
|
||||
+ int pstate;
|
||||
+};
|
||||
+
|
||||
+struct ipq_ahci_priv *ipqpriv;
|
||||
+
|
||||
+static const struct ata_port_info ipq_ahci_port_info = {
|
||||
+ .flags = AHCI_FLAG_COMMON,
|
||||
+ .pio_mask = ATA_PIO4,
|
||||
+ .udma_mask = ATA_UDMA6,
|
||||
+ .port_ops = &ahci_platform_ops,
|
||||
+};
|
||||
+
|
||||
+static struct scsi_host_template ahci_platform_sht = {
|
||||
+ AHCI_SHT(IPQ_DRV_NAME),
|
||||
+};
|
||||
+
|
||||
+#define SATA_PWR_STATE_DOWN 0x1
|
||||
+#define SATA_PWR_STATE_UP 0x2
|
||||
+#define SATA_RESET 0x00902c1c
|
||||
+
|
||||
+static void ipq_ahci_hard_reset(struct device *dev)
|
||||
+{
|
||||
+ u32 reg;
|
||||
+
|
||||
+ reg = readl_relaxed(ipqpriv->preg_reset);
|
||||
+ writel_relaxed(reg | BIT(0), ipqpriv->preg_reset);
|
||||
+ /* To make sure the write is complete before we move on */
|
||||
+ mb();
|
||||
+
|
||||
+ reg = readl_relaxed(ipqpriv->preg_reset);
|
||||
+ writel_relaxed(reg & (~BIT(0)), ipqpriv->preg_reset);
|
||||
+ /* To make sure the write is complete before we move on */
|
||||
+ mb();
|
||||
+}
|
||||
+
|
||||
+static int ipq_ahci_suspend(struct device *dev)
|
||||
+{
|
||||
+ struct ata_host *host = dev_get_drvdata(dev);
|
||||
+ struct device_type *apt = &ata_port_type;
|
||||
+ const struct dev_pm_ops *pm = apt->pm;
|
||||
+ struct ata_port *ap;
|
||||
+ int ret = 0, i;
|
||||
+
|
||||
+ if (ipqpriv->pstate == SATA_PWR_STATE_UP) {
|
||||
+ for (i = 0; i < host->n_ports; i++) {
|
||||
+ ap = host->ports[i];
|
||||
+ /* Issue Port PM Suspend */
|
||||
+ ret = pm->runtime_suspend(&ap->tdev);
|
||||
+ if (ret) {
|
||||
+ dev_err(dev, "SATA controller port suspend failed\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* Issue Contoller PM Suspend */
|
||||
+ ret = ahci_platform_suspend_host(dev);
|
||||
+ if (ret) {
|
||||
+ dev_err(dev, "SATA controller host suspend failed\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < ipqpriv->hpriv->nports; i++) {
|
||||
+ if (!ipqpriv->hpriv->phys[i])
|
||||
+ continue;
|
||||
+
|
||||
+ phy_power_off(ipqpriv->hpriv->phys[i]);
|
||||
+ phy_exit(ipqpriv->hpriv->phys[i]);
|
||||
+ }
|
||||
+
|
||||
+ ahci_platform_disable_clks(ipqpriv->hpriv);
|
||||
+ ipqpriv->pstate = SATA_PWR_STATE_DOWN;
|
||||
+ } else {
|
||||
+ dev_warn(dev, "SATA device already in suspended state");
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int ipq_ahci_resume(struct device *dev)
|
||||
+{
|
||||
+ struct ata_host *host = dev_get_drvdata(dev);
|
||||
+ struct device_type *apt = &ata_port_type;
|
||||
+ const struct dev_pm_ops *pm = apt->pm;
|
||||
+ struct ata_port *ap;
|
||||
+ int ret = 0, i;
|
||||
+
|
||||
+ if (ipqpriv->pstate == SATA_PWR_STATE_DOWN) {
|
||||
+
|
||||
+ ahci_platform_enable_clks(ipqpriv->hpriv);
|
||||
+
|
||||
+ /* Issue SATA clock hard reset */
|
||||
+ ipq_ahci_hard_reset(dev);
|
||||
+
|
||||
+ for (i = 0; i < ipqpriv->hpriv->nports; i++) {
|
||||
+ if (!ipqpriv->hpriv->phys[i])
|
||||
+ continue;
|
||||
+
|
||||
+ phy_init(ipqpriv->hpriv->phys[i]);
|
||||
+ phy_power_on(ipqpriv->hpriv->phys[i]);
|
||||
+ }
|
||||
+
|
||||
+ /* Issue Contoller PM Resume */
|
||||
+ ret = ahci_platform_resume_host(dev);
|
||||
+ if (ret) {
|
||||
+ dev_err(dev, "SATA controller resume failed\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < host->n_ports; i++) {
|
||||
+ /* Issue Port PM Resume */
|
||||
+ ap = host->ports[i];
|
||||
+ ret = pm->runtime_resume(&ap->tdev);
|
||||
+ if (ret) {
|
||||
+ dev_err(dev, "SATA controller port resume failed\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ }
|
||||
+ ipqpriv->pstate = SATA_PWR_STATE_UP;
|
||||
+ } else {
|
||||
+ dev_warn(dev, "SATA device already in resume state");
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int ipq_ahci_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct ahci_host_priv *hpriv;
|
||||
+ int rc;
|
||||
+
|
||||
+ hpriv = ahci_platform_get_resources(pdev);
|
||||
+ if (IS_ERR(hpriv))
|
||||
+ return PTR_ERR(hpriv);
|
||||
+
|
||||
+ rc = ahci_platform_enable_resources(hpriv);
|
||||
+ if (rc)
|
||||
+ return rc;
|
||||
+
|
||||
+ of_property_read_u32(dev->of_node,
|
||||
+ "ports-implemented", &hpriv->force_port_map);
|
||||
+
|
||||
+ rc = ahci_platform_init_host(pdev, hpriv, &ipq_ahci_port_info,
|
||||
+ &ahci_platform_sht);
|
||||
+
|
||||
+ if (rc)
|
||||
+ goto disable_resources;
|
||||
+
|
||||
+ ipqpriv = devm_kzalloc(dev, sizeof(*ipqpriv), GFP_KERNEL);
|
||||
+ if (!ipqpriv) {
|
||||
+ dev_err(dev, "can't alloc ahci_host_priv\n");
|
||||
+ rc = -ENOMEM;
|
||||
+ goto disable_resources;
|
||||
+ }
|
||||
+
|
||||
+ ipqpriv->ahci_pdev = pdev;
|
||||
+ ipqpriv->hpriv = hpriv;
|
||||
+ ipqpriv->pstate = SATA_PWR_STATE_UP;
|
||||
+
|
||||
+ ipqpriv->preg_reset = devm_ioremap(dev, SATA_RESET,
|
||||
+ sizeof(*(ipqpriv->preg_reset)));
|
||||
+
|
||||
+ if (IS_ERR(ipqpriv->preg_reset)) {
|
||||
+ dev_err(dev, "can't ioremap for preg_reset\n");
|
||||
+ rc = -ENOMEM;
|
||||
+ goto disable_resources;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+ disable_resources:
|
||||
+ ahci_platform_disable_resources(hpriv);
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+int ipq_ahci_remove(struct platform_device *pdev)
|
||||
+{
|
||||
+ ata_platform_remove_one(pdev);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static SIMPLE_DEV_PM_OPS(ipq_ahci_pm_ops, ahci_platform_suspend,
|
||||
+ ahci_platform_resume);
|
||||
+
|
||||
+static const struct of_device_id ipq_ahci_of_match[] = {
|
||||
+ { .compatible = "qcom,ipq806x-ahci", },
|
||||
+ {},
|
||||
+};
|
||||
+
|
||||
+MODULE_DEVICE_TABLE(of, ipq_ahci_of_match);
|
||||
+
|
||||
+static const struct acpi_device_id ahci_acpi_match[] = {
|
||||
+ { ACPI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff) },
|
||||
+ {},
|
||||
+};
|
||||
+
|
||||
+MODULE_DEVICE_TABLE(acpi, ahci_acpi_match);
|
||||
+
|
||||
+static struct platform_driver ipq_ahci_driver = {
|
||||
+ .probe = ipq_ahci_probe,
|
||||
+ .remove = ipq_ahci_remove,
|
||||
+ .driver = {
|
||||
+ .name = IPQ_DRV_NAME,
|
||||
+ .of_match_table = ipq_ahci_of_match,
|
||||
+ .acpi_match_table = ahci_acpi_match,
|
||||
+ .pm = &ipq_ahci_pm_ops,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+module_platform_driver(ipq_ahci_driver);
|
||||
+
|
||||
+MODULE_DESCRIPTION("IPQ806x AHCI SATA platform driver");
|
||||
+MODULE_ALIAS("platform:ahci-ipq");
|
||||
+MODULE_LICENSE("Dual BSD/GPL");
|
||||
--- a/drivers/ata/Kconfig
|
||||
+++ b/drivers/ata/Kconfig
|
||||
@@ -162,6 +162,14 @@ config AHCI_IMX
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
+config AHCI_IPQ
|
||||
+ tristate "Qualcomm Atheros IPQ806X AHCI SATA support"
|
||||
+ help
|
||||
+ This option enables support for the IPQ806X SoC's
|
||||
+ onboard AHCI SATA.
|
||||
+
|
||||
+ If unsure, say N.
|
||||
+
|
||||
config AHCI_CEVA
|
||||
tristate "CEVA AHCI SATA support"
|
||||
depends on OF
|
||||
--- a/drivers/ata/Makefile
|
||||
+++ b/drivers/ata/Makefile
|
||||
@@ -18,6 +18,7 @@ obj-$(CONFIG_AHCI_CEVA) += ahci_ceva.o
|
||||
obj-$(CONFIG_AHCI_DA850) += ahci_da850.o libahci.o libahci_platform.o
|
||||
obj-$(CONFIG_AHCI_DM816) += ahci_dm816.o libahci.o libahci_platform.o
|
||||
obj-$(CONFIG_AHCI_IMX) += ahci_imx.o libahci.o libahci_platform.o
|
||||
+obj-$(CONFIG_AHCI_IPQ) += ahci_ipq.o libahci.o libahci_platform.o
|
||||
obj-$(CONFIG_AHCI_MTK) += ahci_mtk.o libahci.o libahci_platform.o
|
||||
obj-$(CONFIG_AHCI_MVEBU) += ahci_mvebu.o libahci.o libahci_platform.o
|
||||
obj-$(CONFIG_AHCI_OCTEON) += ahci_octeon.o
|
||||
Loading…
Reference in New Issue
Block a user