2 * Copyright (C) 2016 Google, Inc
4 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/arch/scu_ast2500.h>
12 int ast_get_clk(struct udevice **devp)
14 return uclass_get_device_by_driver(UCLASS_CLK,
15 DM_GET_DRIVER(aspeed_ast2500_scu), devp);
18 void *ast_get_scu(void)
20 struct ast2500_clk_priv *priv;
24 ret = ast_get_clk(&dev);
28 priv = dev_get_priv(dev);
33 void ast_scu_unlock(struct ast2500_scu *scu)
35 writel(SCU_UNLOCK_VALUE, &scu->protection_key);
36 while (!readl(&scu->protection_key))
40 void ast_scu_lock(struct ast2500_scu *scu)
42 writel(~SCU_UNLOCK_VALUE, &scu->protection_key);
43 while (readl(&scu->protection_key))