Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
STG4000InitDevice.c File Reference
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/pci.h>
#include "STG4000Reg.h"
#include "STG4000Interface.h"

Go to the source code of this file.

Macros

#define SDRAM_CFG_0   0x49A1
 
#define SDRAM_CFG_1   0xA732
 
#define SDRAM_CFG_2   0x31
 
#define SDRAM_ARB_CFG   0xA0
 
#define SDRAM_REFRESH   0x20
 
#define PMX2_SOFTRESET_DAC_RST   0x0001
 
#define PMX2_SOFTRESET_C1_RST   0x0004
 
#define PMX2_SOFTRESET_C2_RST   0x0008
 
#define PMX2_SOFTRESET_3D_RST   0x0010
 
#define PMX2_SOFTRESET_VIDIN_RST   0x0020
 
#define PMX2_SOFTRESET_TLB_RST   0x0040
 
#define PMX2_SOFTRESET_SD_RST   0x0080
 
#define PMX2_SOFTRESET_VGA_RST   0x0100
 
#define PMX2_SOFTRESET_ROM_RST   0x0200 /* reserved bit, do not reset */
 
#define PMX2_SOFTRESET_TA_RST   0x0400
 
#define PMX2_SOFTRESET_REG_RST   0x4000
 
#define PMX2_SOFTRESET_ALL   0x7fff
 
#define CORE_PLL_FREQ   1000000
 
#define REF_FREQ   14318
 
#define PCI_CONFIG_SUBSYS_ID   0x2e
 
#define CORE_PLL_MODE_REG_0_7   3
 
#define CORE_PLL_MODE_REG_8_15   2
 
#define CORE_PLL_MODE_CONFIG_REG   1
 
#define DAC_PLL_CONFIG_REG   0
 
#define STG_MAX_VCO   500000
 
#define STG_MIN_VCO   100000
 
#define STG4K3_PLL_SCALER   8 /* scale numbers by 2^8 for fixed point calc */
 
#define STG4K3_PLL_MIN_R   2 /* Minimum multiplier */
 
#define STG4K3_PLL_MAX_R   33 /* Max */
 
#define STG4K3_PLL_MIN_F   2 /* Minimum divisor */
 
#define STG4K3_PLL_MAX_F   513 /* Max */
 
#define STG4K3_PLL_MIN_OD   0 /* Min output divider (shift) */
 
#define STG4K3_PLL_MAX_OD   2 /* Max */
 
#define STG4K3_PLL_MIN_VCO_SC   (100000000 >> STG4K3_PLL_SCALER) /* Min VCO rate */
 
#define STG4K3_PLL_MAX_VCO_SC   (500000000 >> STG4K3_PLL_SCALER) /* Max VCO rate */
 
#define STG4K3_PLL_MINR_VCO_SC   (100000000 >> STG4K3_PLL_SCALER) /* Min VCO rate (restricted) */
 
#define STG4K3_PLL_MAXR_VCO_SC   (500000000 >> STG4K3_PLL_SCALER) /* Max VCO rate (restricted) */
 
#define STG4K3_PLL_MINR_VCO   100000000 /* Min VCO rate (restricted) */
 
#define STG4K3_PLL_MAX_VCO   500000000 /* Max VCO rate */
 
#define STG4K3_PLL_MAXR_VCO   500000000 /* Max VCO rate (restricted) */
 
#define OS_DELAY(X)
 

Functions

u32 ProgramClock (u32 refClock, u32 coreClock, u32 *FOut, u32 *ROut, u32 *POut)
 
int SetCoreClockPLL (volatile STG4000REG __iomem *pSTGReg, struct pci_dev *pDev)
 

Macro Definition Documentation

#define CORE_PLL_FREQ   1000000

Definition at line 42 of file STG4000InitDevice.c.

#define CORE_PLL_MODE_CONFIG_REG   1

Definition at line 55 of file STG4000InitDevice.c.

#define CORE_PLL_MODE_REG_0_7   3

Definition at line 53 of file STG4000InitDevice.c.

#define CORE_PLL_MODE_REG_8_15   2

Definition at line 54 of file STG4000InitDevice.c.

#define DAC_PLL_CONFIG_REG   0

Definition at line 56 of file STG4000InitDevice.c.

#define OS_DELAY (   X)
Value:
{ \
volatile u32 i,count=0; \
for(i=0;i<X;i++) count++; \
}

Definition at line 77 of file STG4000InitDevice.c.

#define PCI_CONFIG_SUBSYS_ID   0x2e

Definition at line 50 of file STG4000InitDevice.c.

#define PMX2_SOFTRESET_3D_RST   0x0010

Definition at line 31 of file STG4000InitDevice.c.

#define PMX2_SOFTRESET_ALL   0x7fff

Definition at line 39 of file STG4000InitDevice.c.

#define PMX2_SOFTRESET_C1_RST   0x0004

Definition at line 29 of file STG4000InitDevice.c.

#define PMX2_SOFTRESET_C2_RST   0x0008

Definition at line 30 of file STG4000InitDevice.c.

#define PMX2_SOFTRESET_DAC_RST   0x0001

Definition at line 28 of file STG4000InitDevice.c.

#define PMX2_SOFTRESET_REG_RST   0x4000

Definition at line 38 of file STG4000InitDevice.c.

#define PMX2_SOFTRESET_ROM_RST   0x0200 /* reserved bit, do not reset */

Definition at line 36 of file STG4000InitDevice.c.

#define PMX2_SOFTRESET_SD_RST   0x0080

Definition at line 34 of file STG4000InitDevice.c.

#define PMX2_SOFTRESET_TA_RST   0x0400

Definition at line 37 of file STG4000InitDevice.c.

#define PMX2_SOFTRESET_TLB_RST   0x0040

Definition at line 33 of file STG4000InitDevice.c.

#define PMX2_SOFTRESET_VGA_RST   0x0100

Definition at line 35 of file STG4000InitDevice.c.

#define PMX2_SOFTRESET_VIDIN_RST   0x0020

Definition at line 32 of file STG4000InitDevice.c.

#define REF_FREQ   14318

Definition at line 45 of file STG4000InitDevice.c.

#define SDRAM_ARB_CFG   0xA0

Definition at line 24 of file STG4000InitDevice.c.

#define SDRAM_CFG_0   0x49A1

Definition at line 21 of file STG4000InitDevice.c.

#define SDRAM_CFG_1   0xA732

Definition at line 22 of file STG4000InitDevice.c.

#define SDRAM_CFG_2   0x31

Definition at line 23 of file STG4000InitDevice.c.

#define SDRAM_REFRESH   0x20

Definition at line 25 of file STG4000InitDevice.c.

#define STG4K3_PLL_MAX_F   513 /* Max */

Definition at line 66 of file STG4000InitDevice.c.

#define STG4K3_PLL_MAX_OD   2 /* Max */

Definition at line 68 of file STG4000InitDevice.c.

#define STG4K3_PLL_MAX_R   33 /* Max */

Definition at line 64 of file STG4000InitDevice.c.

#define STG4K3_PLL_MAX_VCO   500000000 /* Max VCO rate */

Definition at line 74 of file STG4000InitDevice.c.

#define STG4K3_PLL_MAX_VCO_SC   (500000000 >> STG4K3_PLL_SCALER) /* Max VCO rate */

Definition at line 70 of file STG4000InitDevice.c.

#define STG4K3_PLL_MAXR_VCO   500000000 /* Max VCO rate (restricted) */

Definition at line 75 of file STG4000InitDevice.c.

#define STG4K3_PLL_MAXR_VCO_SC   (500000000 >> STG4K3_PLL_SCALER) /* Max VCO rate (restricted) */

Definition at line 72 of file STG4000InitDevice.c.

#define STG4K3_PLL_MIN_F   2 /* Minimum divisor */

Definition at line 65 of file STG4000InitDevice.c.

#define STG4K3_PLL_MIN_OD   0 /* Min output divider (shift) */

Definition at line 67 of file STG4000InitDevice.c.

#define STG4K3_PLL_MIN_R   2 /* Minimum multiplier */

Definition at line 63 of file STG4000InitDevice.c.

#define STG4K3_PLL_MIN_VCO_SC   (100000000 >> STG4K3_PLL_SCALER) /* Min VCO rate */

Definition at line 69 of file STG4000InitDevice.c.

#define STG4K3_PLL_MINR_VCO   100000000 /* Min VCO rate (restricted) */

Definition at line 73 of file STG4000InitDevice.c.

#define STG4K3_PLL_MINR_VCO_SC   (100000000 >> STG4K3_PLL_SCALER) /* Min VCO rate (restricted) */

Definition at line 71 of file STG4000InitDevice.c.

#define STG4K3_PLL_SCALER   8 /* scale numbers by 2^8 for fixed point calc */

Definition at line 62 of file STG4000InitDevice.c.

#define STG_MAX_VCO   500000

Definition at line 58 of file STG4000InitDevice.c.

#define STG_MIN_VCO   100000

Definition at line 59 of file STG4000InitDevice.c.

Function Documentation

u32 ProgramClock ( u32  refClock,
u32  coreClock,
u32 FOut,
u32 ROut,
u32 POut 
)

Definition at line 117 of file STG4000InitDevice.c.

int SetCoreClockPLL ( volatile STG4000REG __iomem pSTGReg,
struct pci_dev pDev 
)

Definition at line 243 of file STG4000InitDevice.c.