1 #ifndef DDK750_CHIP_H__
2 #define DDK750_CHIP_H__
3 #define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
4 #ifndef SM750LE_REVISION_ID
5 #define SM750LE_REVISION_ID ((unsigned char)0xfe)
9 #include <linux/ioport.h>
10 #include <linux/uaccess.h>
12 extern void __iomem *mmio750;
14 /* software control endianness */
15 static inline u32 peek32(u32 addr)
17 return readl(addr + mmio750);
20 static inline void poke32(u32 data, u32 addr)
22 writel(data, addr + mmio750);
25 /* This is all the chips recognized by this library */
26 typedef enum _logical_chip_type_t {
34 typedef enum _clock_type_t {
44 clock_type_t clockType;
45 unsigned long inputFreq; /* Input clock frequency to the PLL */
47 /* Use this when clockType = PANEL_PLL */
54 /* input struct to initChipParam() function */
55 struct initchip_param {
56 /* Use power mode 0 or 1 */
57 unsigned short powerMode;
60 * Speed of main chip clock in MHz unit
61 * 0 = keep the current clock setting
62 * Others = the new main chip clock
64 unsigned short chipClock;
67 * Speed of memory clock in MHz unit
68 * 0 = keep the current clock setting
69 * Others = the new memory clock
71 unsigned short memClock;
74 * Speed of master clock in MHz unit
75 * 0 = keep the current clock setting
76 * Others = the new master clock
78 unsigned short masterClock;
81 * 0 = leave all engine state untouched.
82 * 1 = make sure they are off: 2D, Overlay,
83 * video alpha, alpha, hardware cursors
85 unsigned short setAllEngOff;
88 * 0 = Do not reset the memory controller
89 * 1 = Reset the memory controller
91 unsigned char resetMemory;
93 /* More initialization parameter can be added if needed */
96 logical_chip_type_t sm750_get_chip_type(void);
97 void sm750_set_chip_type(unsigned short devId, u8 revId);
98 unsigned int sm750_calc_pll_value(unsigned int request, struct pll_value *pll);
99 unsigned int sm750_format_pll_reg(struct pll_value *pPLL);
100 unsigned int ddk750_get_vm_size(void);
101 int ddk750_init_hw(struct initchip_param *pinit_param);