ronnie
2022-10-23 1972b0e7ed50e5b37c5633d662ea03d23b15499c
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
 * SUNXI MBUS support
 *
 * Copyright (C) 2015 AllWinnertech Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that 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.
 */
 
#ifndef __LINUX_SUNXI_MBUS_H
#define __LINUX_SUNXI_MBUS_H
 
#include <linux/types.h>
 
/* MBUS PMU ids */
enum nsi_pmu {
   MBUS_PMU_CPU    = 0,
#if (defined CONFIG_ARCH_SUN50IW10)
   MBUS_PMU_GPU     = 1,
   MBUS_PMU_SD1     = 2,
   MBUS_PMU_MSTG    = 3,
   MBUS_PMU_GMAC0   = 4,
   MBUS_PMU_GMAC1   = 5,
   MBUS_PMU_USB0    = 6,
   MBUS_PMU_USB1    = 7,
   MBUS_PMU_NDFC    = 8,
   MBUS_PMU_DMAC    = 9,
   MBUS_PMU_CE      = 10,
   MBUS_PMU_DE0     = 11,
   MBUS_PMU_DE1     = 12,
   MBUS_PMU_VE      = 13,
   MBUS_PMU_CSI     = 14,
   MBUS_PMU_ISP     = 15,
   MBUS_PMU_G2D     = 16,
   MBUS_PMU_EINK    = 17,
   MBUS_PMU_IOMMU   = 18,
   MBUS_PMU_SYS_CPU = 19,
#endif
   MBUS_PMU_IAG_MAX,
   MBUS_PMU_TAG = 23,
   MBUS_PMU_MAX,
};
 
#if (defined CONFIG_ARCH_SUN50IW10)
static const char *const pmu_name[] = {
   "cpu", "gpu", "sd1", "mstg", "gmac0", "gmac1", "usb0", "usb1", "ndfc",
   "dmac", "ce", "de0", "de1", "ve", "csi", "isp", "g2d", "eink", "iommu",
   "sys_cpu", "total",
};
#endif
 
#define get_name(n)      pmu_name[n]
 
#ifdef CONFIG_SUNXI_NSI
extern int nsi_port_setpri(enum nsi_pmu port, unsigned int pri);
extern int nsi_port_setqos(enum nsi_pmu port, unsigned int qos);
extern bool nsi_probed(void);
#endif
 
#define nsi_disable_port_by_index(dev) \
   nsi_port_control_by_index(dev, false)
#define nsi_enable_port_by_index(dev) \
   nsi_port_control_by_index(dev, true)
 
#endif