1#ifndef DDK750_CHIP_H__
2#define DDK750_CHIP_H__
3#define DEFAULT_INPUT_CLOCK 14318181
4#ifndef SM750LE_REVISION_ID
5#define SM750LE_REVISION_ID ((unsigned char)0xfe)
6#endif
7
8#include <linux/io.h>
9#include <linux/ioport.h>
10#include <linux/uaccess.h>
11
12extern void __iomem *mmio750;
13
14
15static inline u32 peek32(u32 addr)
16{
17 return readl(addr + mmio750);
18}
19
20static inline void poke32(u32 data, u32 addr)
21{
22 writel(data, addr + mmio750);
23}
24
25
26typedef enum _logical_chip_type_t {
27 SM_UNKNOWN,
28 SM718,
29 SM750,
30 SM750LE,
31}
32logical_chip_type_t;
33
34typedef enum _clock_type_t {
35 MXCLK_PLL,
36 PRIMARY_PLL,
37 SECONDARY_PLL,
38 VGA0_PLL,
39 VGA1_PLL,
40}
41clock_type_t;
42
43struct pll_value {
44 clock_type_t clockType;
45 unsigned long inputFreq;
46
47
48 unsigned long M;
49 unsigned long N;
50 unsigned long OD;
51 unsigned long POD;
52};
53
54
55struct initchip_param {
56
57 unsigned short powerMode;
58
59
60
61
62
63
64 unsigned short chipClock;
65
66
67
68
69
70
71 unsigned short memClock;
72
73
74
75
76
77
78 unsigned short masterClock;
79
80
81
82
83
84
85 unsigned short setAllEngOff;
86
87
88
89
90
91 unsigned char resetMemory;
92
93
94};
95
96logical_chip_type_t sm750_get_chip_type(void);
97void sm750_set_chip_type(unsigned short devId, u8 revId);
98unsigned int sm750_calc_pll_value(unsigned int request, struct pll_value *pll);
99unsigned int sm750_format_pll_reg(struct pll_value *pPLL);
100unsigned int ddk750_get_vm_size(void);
101int ddk750_init_hw(struct initchip_param *pinit_param);
102
103#endif
104