mirror of
https://github.com/Fishwaldo/build.git
synced 2025-03-30 02:31:46 +00:00
82 lines
3 KiB
Diff
82 lines
3 KiB
Diff
diff --git a/drivers/clk/sunxi-ng/ccu-sunxi-h3-h5.c b/drivers/clk/sunxi-ng/ccu-sunxi-h3-h5.c
|
|
index b7b9f85f..d117f2b5 100644
|
|
--- a/drivers/clk/sunxi-ng/ccu-sunxi-h3-h5.c
|
|
+++ b/drivers/clk/sunxi-ng/ccu-sunxi-h3-h5.c
|
|
@@ -29,15 +29,21 @@
|
|
|
|
#include "ccu-sunxi-h3-h5.h"
|
|
|
|
-static SUNXI_CCU_NKMP_WITH_GATE_LOCK(pll_cpux_clk, "pll-cpux",
|
|
- "osc24M", 0x000,
|
|
- 8, 5, /* N */
|
|
- 4, 2, /* K */
|
|
- 0, 2, /* M */
|
|
- 16, 2, /* P */
|
|
- BIT(31), /* gate */
|
|
- BIT(28), /* lock */
|
|
- 0);
|
|
+static struct ccu_nkmp pll_cpux_clk = {
|
|
+ .enable = BIT(31),
|
|
+ .lock = BIT(28),
|
|
+ .n = _SUNXI_CCU_MULT(8, 5),
|
|
+ .k = _SUNXI_CCU_MULT(4, 2),
|
|
+ .m = _SUNXI_CCU_DIV_MAX(0, 2, 1),
|
|
+ .p = _SUNXI_CCU_DIV(16, 2),
|
|
+ .common = {
|
|
+ .reg = 0x000,
|
|
+ .hw.init = CLK_HW_INIT("pll-cpux",
|
|
+ "osc24M",
|
|
+ &ccu_nkmp_ops,
|
|
+ 0),
|
|
+ },
|
|
+};
|
|
|
|
/*
|
|
* The Audio PLL is supposed to have 4 outputs: 3 fixed factors from
|
|
@@ -135,7 +141,7 @@ static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_de_clk, "pll-de",
|
|
static const char * const cpux_parents[] = { "osc32k", "osc24M",
|
|
"pll-cpux" , "pll-cpux" };
|
|
static SUNXI_CCU_MUX(cpux_clk, "cpux", cpux_parents,
|
|
- 0x050, 16, 2, CLK_IS_CRITICAL);
|
|
+ 0x050, 16, 2, CLK_IS_CRITICAL | CLK_SET_RATE_PARENT);
|
|
|
|
static SUNXI_CCU_M(axi_clk, "axi", "cpux", 0x050, 0, 2, 0);
|
|
|
|
diff --git a/drivers/clk/sunxi-ng/ccu_common.c b/drivers/clk/sunxi-ng/ccu_common.c
|
|
index 51d4bac9..9dc970ff 100644
|
|
--- a/drivers/clk/sunxi-ng/ccu_common.c
|
|
+++ b/drivers/clk/sunxi-ng/ccu_common.c
|
|
@@ -36,7 +36,7 @@ void ccu_helper_wait_for_lock(struct ccu_common *common, u32 lock)
|
|
else
|
|
addr = common->base + common->reg;
|
|
|
|
- WARN_ON(readl_relaxed_poll_timeout(addr, reg, reg & lock, 100, 70000));
|
|
+ WARN_ON(readl_relaxed_poll_timeout_atomic(addr, reg, reg & lock, 5, 70000));
|
|
}
|
|
|
|
int sunxi_ccu_probe(struct device_node *node, void __iomem *reg,
|
|
diff --git a/drivers/clk/sunxi-ng/ccu_nkmp.c b/drivers/clk/sunxi-ng/ccu_nkmp.c
|
|
index a2b40a00..6e472872 100644
|
|
--- a/drivers/clk/sunxi-ng/ccu_nkmp.c
|
|
+++ b/drivers/clk/sunxi-ng/ccu_nkmp.c
|
|
@@ -30,7 +30,7 @@ static void ccu_nkmp_find_best(unsigned long parent, unsigned long rate,
|
|
for (_k = nkmp->min_k; _k <= nkmp->max_k; _k++) {
|
|
for (_n = nkmp->min_n; _n <= nkmp->max_n; _n++) {
|
|
for (_m = nkmp->min_m; _m <= nkmp->max_m; _m++) {
|
|
- for (_p = nkmp->min_p; _p <= nkmp->max_p; _p <<= 1) {
|
|
+ for (_p = nkmp->min_p; _p <= (rate <= 288000000 ? nkmp->max_p : nkmp->min_p); _p <<= 1) {
|
|
unsigned long tmp_rate;
|
|
|
|
tmp_rate = parent * _n * _k / (_m * _p);
|
|
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
|
|
index 7fcaf26e..e79543b0 100644
|
|
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
|
|
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
|
|
@@ -25,6 +25,7 @@ static const struct of_device_id machines[] __initconst = {
|
|
{ .compatible = "allwinner,sun8i-a33", },
|
|
{ .compatible = "allwinner,sun8i-a83t", },
|
|
{ .compatible = "allwinner,sun8i-h3", },
|
|
+ { .compatible = "allwinner,sun50i-h5", },
|
|
|
|
{ .compatible = "apm,xgene-shadowcat", },
|
|
|