X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=arch%2Farm%2Fmach-aspeed%2Fast2500%2Fclk_ast2500.c;h=7d864a4088036b065036803f385731223e23d9db;hb=1cdb6148450e851abe1df5d7eb20aa07a409941c;hp=079909fa6462218a93ada767df11349657c443f2;hpb=c83a824e62277162ad35f52879b2316902c0eff5;p=oweals%2Fu-boot.git diff --git a/arch/arm/mach-aspeed/ast2500/clk_ast2500.c b/arch/arm/mach-aspeed/ast2500/clk_ast2500.c index 079909fa64..7d864a4088 100644 --- a/arch/arm/mach-aspeed/ast2500/clk_ast2500.c +++ b/arch/arm/mach-aspeed/ast2500/clk_ast2500.c @@ -1,11 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2016 Google, Inc - * - * SPDX-License-Identifier: GPL-2.0+ */ #include #include +#include #include int ast_get_clk(struct udevice **devp) @@ -28,3 +28,17 @@ void *ast_get_scu(void) return priv->scu; } + +void ast_scu_unlock(struct ast2500_scu *scu) +{ + writel(SCU_UNLOCK_VALUE, &scu->protection_key); + while (!readl(&scu->protection_key)) + ; +} + +void ast_scu_lock(struct ast2500_scu *scu) +{ + writel(~SCU_UNLOCK_VALUE, &scu->protection_key); + while (readl(&scu->protection_key)) + ; +}