File: sbi_cppc.h

package info (click to toggle)
opensbi 1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,352 kB
  • sloc: ansic: 32,307; python: 4,658; asm: 1,076; makefile: 631; sh: 331
file content (35 lines) | stat: -rw-r--r-- 826 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * SPDX-License-Identifier: BSD-2-Clause
 *
 * Copyright (c) 2023 Ventana Micro Systems Inc.
 *
 */

#ifndef __SBI_CPPC_H__
#define __SBI_CPPC_H__

#include <sbi/sbi_types.h>

/** CPPC device */
struct sbi_cppc_device {
	/** Name of the CPPC device */
	char name[32];

	/** probe - returns register width if implemented, 0 otherwise */
	int (*cppc_probe)(unsigned long reg);

	/** read the cppc register*/
	int (*cppc_read)(unsigned long reg, uint64_t *val);

	/** write to the cppc register*/
	int (*cppc_write)(unsigned long reg, uint64_t val);
};

int sbi_cppc_probe(unsigned long reg);
int sbi_cppc_read(unsigned long reg, uint64_t *val);
int sbi_cppc_write(unsigned long reg, uint64_t val);

const struct sbi_cppc_device *sbi_cppc_get_device(void);
void sbi_cppc_set_device(const struct sbi_cppc_device *dev);

#endif