ipq806x: 6.1: manually refresh kernel patches

Refresh kernel patches for version 6.1.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
Christian Marangi 2022-10-19 01:09:53 +02:00
parent f92bf3ffbc
commit eb69d7a4ff
No known key found for this signature in database
GPG Key ID: AC001D09ADBFEAD7
11 changed files with 140 additions and 119 deletions

View File

@ -248,7 +248,7 @@ Signed-off-by: Adrian Panella <ianchi74@outlook.com>
}
--- a/init/main.c
+++ b/init/main.c
@@ -114,6 +114,10 @@
@@ -113,6 +113,10 @@
#include <kunit/test.h>
@ -259,7 +259,7 @@ Signed-off-by: Adrian Panella <ianchi74@outlook.com>
static int kernel_init(void *);
extern void init_IRQ(void);
@@ -993,6 +997,18 @@ asmlinkage __visible void __init __no_sa
@@ -992,6 +996,18 @@ asmlinkage __visible void __init __no_sa
pr_notice("Kernel command line: %s\n", saved_command_line);
/* parameters may set static keys */
jump_label_init();

View File

@ -29,53 +29,7 @@ Tested-by: Jonathan McDowell <noodles@earth.li>
cxo_board: cxo_board {
compatible = "fixed-clock";
#clock-cells = <0>;
@@ -503,11 +509,19 @@
acc0: clock-controller@2088000 {
compatible = "qcom,kpss-acc-v1";
reg = <0x02088000 0x1000>, <0x02008000 0x1000>;
+ clock-output-names = "acpu0_aux";
+ clocks = <&gcc PLL8_VOTE>, <&pxo_board>;
+ clock-names = "pll8_vote", "pxo";
+ #clock-cells = <0>;
};
acc1: clock-controller@2098000 {
compatible = "qcom,kpss-acc-v1";
reg = <0x02098000 0x1000>, <0x02008000 0x1000>;
+ clock-output-names = "acpu1_aux";
+ clocks = <&gcc PLL8_VOTE>, <&pxo_board>;
+ clock-names = "pll8_vote", "pxo";
+ #clock-cells = <0>;
};
adm_dma: dma-controller@18300000 {
@@ -531,17 +545,23 @@
};
saw0: regulator@2089000 {
- compatible = "qcom,saw2";
+ compatible = "qcom,saw2", "qcom,apq8064-saw2-v1.1-cpu", "syscon";
reg = <0x02089000 0x1000>, <0x02009000 0x1000>;
regulator;
};
saw1: regulator@2099000 {
- compatible = "qcom,saw2";
+ compatible = "qcom,saw2", "qcom,apq8064-saw2-v1.1-cpu", "syscon";
reg = <0x02099000 0x1000>, <0x02009000 0x1000>;
regulator;
};
+ saw_l2: regulator@02012000 {
+ compatible = "qcom,saw2", "syscon";
+ reg = <0x02012000 0x1000>;
+ regulator;
+ };
+
gsbi1: gsbi@12440000 {
compatible = "qcom,gsbi-v1.0.0";
reg = <0x12440000 0x100>;
@@ -920,6 +940,17 @@
@@ -490,6 +490,17 @@
clocks = <&gcc PLL8_VOTE>, <&pxo_board>;
clock-names = "pll8_vote", "pxo";
clock-output-names = "acpu_l2_aux";
@ -92,4 +46,50 @@ Tested-by: Jonathan McDowell <noodles@earth.li>
+ #clock-cells = <1>;
};
lcc: clock-controller@28000000 {
acc0: clock-controller@2088000 {
@@ -503,17 +509,25 @@
acc0: clock-controller@2088000 {
compatible = "qcom,kpss-acc-v1";
reg = <0x02088000 0x1000>, <0x02008000 0x1000>;
+ clock-output-names = "acpu0_aux";
+ clocks = <&gcc PLL8_VOTE>, <&pxo_board>;
+ clock-names = "pll8_vote", "pxo";
+ #clock-cells = <0>;
};
saw0: regulator@2089000 {
- compatible = "qcom,saw2";
+ compatible = "qcom,saw2", "qcom,apq8064-saw2-v1.1-cpu", "syscon";
reg = <0x02089000 0x1000>, <0x02009000 0x1000>;
regulator;
};
acc1: clock-controller@2098000 {
compatible = "qcom,kpss-acc-v1";
reg = <0x02098000 0x1000>, <0x02008000 0x1000>;
+ clock-output-names = "acpu1_aux";
+ clocks = <&gcc PLL8_VOTE>, <&pxo_board>;
+ clock-names = "pll8_vote", "pxo";
+ #clock-cells = <0>;
};
saw1: regulator@2099000 {
@@ -531,11 +545,17 @@
};
saw1: regulator@2099000 {
- compatible = "qcom,saw2";
+ compatible = "qcom,saw2", "qcom,apq8064-saw2-v1.1-cpu", "syscon";
reg = <0x02099000 0x1000>, <0x02009000 0x1000>;
regulator;
};
+ saw_l2: regulator@02012000 {
+ compatible = "qcom,saw2", "syscon";
+ reg = <0x02012000 0x1000>;
+ regulator;
+ };
+
nss_common: syscon@03000000 {
compatible = "syscon";
reg = <0x03000000 0x0000FFFF>;

View File

@ -51,7 +51,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
obj-$(CONFIG_PM_DEVFREQ_EVENT) += event/
--- /dev/null
+++ b/drivers/devfreq/krait-cache-devfreq.c
@@ -0,0 +1,188 @@
@@ -0,0 +1,181 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/kernel.h>
@ -71,28 +71,25 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+struct krait_cache_data {
+ struct clk *clk;
+ unsigned long idle_freq;
+ int token;
+};
+
+static int krait_cache_set_opp(struct dev_pm_set_opp_data *data)
+static int krait_cache_config_clk(struct device *dev, struct opp_table *opp_table,
+ struct dev_pm_opp *old_opp, struct dev_pm_opp *opp,
+ void *data, bool scaling_down)
+{
+ unsigned long old_freq = data->old_opp.rate, freq = data->new_opp.rate;
+ struct dev_pm_opp_supply *supply = &data->new_opp.supplies[0];
+ struct regulator *reg = data->regulators[0];
+ struct krait_cache_data *kdata;
+ struct clk *clk = data->clk;
+ unsigned long old_freq, freq;
+ unsigned long idle_freq;
+ struct clk *clk;
+ int ret;
+
+ kdata = dev_get_drvdata(data->dev);
+ kdata = dev_get_drvdata(dev);
+ idle_freq = kdata->idle_freq;
+ clk = kdata->clk;
+
+ if (reg) {
+ ret = regulator_set_voltage_triplet(reg, supply->u_volt_min,
+ supply->u_volt,
+ supply->u_volt_max);
+ if (ret)
+ goto exit;
+ }
+ old_freq = dev_pm_opp_get_freq(old_opp);
+ freq = dev_pm_opp_get_freq(opp);
+
+ /*
+ * Set to idle bin if switching from normal to high bin
@ -104,15 +101,10 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+ if (likely(freq != idle_freq && old_freq != idle_freq)) {
+ ret = clk_set_rate(clk, idle_freq);
+ if (ret)
+ goto exit;
+ return ret;
+ }
+
+ ret = clk_set_rate(clk, freq);
+ if (ret)
+ goto exit;
+
+exit:
+ return ret;
+ return clk_set_rate(clk, freq);
+};
+
+static int krait_cache_get_cur_freq(struct device *dev, unsigned long *freq)
@ -162,15 +154,13 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+
+static int krait_cache_probe(struct platform_device *pdev)
+{
+ struct dev_pm_opp_config config = { };
+ struct device *dev = &pdev->dev;
+ struct krait_cache_data *data;
+ struct opp_table *table;
+ struct devfreq *devfreq;
+ struct dev_pm_opp *opp;
+ struct clk *clk;
+ int ret;
+
+ krait_cache_devfreq_profile.freq_table = NULL;
+ int ret, token;
+
+ data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
+ if (!data)
@ -180,44 +170,47 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+ if (IS_ERR(clk))
+ return PTR_ERR(clk);
+
+ table = dev_pm_opp_set_regulators(dev, (const char *[]){ "l2" }, 1);
+ if (IS_ERR(table)) {
+ ret = PTR_ERR(table);
+ dev_err_probe(dev, -EPROBE_DEFER, "failed to set regulators %d\n", ret);
+ return ret;
+ }
+ config.regulator_names = (const char *[]){ "l2", NULL };
+ config.clk_names = (const char *[]){ "l2", NULL };
+ config.config_clks = krait_cache_config_clk;
+
+ ret = PTR_ERR_OR_ZERO(
+ dev_pm_opp_register_set_opp_helper(dev, krait_cache_set_opp));
+ token = dev_pm_opp_set_config(dev, &config);
+ if (token < 0)
+ return token;
+
+ ret = devm_pm_opp_of_add_table(dev);
+ if (ret)
+ return ret;
+ goto free_opp;
+
+ ret = dev_pm_opp_of_add_table(dev);
+ if (ret) {
+ dev_err(dev, "failed to parse L2 freq thresholds\n");
+ return ret;
+ }
+
+ data->clk = clk;
+ opp = dev_pm_opp_find_freq_ceil(dev, &data->idle_freq);
+ if (IS_ERR(opp)) {
+ ret = PTR_ERR(opp);
+ goto free_opp;
+ }
+ dev_pm_opp_put(opp);
+
+ data->token = token;
+ data->clk = clk;
+ dev_set_drvdata(dev, data);
+
+ devfreq = devm_devfreq_add_device(&pdev->dev, &krait_cache_devfreq_profile,
+ devfreq = devm_devfreq_add_device(dev, &krait_cache_devfreq_profile,
+ DEVFREQ_GOV_PASSIVE, &devfreq_gov_data);
+ if (IS_ERR(devfreq)) {
+ dev_pm_opp_remove_table(dev);
+ dev_pm_opp_put_regulators(table);
+ dev_pm_opp_unregister_set_opp_helper(table);
+ ret = PTR_ERR(devfreq);
+ goto free_opp;
+ }
+
+ return PTR_ERR_OR_ZERO(devfreq);
+ return 0;
+
+free_opp:
+ dev_pm_opp_clear_config(token);
+ return ret;
+};
+
+static int krait_cache_remove(struct platform_device *pdev)
+{
+ dev_pm_opp_remove_table(&pdev->dev);
+ struct krait_cache_data *data = dev_get_drvdata(&pdev->dev);
+
+ dev_pm_opp_clear_config(data->token);
+
+ return 0;
+};
@ -238,5 +231,5 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+module_platform_driver(krait_cache_driver);
+
+MODULE_DESCRIPTION("Krait CPU Cache Scaling driver");
+MODULE_AUTHOR("Christian 'Ansuel' Marangi <ansuelsmth@gmail.com>");
+MODULE_AUTHOR("Christian Marangi <ansuelsmth@gmail.com>");
+MODULE_LICENSE("GPL v2");

View File

@ -13,15 +13,16 @@ Link: https://lore.kernel.org/r/20221108211734.3707-1-ansuelsmth@gmail.com
drivers/clk/qcom/kpss-xcc.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/qcom/kpss-xcc.c b/drivers/clk/qcom/kpss-xcc.c
index b1b370274ec4..97358c98c6c9 100644
--- a/drivers/clk/qcom/kpss-xcc.c
+++ b/drivers/clk/qcom/kpss-xcc.c
@@ -31,13 +31,14 @@ MODULE_DEVICE_TABLE(of, kpss_xcc_match_t
@@ -31,12 +31,13 @@ MODULE_DEVICE_TABLE(of, kpss_xcc_match_table);
static int kpss_xcc_driver_probe(struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
const struct of_device_id *id;
struct resource *res;
void __iomem *base;
struct clk_hw *hw;
const char *name;
@ -31,7 +32,7 @@ Link: https://lore.kernel.org/r/20221108211734.3707-1-ansuelsmth@gmail.com
if (!id)
return -ENODEV;
@@ -47,7 +48,7 @@ static int kpss_xcc_driver_probe(struct
@@ -45,7 +46,7 @@ static int kpss_xcc_driver_probe(struct platform_device *pdev)
return PTR_ERR(base);
if (id->data) {
@ -40,7 +41,7 @@ Link: https://lore.kernel.org/r/20221108211734.3707-1-ansuelsmth@gmail.com
"clock-output-names",
0, &name))
return -ENODEV;
@@ -57,12 +58,16 @@ static int kpss_xcc_driver_probe(struct
@@ -55,12 +56,16 @@ static int kpss_xcc_driver_probe(struct platform_device *pdev)
base += 0x28;
}
@ -59,3 +60,6 @@ Link: https://lore.kernel.org/r/20221108211734.3707-1-ansuelsmth@gmail.com
}
static struct platform_driver kpss_xcc_driver = {
--
2.37.2

View File

@ -14,9 +14,11 @@ Link: https://lore.kernel.org/r/20221108215827.30475-1-ansuelsmth@gmail.com
drivers/clk/qcom/krait-cc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/qcom/krait-cc.c b/drivers/clk/qcom/krait-cc.c
index e91275663973..33a78b7de0bd 100644
--- a/drivers/clk/qcom/krait-cc.c
+++ b/drivers/clk/qcom/krait-cc.c
@@ -62,7 +62,7 @@ static int krait_notifier_register(struc
@@ -64,7 +64,7 @@ static int krait_notifier_register(struct device *dev, struct clk *clk,
int ret = 0;
mux->clk_nb.notifier_call = krait_notifier_cb;
@ -25,3 +27,6 @@ Link: https://lore.kernel.org/r/20221108215827.30475-1-ansuelsmth@gmail.com
if (ret)
dev_err(dev, "failed to register clock notifier: %d\n", ret);
--
2.37.2

View File

@ -12,18 +12,20 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
drivers/clk/qcom/krait-cc.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/qcom/krait-cc.c b/drivers/clk/qcom/krait-cc.c
index 84f0048961f5..f1d64b16cac3 100644
--- a/drivers/clk/qcom/krait-cc.c
+++ b/drivers/clk/qcom/krait-cc.c
@@ -348,7 +348,7 @@ static int krait_cc_probe(struct platfor
@@ -305,7 +305,7 @@ static int krait_cc_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
const struct of_device_id *id;
- unsigned long cur_rate, aux_rate;
+ unsigned long cur_rate, aux_rate, qsb_rate;
int cpu;
struct clk_hw *mux, *l2_pri_mux;
struct clk *clk, **clks;
@@ -357,11 +357,19 @@ static int krait_cc_probe(struct platfor
struct clk *clk;
struct clk **clks;
@@ -315,11 +315,19 @@ static int krait_cc_probe(struct platform_device *pdev)
if (!id)
return -ENODEV;
@ -45,3 +47,6 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
if (!id->data) {
clk = clk_register_fixed_factor(dev, "acpu_aux",
"gpll0_vote", 0, 1, 2);
--
2.37.2

View File

@ -14,6 +14,8 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
drivers/clk/qcom/krait-cc.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/qcom/krait-cc.c b/drivers/clk/qcom/krait-cc.c
index f1d64b16cac3..e91275663973 100644
--- a/drivers/clk/qcom/krait-cc.c
+++ b/drivers/clk/qcom/krait-cc.c
@@ -25,6 +25,8 @@ enum {
@ -25,7 +27,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
static unsigned int sec_mux_map[] = {
2,
0,
@@ -364,7 +366,7 @@ static int krait_cc_probe(struct platfor
@@ -322,7 +324,7 @@ static int krait_cc_probe(struct platform_device *pdev)
*/
clk = clk_get(dev, "qsb");
if (IS_ERR(clk))
@ -34,3 +36,6 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
if (IS_ERR(clk))
return PTR_ERR(clk);
--
2.37.2

View File

@ -10,10 +10,12 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
drivers/clk/qcom/krait-cc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/qcom/krait-cc.c b/drivers/clk/qcom/krait-cc.c
index b71067a49ee7..e4fb3ff2b5b5 100644
--- a/drivers/clk/qcom/krait-cc.c
+++ b/drivers/clk/qcom/krait-cc.c
@@ -423,25 +423,25 @@ static int krait_cc_probe(struct platfor
cur_rate = clk_get_rate(clks[l2_mux]);
@@ -391,25 +391,25 @@ static int krait_cc_probe(struct platform_device *pdev)
cur_rate = clk_get_rate(l2_pri_mux_clk);
aux_rate = 384000000;
if (cur_rate < aux_rate) {
- pr_info("L2 @ Undefined rate. Forcing new rate.\n");
@ -42,3 +44,6 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
}
of_clk_add_provider(dev->of_node, krait_of_get, clks);
--
2.37.2

View File

@ -17,6 +17,8 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
drivers/clk/qcom/krait-cc.c | 50 +++++++++++++++++--------------------
1 file changed, 23 insertions(+), 27 deletions(-)
diff --git a/drivers/clk/qcom/krait-cc.c b/drivers/clk/qcom/krait-cc.c
index 717eff44b6a4..90dee71e7c38 100644
--- a/drivers/clk/qcom/krait-cc.c
+++ b/drivers/clk/qcom/krait-cc.c
@@ -25,7 +25,9 @@ enum {
@ -30,16 +32,16 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
static unsigned int sec_mux_map[] = {
2,
@@ -350,7 +352,7 @@ static int krait_cc_probe(struct platfor
@@ -317,7 +319,7 @@ static int krait_cc_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
const struct of_device_id *id;
- unsigned long cur_rate, aux_rate, qsb_rate;
+ unsigned long cur_rate, qsb_rate;
int cpu;
struct clk_hw *mux, *l2_pri_mux;
struct clk *clk, **clks;
@@ -420,28 +422,29 @@ static int krait_cc_probe(struct platfor
struct clk *clk;
struct clk **clks;
@@ -397,28 +399,29 @@ static int krait_cc_probe(struct platform_device *pdev)
* two different rates to force a HFPLL reinit under all
* circumstances.
*/
@ -86,3 +88,5 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
}
of_clk_add_provider(dev->of_node, krait_of_get, clks);

View File

@ -12,7 +12,7 @@ Subject: SoC: add qualcomm syscon
obj-$(CONFIG_QCOM_RPMHPD) += rpmhpd.o
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -192,6 +192,13 @@ config QCOM_SOCINFO
@@ -190,6 +190,13 @@ config QCOM_SOCINFO
Say yes here to support the Qualcomm socinfo driver, providing
information about the SoC to user space.

View File

@ -19,7 +19,7 @@
+++ b/drivers/of/fdt.c
@@ -1162,6 +1162,17 @@ int __init early_init_dt_scan_chosen(uns
if (p != NULL && l > 0)
strlcat(data, p, min_t(int, strlen(data) + (int)l, COMMAND_LINE_SIZE));
strlcat(cmdline, p, min_t(int, strlen(cmdline) + (int)l, COMMAND_LINE_SIZE));
+ /* CONFIG_CMDLINE_OVERRIDE is used to fallback to a different
+ * device tree option of chosen/bootargs-override. This is
@ -29,9 +29,9 @@
+#ifdef CONFIG_CMDLINE_OVERRIDE
+ p = of_get_flat_dt_prop(node, "bootargs-override", &l);
+ if (p != NULL && l > 0)
+ strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
+ strlcpy(cmdline, p, min((int)l, COMMAND_LINE_SIZE));
+#endif
+
handle_cmdline:
/*
* CONFIG_CMDLINE is meant to be a default in case nothing else
* managed to set the command line, unless CONFIG_CMDLINE_FORCE