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
10
11typedef enum _logical_chip_type_t
12{
13 SM_UNKNOWN,
14 SM718,
15 SM750,
16 SM750LE,
17}
18logical_chip_type_t;
19
20
21typedef enum _clock_type_t
22{
23 MXCLK_PLL,
24 PRIMARY_PLL,
25 SECONDARY_PLL,
26 VGA0_PLL,
27 VGA1_PLL,
28}
29clock_type_t;
30
31typedef struct _pll_value_t
32{
33 clock_type_t clockType;
34 unsigned long inputFreq;
35
36
37 unsigned long M;
38 unsigned long N;
39 unsigned long OD;
40 unsigned long POD;
41}
42pll_value_t;
43
44
45typedef struct _initchip_param_t
46{
47 unsigned short powerMode;
48 unsigned short chipClock;
49
50
51
52 unsigned short memClock;
53
54
55
56 unsigned short masterClock;
57
58
59
60 unsigned short setAllEngOff;
61
62
63
64 unsigned char resetMemory;
65
66
67
68
69}
70initchip_param_t;
71
72
73logical_chip_type_t getChipType(void);
74unsigned int calcPllValue(unsigned int request,pll_value_t *pll);
75unsigned int calcPllValue2(unsigned int,pll_value_t *);
76unsigned int formatPllReg(pll_value_t *pPLL);
77void ddk750_set_mmio(void __iomem *,unsigned short,char);
78unsigned int ddk750_getVMSize(void);
79int ddk750_initHw(initchip_param_t *);
80unsigned int getPllValue(clock_type_t clockType, pll_value_t *pPLL);
81unsigned int getChipClock(void);
82void setChipClock(unsigned int);
83void setMemoryClock(unsigned int frequency);
84void setMasterClock(unsigned int frequency);
85
86
87#endif
88