lib: Add SG2044 CPPC support

Signed-off-by: haijiao.liu <haijiao.liu@sophgo.com>
This commit is contained in:
haijiao.liu
2025-03-26 22:01:23 +08:00
committed by Xiaoguang Xing
parent df02b2f353
commit 78f021d248
15 changed files with 961 additions and 0 deletions

32
include/sbi/sbi_clk.h Normal file
View File

@@ -0,0 +1,32 @@
/*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2025 Sophgo Inc.
*
* Authors:
* Haijiao Liu <haijiao.liu@sophgo.com>
*/
#ifndef __SBI_CLK_H__
#define __SBI_CLK_H__
#include <sbi/sbi_types.h>
/* clock device */
struct sbi_clk_device {
char name[32];
int (*clk_set_rate)(const char *name, uint64_t rate);
uint64_t (*clk_get_rate)(const char *name);
int (*clk_enable)(const char *name);
int (*clk_disable)(const char *name);
};
int sbi_clk_set_rate(const char *name, uint64_t rate);
uint64_t sbi_clk_get_rate(const char *name);
int sbi_clk_enable(const char *name);
int sbi_clk_disable(const char *name);
const struct sbi_clk_device *sbi_clk_get_device(const void *fdt);
void sbi_clk_set_device(const struct sbi_clk_device *dev);
#endif