lite5200b.h

来自「MPC5200 BSP 支持ATA,USB, I2C,扩展网口」· C头文件 代码 · 共 271 行

H
271
字号
#ifndef	INCLite5200h
#define	INCLite5200h

#ifdef __cplusplus
extern "C" {
#endif

#define MBAR_VALUE 0xF0000000

#include "arch/ppc/m5200.h"
#include "drv/intrCtl/m5200Intr.h"

/* Define CPU type and number of Serial channels  */

#define CPU                       PPC603 			/* CPU type                  */
#define BUS                       0      			/* bus-less board            */

#define CPU_TYPE                ((vxPvrGet() >> 16) & 0xffff)
#define CPU_TYPE_5200           0x8082    			/* PPC 5200 CPU */

#define N_SIO_CHANNELS            2     			/* No. serial I/O channels   */

/* Clock Parameters */

#define	SYS_CLK_RATE_MIN        10   				/* min system clock rate    */
#define	SYS_CLK_RATE_MAX        5000 				/* max system clock rate    */
#define	AUX_CLK_RATE_MIN        10    				/* min auxiliary clock rate */
#define	AUX_CLK_RATE_MAX        100000 				/* max auxiliary clock rate */

/* interrupt signal/level assignments */

#define COM1_BASE_ADR			PSC1_BASE_ADRS 		/* serial port 1 */
#define COM1_PORT_NUM			0
#define COM1_INT_LVL	        INUM_PSC1
#define COM1_INT_VEC            IV_PSC1

#define COM2_BASE_ADR			PSC2_BASE_ADRS 		/* serial port 2 */
#define COM2_PORT_NUM			1
#define COM2_INT_LVL	        INUM_PSC2
#define COM2_INT_VEC            IV_PSC2

/* M5200 PCI Memory map */

/* Slave window that makes local (60x bus) memory visible to PCI devices */

#define CPU_PCI_SLV_MEM_LOCAL_A 		MBAR_VALUE

#define BUS_PCI_SLV_MEM_LOCAL_A     0x80000000	
#define BUS_PCI_SLV_MEM_LOCAL_B     0xC0000000	

/* Latency Timer value - 64 PCI clocks */
#undef  PCI_LAT_TIMER  
#define PCI_LAT_TIMER           0xf8

/* initiator 0 - used for prefetchable memory */

#define CPU_PCI_MEM_ADRS    0x40000000  
#define PCI_MEM_SIZE        	0x10000000  
#define BUS_PCI_MEM_ADRS    0x40000000  

/* define for graphics DSP clear address*/
#define PCI0_INTR_CLEAR					((volatile UINT32 *)0x60400000)
#define PCI1_INTR_CLEAR					((volatile UINT32 *)0x60C00000)
#define PCI2_INTR_CLEAR					((volatile UINT32 *)0x61000000)
#define PCI3_INTR_CLEAR					((volatile UINT32 *)0x61400000)

#define MPC5200_IRQ_82559				INUM_IRQ3
#define NUM_ENET	4
#define FEI_UINT 3
#define PCI_IDSEL_82559  	18
/* initiator 1 - used for PCI IO */
/* BUS_PCI_IO_ADRS needs to be 0 in order to support 16 bit I/O on PCI */

#define CPU_PCI_IO_ADRS     	0x50000000  
#define PCI_IO_SIZE         		0x01000000  
#define BUS_PCI_IO_ADRS     	0x50000000  


/* initiator 2 - used for non prefetchable memory */

#define CPU_PCI_NO_PRE_MEM_ADRS   0x60000000  
#define PCI_NO_PRE_MEM_SIZE        	0x10000000  
#define BUS_PCI_NO_PRE_MEM_ADRS   0x60000000  


/* PCI IO memory adrs to CPU (60x bus) adrs */

#define PCI_IO2LOCAL(x)     ((int)(x) + CPU_PCI_IO_ADRS - BUS_PCI_IO_ADRS)

/* 60x bus adrs to PCI (non-prefetchable) memory address */
#define PCI_SLV_MEM_LOCAL 0
#define LOCAL2PCI_MEMIO(x)     ((int)(x) + PCI_SLV_MEM_LOCAL)

/* PCI device configuration definitions */
#ifndef PCI_CFG_FORCE
#    define PCI_CFG_FORCE	0x0     /* UNSUPPORTED */
#endif

#ifndef PCI_CFG_AUTO
#     define PCI_CFG_AUTO	0x1		/* IS SUPPORTED */
#endif
        
#ifndef PCI_CFG_NONE
#    define PCI_CFG_NONE	0x2		/* UNSUPPORTED */
#endif

#define MPC5200_PCI_BRIDGE      0

/* PCI configuration type */

#ifndef PCI_CFG_TYPE
#define PCI_CFG_TYPE		PCI_CFG_AUTO 
#endif

#ifndef _ASMLANGUAGE

#ifndef PCI_IN_BYTE
#   define PCI_IN_BYTE(x)       sysPciInByte ((UINT32)x)
    IMPORT  UINT8               sysPciInByte  (UINT32 address);
#endif

#ifndef PCI_IN_WORD
#   define PCI_IN_WORD(x)       sysPciInWord ((UINT32)x)
    IMPORT  UINT16              sysPciInWord  (UINT32 address);
#endif

#ifndef PCI_IN_LONG
#   define PCI_IN_LONG(x)       sysPciInLong ((UINT32)x)
    IMPORT  UINT32              sysPciInLong  (UINT32 address);
#endif

#ifndef PCI_OUT_BYTE
#   define PCI_OUT_BYTE(x,y)    sysPciOutByte ((UINT32)x,y)
    IMPORT  void                sysPciOutByte (UINT32 address, UINT8  data);
#endif

#ifndef PCI_OUT_WORD
#   define PCI_OUT_WORD(x,y)    sysPciOutWord ((UINT32)x,y)
    IMPORT  void                sysPciOutWord (UINT32 address, UINT16 data);
#endif

#ifndef PCI_OUT_LONG
#   define PCI_OUT_LONG(x,y)    sysPciOutLong ((UINT32)x,y)
    IMPORT  void                sysPciOutLong (UINT32 address, UINT32 data);
#endif

#define PCI_MAX_BUS		1 	 
#define PCI_MIN_DEV		0
#define PCI_MAX_DEV		30
#define PCI_MAX_FUNC		8

#endif  /* _ASMLANGUAGE */

/* Cache Line Size - 32 32-bit value = 128 bytes */

#define PCI_CLINE_SZ		0x20


/* CDM : Clock Distribution Module */

#define SYS_FREQ 		33000000L 			/* Ext. Clock : 33 MHz */
#define SYS_PLL_FREQ		(SYS_FREQ*16)			/* F_VCO : 528MHz */
#define XLB_CLOCK		(SYS_PLL_FREQ/4)		/* XL BUS Clock, XLB : 132MHz */
#define CORE_CLOCK_FREQ 	(XLB_CLOCK*3)			/* Core Clock : 462MHz 3.5 */
#define IPB_CLOCK		(XLB_CLOCK)  			/* IP BUS Clock : 132MHz */
#define PCI_CLOCK		(IPB_CLOCK/2)			/*  /4 33M /2 PCI BUS Clock : 66MHz */

/* CDM Configuration Register, (XLB_CLOCK,IPB_CLOCK,PCI_CLOCK) */

#define CDM_CFG_VALUE		0x01000001		/* xlb_clk=fsystem/4, ipb_clk=xlb_clk, 02 33M 01 pci_clk=ipb_clk/2 (66M) */

/* CDM 48MHz Fractional Divider Configuration Register 
; Settings: USB:              Use internal clock
;           Irda:             Use internal clock
;           Fraction Divider: Enable
;           Div Ratio:        FVCO CLK/11 (=48MHz) for PLL div 16
*/
#define CDM_DIV_VALUE		0x0001BBBB		

/* enable clock : 
     MEM, PCI, LocalPlus Bus, Slice Timer,
     BestComm, ATA, ETH, USB, SPI, DBLC
     PSC1
     MSCAN, I2C, Timer, GPIO 
*/
#define	CDM_ENA_VALUE		0x00FFFFFF


/* Decrementer */
#define DEC_CLOCK_FREQ      XLB_CLOCK
#define	DEC_CLK_TO_INC	    4	

/* Uarts (PSC1-6) */

#define UART_CLOCK			IPB_CLOCK

#define GPS_INIT_VALUE  0x90000044/* 0x91751144 */

#define	TAP_DEL	0x10

#define IPBI_WSE_VALUE		1

#define LPC_CS0_BOOT_CFG_VALUE	0x00087800 
#define LPC_CS1_CFG_VALUE	0x00087800
#define LPC_CS_DEAD_CTRL_VALUE	0x33333333

/* the next is required in configNet.h */
#define IPB_CLOCK_LITERAL	132000000 
#if (IPB_CLOCK != IPB_CLOCK_LITERAL)
#error
#endif

#define XLB_ADDR_TO		0xffffff
#define XLB_DATA_TO		0xffffff

/*
 * This macro returns the positive difference between two unsigned ints.
 * Useful for determining delta between two successive decrementer reads.
 */

#define DELTA(a,b)	        (abs((int)a - (int)b))

#define UART_REG_ADDR_INTERVAL  1 /* addr diff of adjacent regs */


/* General */

/* Common I/O synchronizing instructions */

#undef  EIEIO
#define EIEIO                   WRS_ASM("	eieio")

#undef  EIEIO_SYNC
#define EIEIO_SYNC              WRS_ASM("	eieio;	sync")

#define IS_LITE5200B

#define FLASH_SIZE			0x01000000    /*0x00400000	 4 MB */

#define DRAM_BITS	     	0x1A			/* 128MB */
#define	DRAM_CHIP_SIZE		0x08000000		/* 128MB */

/*
 * Vendor DRAM configuration
 */
#define SDRAM_MODE	0x018D0000
#define SDRAM_EMODE	0x40090000  /* reduced drive*/
#define SDRAM_CONTROL	0x714f0f00 /* 132M */
#define SDRAM_CONFIG1	0x73722930  /* 132M*/
#define SDRAM_CONFIG2	0x57770000
#define SDRAM_TAPDELAY	0x10000000

/* PCI */
#define MPC5200B_PCI_DEVICE_ID	0x5803 /* 5200*/
#define MPC5200B_PCI_VENDOR_ID	0x1057
#define MPC5200B_PCI_ID			((MPC5200B_PCI_DEVICE_ID << 16) | MPC5200B_PCI_VENDOR_ID)

/* I2C */
#define CONFIG_HARD_I2C
#define CFG_I2C_MODULE	2

#define CFG_I2C_SPEED	100000	/* 100kHz */
#define CFG_I2C_SLAVE	0x7F

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif	/* INClite5200 */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?