ipq806x: replace patches with upstream version
Replace all the custom patches with the backported upstream version Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> [refresh patches] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>master
parent
4f1a51f438
commit
df3ad130d5
@ -1,79 +0,0 @@
|
|||||||
From 2034addc7e193dc81d7ca60d8884832751b76758 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ajay Kishore <akisho@codeaurora.org>
|
|
||||||
Date: Tue, 24 Jan 2017 14:14:16 +0530
|
|
||||||
Subject: pinctrl: qcom: use scm_call to route GPIO irq to Apps
|
|
||||||
|
|
||||||
For IPQ806x targets, TZ protects the registers that are used to
|
|
||||||
configure the routing of interrupts to a target processor.
|
|
||||||
To resolve this, this patch uses scm call to route GPIO interrupts
|
|
||||||
to application processor. Also the scm call interface is changed.
|
|
||||||
|
|
||||||
Change-Id: Ib6c06829d04bc8c20483c36e63da92e26cdef9ce
|
|
||||||
Signed-off-by: Ajay Kishore <akisho@codeaurora.org>
|
|
||||||
---
|
|
||||||
|
|
||||||
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
|
|
||||||
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
|
|
||||||
@@ -22,7 +22,8 @@
|
|
||||||
#include <linux/reboot.h>
|
|
||||||
#include <linux/pm.h>
|
|
||||||
#include <linux/log2.h>
|
|
||||||
-
|
|
||||||
+#include <linux/qcom_scm.h>
|
|
||||||
+#include <linux/io.h>
|
|
||||||
#include "../core.h"
|
|
||||||
#include "../pinconf.h"
|
|
||||||
#include "pinctrl-msm.h"
|
|
||||||
@@ -706,6 +707,9 @@ static void msm_gpio_irq_mask(struct irq
|
|
||||||
const struct msm_pingroup *g;
|
|
||||||
unsigned long flags;
|
|
||||||
u32 val;
|
|
||||||
+ u32 addr;
|
|
||||||
+ int ret;
|
|
||||||
+ const __be32 *reg;
|
|
||||||
|
|
||||||
g = &pctrl->soc->groups[d->hwirq];
|
|
||||||
|
|
||||||
@@ -819,6 +823,7 @@ static int msm_gpio_irq_set_type(struct
|
|
||||||
const struct msm_pingroup *g;
|
|
||||||
unsigned long flags;
|
|
||||||
u32 val;
|
|
||||||
+ int ret;
|
|
||||||
|
|
||||||
g = &pctrl->soc->groups[d->hwirq];
|
|
||||||
|
|
||||||
@@ -832,11 +837,30 @@ static int msm_gpio_irq_set_type(struct
|
|
||||||
else
|
|
||||||
clear_bit(d->hwirq, pctrl->dual_edge_irqs);
|
|
||||||
|
|
||||||
+ ret = of_device_is_compatible(pctrl->dev->of_node,
|
|
||||||
+ "qcom,ipq8064-pinctrl");
|
|
||||||
/* Route interrupts to application cpu */
|
|
||||||
- val = msm_readl_intr_target(pctrl, g);
|
|
||||||
- val &= ~(7 << g->intr_target_bit);
|
|
||||||
- val |= g->intr_target_kpss_val << g->intr_target_bit;
|
|
||||||
- msm_writel_intr_target(val, pctrl, g);
|
|
||||||
+ if (!ret) {
|
|
||||||
+ val = msm_readl_intr_target(pctrl, g);
|
|
||||||
+ val &= ~(7 << g->intr_target_bit);
|
|
||||||
+ val |= g->intr_target_kpss_val << g->intr_target_bit;
|
|
||||||
+ msm_writel_intr_target(val, pctrl, g);
|
|
||||||
+ } else {
|
|
||||||
+ const __be32 *reg = of_get_property(pctrl->dev->of_node, "reg", NULL);
|
|
||||||
+ if (reg) {
|
|
||||||
+ u32 addr = be32_to_cpup(reg) + g->intr_target_reg;
|
|
||||||
+ qcom_scm_io_readl(addr, &val);
|
|
||||||
+ __iormb();
|
|
||||||
+
|
|
||||||
+ val &= ~(7 << g->intr_target_bit);
|
|
||||||
+ val |= g->intr_target_kpss_val << g->intr_target_bit;
|
|
||||||
+
|
|
||||||
+ __iowmb();
|
|
||||||
+ ret = qcom_scm_io_writel(addr, val);
|
|
||||||
+ if (ret)
|
|
||||||
+ pr_err("\n Routing interrupts to Apps proc failed");
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
|
|
||||||
/* Update configuration for gpio.
|
|
||||||
* RAW_STATUS_EN is left on for all gpio irqs. Due to the
|
|
@ -0,0 +1,104 @@
|
|||||||
|
From 13bec8d49bdf10aab4e1570ef42417f6bfbb6126 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ajay Kishore <akisho@codeaurora.org>
|
||||||
|
Date: Fri, 27 Mar 2020 23:32:08 +0100
|
||||||
|
Subject: pinctrl: qcom: use scm_call to route GPIO irq to Apps
|
||||||
|
|
||||||
|
For IPQ806x targets, TZ protects the registers that are used to
|
||||||
|
configure the routing of interrupts to a target processor.
|
||||||
|
To resolve this, this patch uses scm call to route GPIO interrupts
|
||||||
|
to application processor. Also the scm call interface is changed.
|
||||||
|
|
||||||
|
Signed-off-by: Ajay Kishore <akisho@codeaurora.org>
|
||||||
|
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||||
|
Link: https://lore.kernel.org/r/20200327223209.20409-1-ansuelsmth@gmail.com
|
||||||
|
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
||||||
|
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||||
|
---
|
||||||
|
drivers/pinctrl/qcom/pinctrl-msm.c | 43 ++++++++++++++++++++++++++++++++------
|
||||||
|
1 file changed, 37 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
(limited to 'drivers/pinctrl/qcom/pinctrl-msm.c')
|
||||||
|
|
||||||
|
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
|
||||||
|
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
|
||||||
|
@@ -22,6 +22,8 @@
|
||||||
|
#include <linux/reboot.h>
|
||||||
|
#include <linux/pm.h>
|
||||||
|
#include <linux/log2.h>
|
||||||
|
+#include <linux/qcom_scm.h>
|
||||||
|
+#include <linux/io.h>
|
||||||
|
|
||||||
|
#include "../core.h"
|
||||||
|
#include "../pinconf.h"
|
||||||
|
@@ -57,6 +59,8 @@ struct msm_pinctrl {
|
||||||
|
struct irq_chip irq_chip;
|
||||||
|
int irq;
|
||||||
|
|
||||||
|
+ bool intr_target_use_scm;
|
||||||
|
+
|
||||||
|
raw_spinlock_t lock;
|
||||||
|
|
||||||
|
DECLARE_BITMAP(dual_edge_irqs, MAX_NR_GPIO);
|
||||||
|
@@ -64,6 +68,7 @@ struct msm_pinctrl {
|
||||||
|
|
||||||
|
const struct msm_pinctrl_soc_data *soc;
|
||||||
|
void __iomem *regs[MAX_NR_TILES];
|
||||||
|
+ u32 phys_base[MAX_NR_TILES];
|
||||||
|
};
|
||||||
|
|
||||||
|
#define MSM_ACCESSOR(name) \
|
||||||
|
@@ -832,11 +837,30 @@ static int msm_gpio_irq_set_type(struct
|
||||||
|
else
|
||||||
|
clear_bit(d->hwirq, pctrl->dual_edge_irqs);
|
||||||
|
|
||||||
|
- /* Route interrupts to application cpu */
|
||||||
|
- val = msm_readl_intr_target(pctrl, g);
|
||||||
|
- val &= ~(7 << g->intr_target_bit);
|
||||||
|
- val |= g->intr_target_kpss_val << g->intr_target_bit;
|
||||||
|
- msm_writel_intr_target(val, pctrl, g);
|
||||||
|
+ /* Route interrupts to application cpu.
|
||||||
|
+ * With intr_target_use_scm interrupts are routed to
|
||||||
|
+ * application cpu using scm calls.
|
||||||
|
+ */
|
||||||
|
+ if (pctrl->intr_target_use_scm) {
|
||||||
|
+ u32 addr = pctrl->phys_base[0] + g->intr_target_reg;
|
||||||
|
+ int ret;
|
||||||
|
+
|
||||||
|
+ qcom_scm_io_readl(addr, &val);
|
||||||
|
+
|
||||||
|
+ val &= ~(7 << g->intr_target_bit);
|
||||||
|
+ val |= g->intr_target_kpss_val << g->intr_target_bit;
|
||||||
|
+
|
||||||
|
+ ret = qcom_scm_io_writel(addr, val);
|
||||||
|
+ if (ret)
|
||||||
|
+ dev_err(pctrl->dev,
|
||||||
|
+ "Failed routing %lu interrupt to Apps proc",
|
||||||
|
+ d->hwirq);
|
||||||
|
+ } else {
|
||||||
|
+ val = msm_readl_intr_target(pctrl, g);
|
||||||
|
+ val &= ~(7 << g->intr_target_bit);
|
||||||
|
+ val |= g->intr_target_kpss_val << g->intr_target_bit;
|
||||||
|
+ msm_writel_intr_target(val, pctrl, g);
|
||||||
|
+ }
|
||||||
|
|
||||||
|
/* Update configuration for gpio.
|
||||||
|
* RAW_STATUS_EN is left on for all gpio irqs. Due to the
|
||||||
|
@@ -1138,6 +1162,9 @@ int msm_pinctrl_probe(struct platform_de
|
||||||
|
pctrl->dev = &pdev->dev;
|
||||||
|
pctrl->soc = soc_data;
|
||||||
|
pctrl->chip = msm_gpio_template;
|
||||||
|
+ pctrl->intr_target_use_scm = of_device_is_compatible(
|
||||||
|
+ pctrl->dev->of_node,
|
||||||
|
+ "qcom,ipq8064-pinctrl");
|
||||||
|
|
||||||
|
raw_spin_lock_init(&pctrl->lock);
|
||||||
|
|
||||||
|
@@ -1154,6 +1181,8 @@ int msm_pinctrl_probe(struct platform_de
|
||||||
|
pctrl->regs[0] = devm_ioremap_resource(&pdev->dev, res);
|
||||||
|
if (IS_ERR(pctrl->regs[0]))
|
||||||
|
return PTR_ERR(pctrl->regs[0]);
|
||||||
|
+
|
||||||
|
+ pctrl->phys_base[0] = res->start;
|
||||||
|
}
|
||||||
|
|
||||||
|
msm_pinctrl_setup_pm_reset(pctrl);
|
@ -1,9 +1,15 @@
|
|||||||
From a3488aa9bed37c56e405967d44e821c484b5d6b9 Mon Sep 17 00:00:00 2001
|
From 8d8cec9bf6e9260397872785f249dfb59a417d08 Mon Sep 17 00:00:00 2001
|
||||||
From: Ram Chandra Jangir <rjangir@codeaurora.org>
|
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||||
Date: Fri, 28 Sep 2018 15:19:50 +0530
|
Date: Wed, 19 Feb 2020 18:59:39 +0100
|
||||||
Subject: [PATCH] ipq8064: pinctrl: Fixed missing RGMII pincontrol definitions
|
Subject: ipq8064: pinctrl: Fixed missing RGMII pincontrol definitions
|
||||||
|
|
||||||
|
Add missing gpio definition for mdio and rgmii2.
|
||||||
|
|
||||||
Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
|
Signed-off-by: Ram Chandra Jangir <rjangir@codeaurora.org>
|
||||||
|
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||||
|
Link: https://lore.kernel.org/r/20200219175940.744-1-ansuelsmth@gmail.com
|
||||||
|
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
|
||||||
|
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||||
---
|
---
|
||||||
drivers/pinctrl/qcom/pinctrl-ipq8064.c | 10 +++++-----
|
drivers/pinctrl/qcom/pinctrl-ipq8064.c | 10 +++++-----
|
||||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
1 file changed, 5 insertions(+), 5 deletions(-)
|
@ -1,13 +1,16 @@
|
|||||||
From a16fcf911a020e46439a3bb3e702463fc3159831 Mon Sep 17 00:00:00 2001
|
From 1aec193ea41d672d11592714cdda8167eb3b38fc Mon Sep 17 00:00:00 2001
|
||||||
From: Abhishek Sahu <absahu@codeaurora.org>
|
From: Abhishek Sahu <absahu@codeaurora.org>
|
||||||
Date: Wed, 18 Nov 2015 12:38:56 +0530
|
Date: Wed, 18 Mar 2020 14:16:56 +0100
|
||||||
Subject: [PATCH 62/69] ipq806x: gcc: Added the enable regs and mask for PRNG
|
Subject: ipq806x: gcc: Added the enable regs and mask for PRNG
|
||||||
|
|
||||||
kernel got hanged while reading from /dev/hwrng at the
|
Kernel got hanged while reading from /dev/hwrng at the
|
||||||
time of PRNG clock enable
|
time of PRNG clock enable
|
||||||
|
|
||||||
Change-Id: I89856c7e19e6639508e6a2774304583a3ec91172
|
Fixes: 24d8fba44af3 "clk: qcom: Add support for IPQ8064's global clock controller (GCC)"
|
||||||
Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
|
Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
|
||||||
|
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||||
|
Link: https://lkml.kernel.org/r/20200318131657.345-1-ansuelsmth@gmail.com
|
||||||
|
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
|
||||||
---
|
---
|
||||||
drivers/clk/qcom/gcc-ipq806x.c | 2 ++
|
drivers/clk/qcom/gcc-ipq806x.c | 2 ++
|
||||||
1 file changed, 2 insertions(+)
|
1 file changed, 2 insertions(+)
|
@ -1,9 +1,17 @@
|
|||||||
From ef10381ca4d01848ebedb4afb2c78feb8052f103 Mon Sep 17 00:00:00 2001
|
From b5f25304aece9f2e7eaab275bbb5461c666bf38c Mon Sep 17 00:00:00 2001
|
||||||
From: Adrian Panella <ianchi74@outlook.com>
|
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||||
Date: Thu, 9 Mar 2017 08:26:54 +0100
|
Date: Wed, 19 Feb 2020 17:37:11 +0100
|
||||||
Subject: [PATCH 53/69] regulator: add smb208 support
|
Subject: regulator: add smb208 support
|
||||||
|
|
||||||
|
Smb208 regulators are used on some ipq806x soc.
|
||||||
|
Add support for it to make it avaiable on some routers
|
||||||
|
that use it.
|
||||||
|
|
||||||
|
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||||
Signed-off-by: Adrian Panella <ianchi74@outlook.com>
|
Signed-off-by: Adrian Panella <ianchi74@outlook.com>
|
||||||
|
Acked-by: Lee Jones <lee.jones@linaro.org>
|
||||||
|
Link: https://lore.kernel.org/r/20200219163711.479-1-ansuelsmth@gmail.com
|
||||||
|
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||||
---
|
---
|
||||||
Documentation/devicetree/bindings/mfd/qcom-rpm.txt | 4 ++++
|
Documentation/devicetree/bindings/mfd/qcom-rpm.txt | 4 ++++
|
||||||
drivers/regulator/qcom_rpm-regulator.c | 9 +++++++++
|
drivers/regulator/qcom_rpm-regulator.c | 9 +++++++++
|
Loading…
Reference in New Issue