prefetch_mod.h 1.2 KB
Newer Older
L
liqiang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright(c) 2019 Huawei Technologies Co., Ltd
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 * Create: 2020-07-02
 * Author: Liqiang (liqiang9102@gitee)
 */
L
liqiang2020 已提交
16 17 18
#ifndef __PREFETCH_TUNING__
#define __PREFETCH_TUNING__

L
liqiang 已提交
19
enum {
L
liqiang 已提交
20
    DISABLE = 0,
L
liqiang 已提交
21 22 23
    ENABLE
};

L
liqiang 已提交
24
#define CACHE_READUNIQ_CTRL (1L << 40)
L
liqiang2020 已提交
25 26 27

#ifdef CONFIG_ARCH_HISI
typedef struct {
L
liqiang 已提交
28 29 30 31
    long cpuprefctrl_el1;
    long adps_lld_ddr_el1;
    long adpp_l1v_mop_el1;
    long adps_lld_l3_el1;
L
liqiang2020 已提交
32 33 34 35 36 37 38
} cfg_t;
#else
typedef long cfg_t;
#endif

extern void set_prefetch(void* dummy);
extern void get_prefetch(void* dummy);
L
liqiang 已提交
39 40
extern void read_unique_set(void *dummy);
extern void read_unique_get(void *dummy);
L
liqiang2020 已提交
41 42 43 44 45 46
extern void reset_prefetch(void* dummy);

extern int prefetch_policy_num(void);
extern cfg_t *prefetch_policy(int policy);

#endif