diff mbox series

[v2,06/16] clk: Add support for the k210 clock driver pre-relocation

Message ID 20201012181345.338661-7-seanga2@gmail.com
State Superseded
Delegated to: Andes
Headers show
Series riscv: k210: Enable use of AI ram bank | expand

Commit Message

Sean Anderson Oct. 12, 2020, 6:13 p.m. UTC
Variables which had previously been stored in .bss are moved to .data. In
addition, probed needs to be reset when the clock driver is re-bound
post-relocation.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
---

(no changes since v1)

 drivers/clk/kendryte/clk.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Rick Chen Nov. 3, 2020, 7:13 a.m. UTC | #1
> Variables which had previously been stored in .bss are moved to .data. In
> addition, probed needs to be reset when the clock driver is re-bound
> post-relocation.
>
> Signed-off-by: Sean Anderson <seanga2@gmail.com>
> ---
>
> (no changes since v1)
>
>  drivers/clk/kendryte/clk.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>

Reviewed-by: Rick Chen <rick@andestech.com>
diff mbox series

Patch

diff --git a/drivers/clk/kendryte/clk.c b/drivers/clk/kendryte/clk.c
index 28e21d0bf9..3e4818e9ef 100644
--- a/drivers/clk/kendryte/clk.c
+++ b/drivers/clk/kendryte/clk.c
@@ -471,7 +471,14 @@  cleanup_mux:
 	return comp;
 }
 
-static bool probed;
+static bool __section(.data) probed;
+
+/* reset probed so we will probe again post-relocation */
+static int k210_clk_bind(struct udevice *dev)
+{
+	probed = false;
+	return 0;
+}
 
 static int k210_clk_probe(struct udevice *dev)
 {
@@ -640,5 +647,6 @@  U_BOOT_DRIVER(k210_clk) = {
 	.id = UCLASS_CLK,
 	.of_match = k210_clk_ids,
 	.ops = &k210_clk_ops,
+	.bind = k210_clk_bind,
 	.probe = k210_clk_probe,
 };