![Matthieu Simon](/assets/img/avatar_default.png)
POKE32 and PEEK32 have been replaced by inlined functions poke32 and peek32. Having inline functions instead of macros help to get the correct type-checking and avoid the possible precedence issues reported by checkpatch. Signed-off-by: Matthieu Simon <gmatthsim@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
104 lines
2.2 KiB
C
104 lines
2.2 KiB
C
#ifndef DDK750_CHIP_H__
|
|
#define DDK750_CHIP_H__
|
|
#define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
|
|
#ifndef SM750LE_REVISION_ID
|
|
#define SM750LE_REVISION_ID ((unsigned char)0xfe)
|
|
#endif
|
|
|
|
#include <linux/io.h>
|
|
#include <linux/ioport.h>
|
|
#include <linux/uaccess.h>
|
|
|
|
extern void __iomem *mmio750;
|
|
|
|
/* software control endianness */
|
|
static inline u32 peek32(u32 addr)
|
|
{
|
|
return readl(addr + mmio750);
|
|
}
|
|
|
|
static inline void poke32(u32 data, u32 addr)
|
|
{
|
|
writel(data, addr + mmio750);
|
|
}
|
|
|
|
/* This is all the chips recognized by this library */
|
|
typedef enum _logical_chip_type_t {
|
|
SM_UNKNOWN,
|
|
SM718,
|
|
SM750,
|
|
SM750LE,
|
|
}
|
|
logical_chip_type_t;
|
|
|
|
typedef enum _clock_type_t {
|
|
MXCLK_PLL,
|
|
PRIMARY_PLL,
|
|
SECONDARY_PLL,
|
|
VGA0_PLL,
|
|
VGA1_PLL,
|
|
}
|
|
clock_type_t;
|
|
|
|
struct pll_value {
|
|
clock_type_t clockType;
|
|
unsigned long inputFreq; /* Input clock frequency to the PLL */
|
|
|
|
/* Use this when clockType = PANEL_PLL */
|
|
unsigned long M;
|
|
unsigned long N;
|
|
unsigned long OD;
|
|
unsigned long POD;
|
|
};
|
|
|
|
/* input struct to initChipParam() function */
|
|
struct initchip_param {
|
|
/* Use power mode 0 or 1 */
|
|
unsigned short powerMode;
|
|
|
|
/*
|
|
* Speed of main chip clock in MHz unit
|
|
* 0 = keep the current clock setting
|
|
* Others = the new main chip clock
|
|
*/
|
|
unsigned short chipClock;
|
|
|
|
/*
|
|
* Speed of memory clock in MHz unit
|
|
* 0 = keep the current clock setting
|
|
* Others = the new memory clock
|
|
*/
|
|
unsigned short memClock;
|
|
|
|
/*
|
|
* Speed of master clock in MHz unit
|
|
* 0 = keep the current clock setting
|
|
* Others = the new master clock
|
|
*/
|
|
unsigned short masterClock;
|
|
|
|
/*
|
|
* 0 = leave all engine state untouched.
|
|
* 1 = make sure they are off: 2D, Overlay,
|
|
* video alpha, alpha, hardware cursors
|
|
*/
|
|
unsigned short setAllEngOff;
|
|
|
|
/*
|
|
* 0 = Do not reset the memory controller
|
|
* 1 = Reset the memory controller
|
|
*/
|
|
unsigned char resetMemory;
|
|
|
|
/* More initialization parameter can be added if needed */
|
|
};
|
|
|
|
logical_chip_type_t sm750_get_chip_type(void);
|
|
void sm750_set_chip_type(unsigned short devId, u8 revId);
|
|
unsigned int sm750_calc_pll_value(unsigned int request, struct pll_value *pll);
|
|
unsigned int sm750_format_pll_reg(struct pll_value *pPLL);
|
|
unsigned int ddk750_get_vm_size(void);
|
|
int ddk750_init_hw(struct initchip_param *);
|
|
|
|
#endif
|