File: fdt_cache.h

package info (click to toggle)
opensbi 1.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,480 kB
  • sloc: ansic: 34,934; python: 4,658; asm: 1,113; makefile: 639; sh: 329
file content (34 lines) | stat: -rw-r--r-- 911 bytes parent folder | download
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
/*
 * SPDX-License-Identifier: BSD-2-Clause
 *
 * Copyright (c) 2025 SiFive Inc.
 */

#ifndef __FDT_CACHE_H__
#define __FDT_CACHE_H__

#include <sbi_utils/cache/cache.h>

/**
 * Register a cache device using information from the DT
 *
 * @param fdt devicetree blob
 * @param noff offset of a node in the devicetree blob
 * @param dev cache device to register for this devicetree node
 *
 * @return 0 on success, or a negative error code on failure
 */
int fdt_cache_add(const void *fdt, int noff, struct cache_device *dev);

/**
 * Get the cache device referencd by the "next-level-cache" property of a DT node
 *
 * @param fdt devicetree blob
 * @param noff offset of a node in the devicetree blob
 * @param out_dev location to return the cache device
 *
 * @return 0 on success, or a negative error code on failure
 */
int fdt_next_cache_get(const void *fdt, int noff, struct cache_device **out_dev);

#endif