From a297ec8e13d10274155e0850228bb06c7648e541 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sat, 30 Aug 2014 09:32:58 +0000 Subject: ipq806x: Add support for IPQ806x chip family Patches are generated using the "format-patch" command from the following location: *https://www.codeaurora.org/cgit/quic/kernel/galak-msm/log/?h=apq_ipq_base *rev=0771849495b4128cac2faf7d49c85c729fc48b20 Patches numbered 76/77/102/103 have already been integrated in 3.14.12, so they're not in this list. All these patches are either integrated are pending integration into kernel.org, therefore these patches should go away once the kernel gets upgraded to 3.16. Support is currently limited to AP148 board but can be extended to other platforms in the future. These changes do not cover ethernet connectivity. Signed-off-by: Mathieu Olivari git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42334 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../0153-soc-qcom-tcsr-Add-TCSR-driver.patch | 169 +++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 target/linux/ipq806x/patches/0153-soc-qcom-tcsr-Add-TCSR-driver.patch (limited to 'target/linux/ipq806x/patches/0153-soc-qcom-tcsr-Add-TCSR-driver.patch') diff --git a/target/linux/ipq806x/patches/0153-soc-qcom-tcsr-Add-TCSR-driver.patch b/target/linux/ipq806x/patches/0153-soc-qcom-tcsr-Add-TCSR-driver.patch new file mode 100644 index 0000000000..03b65e6872 --- /dev/null +++ b/target/linux/ipq806x/patches/0153-soc-qcom-tcsr-Add-TCSR-driver.patch @@ -0,0 +1,169 @@ +From 0b469f3f4c0e6a0e0b1b60a059600e325a03b6f5 Mon Sep 17 00:00:00 2001 +From: Andy Gross +Date: Thu, 12 Jun 2014 00:52:06 -0500 +Subject: [PATCH 153/182] soc: qcom: tcsr: Add TCSR driver + +This patch adds support for the TCSR IP block present in Qualcomm processors. + +Signed-off-by: Andy Gross +--- + .../devicetree/bindings/soc/qcom/qcom,tcsr.txt | 25 ++++++++ + drivers/soc/qcom/Kconfig | 6 ++ + drivers/soc/qcom/Makefile | 1 + + drivers/soc/qcom/qcom_tcsr.c | 64 ++++++++++++++++++++ + include/dt-bindings/soc/qcom,tcsr.h | 19 ++++++ + 5 files changed, 115 insertions(+) + create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,tcsr.txt + create mode 100644 drivers/soc/qcom/qcom_tcsr.c + create mode 100644 include/dt-bindings/soc/qcom,tcsr.h + +diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,tcsr.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,tcsr.txt +new file mode 100644 +index 0000000..6ea74c1 +--- /dev/null ++++ b/Documentation/devicetree/bindings/soc/qcom/qcom,tcsr.txt +@@ -0,0 +1,25 @@ ++QCOM TCSR (Top Control and Status Register) Driver ++ ++The TCSR provides miscellaneous control functions and status registers for ++Qualcomm processors. ++ ++Required properties: ++- compatible: must contain "qcom,tcsr" for IPQ806x ++- reg: Address range for TCSR registers ++ ++Optional properties: ++- qcom,usb-ctrl-select : indicates USB port type selection. Please reference ++ dt-bindings/soc/qcom,tcsr.h for valid USB port selection values. ++ ++Example for IPQ8064: ++ ++#include ++ ++ tcsr: tcsr@1a400000 { ++ compatible = "qcom,tcsr"; ++ reg = <0x1a400000 0x100>; ++ ++ qcom,usb-ctrl-select = ; ++ }; ++ ++ +diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig +index 7bd2c94..3e4486a 100644 +--- a/drivers/soc/qcom/Kconfig ++++ b/drivers/soc/qcom/Kconfig +@@ -9,3 +9,9 @@ config QCOM_GSBI + functions for connecting the underlying serial UART, SPI, and I2C + devices to the output pins. + ++config QCOM_TCSR ++ tristate "QCOM Top Control and Status Registers" ++ depends on ARCH_QCOM ++ help ++ Say y here to enable TCSR support. The TCSR provides control ++ functions for various peripherals. +diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile +index 4389012..d299492 100644 +--- a/drivers/soc/qcom/Makefile ++++ b/drivers/soc/qcom/Makefile +@@ -1 +1,2 @@ + obj-$(CONFIG_QCOM_GSBI) += qcom_gsbi.o ++obj-$(CONFIG_QCOM_TCSR) += qcom_tcsr.o +diff --git a/drivers/soc/qcom/qcom_tcsr.c b/drivers/soc/qcom/qcom_tcsr.c +new file mode 100644 +index 0000000..dd33153 +--- /dev/null ++++ b/drivers/soc/qcom/qcom_tcsr.c +@@ -0,0 +1,64 @@ ++/* ++ * Copyright (c) 2014, The Linux foundation. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License rev 2 and ++ * only rev 2 as published by the free Software foundation. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or fITNESS fOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define TCSR_USB_PORT_SEL 0xb0 ++ ++static int tcsr_probe(struct platform_device *pdev) ++{ ++ struct resource *res; ++ const struct device_node *node = pdev->dev.of_node; ++ void __iomem *base; ++ u32 val; ++ ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ base = devm_ioremap_resource(&pdev->dev, res); ++ if (IS_ERR(base)) ++ return PTR_ERR(base); ++ ++ if (!of_property_read_u32(node, "qcom,usb-ctrl-select", &val)) { ++ dev_err(&pdev->dev, "setting usb port select = %d\n", val); ++ writel(val, base + TCSR_USB_PORT_SEL); ++ } ++ ++ return 0; ++} ++ ++static const struct of_device_id tcsr_dt_match[] = { ++ { .compatible = "qcom,tcsr", }, ++ { }, ++}; ++ ++MODULE_DEVICE_TABLE(of, tcsr_dt_match); ++ ++static struct platform_driver tcsr_driver = { ++ .driver = { ++ .name = "tcsr", ++ .owner = THIS_MODULE, ++ .of_match_table = tcsr_dt_match, ++ }, ++ .probe = tcsr_probe, ++}; ++ ++module_platform_driver(tcsr_driver); ++ ++MODULE_AUTHOR("Andy Gross "); ++MODULE_DESCRIPTION("QCOM TCSR driver"); ++MODULE_LICENSE("GPL v2"); +diff --git a/include/dt-bindings/soc/qcom,tcsr.h b/include/dt-bindings/soc/qcom,tcsr.h +new file mode 100644 +index 0000000..c9d497a +--- /dev/null ++++ b/include/dt-bindings/soc/qcom,tcsr.h +@@ -0,0 +1,19 @@ ++/* Copyright (c) 2014, The Linux Foundation. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 and ++ * only version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ */ ++#ifndef __DT_BINDINGS_QCOM_TCSR_H ++#define __DT_BINDINGS_QCOM_TCSR_H ++ ++#define TCSR_USB_SELECT_USB3_P0 0x1 ++#define TCSR_USB_SELECT_USB3_P1 0x2 ++#define TCSR_USB_SELECT_USB3_DUAL 0x3 ++ ++#endif +-- +1.7.10.4 + -- cgit v1.2.3