12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #ifndef BOOTROMINFO_H
- #define BOOTROMINFO_H
- #define SISSYSTEM_MMIO_BASE 0xBE000000
- /*** SYSTEM INFORMATION ***/
- typedef struct _SISSYSTEM_MMIO_REG{
- union{
- __u32 SysInfo[2];
- struct{
- __u16 VenderID;
- __u16 DeviceID;
- __u8 Aux_Vss;
- __u8 RevisionID;
- __u16 Information;
- };
- };
- }SISSYSTEM_MMIO_REG;
- enum _Revision_ID{
- SiS516_A0=0x0,
- SiS516_A1=0x10,
- SiS516_B0=0x20
- };
- enum _SiS328_Revision_ID{
- SiS328_A0=0x10,
- SiS328_A1=0x11,
- SiS328_B0=0x20
- };
- typedef struct _Board_Info { //0xba02a060
- unsigned int ChipType:4;
- unsigned int Reserved_0:4;
- unsigned int JpegEn:1;
- unsigned int HDMIx2:1;
- unsigned int Reserved_1:6;
- unsigned int MemType:4;
- unsigned int Reserved_2:12;
- }Board_Info,*pBoard_Info;
- enum _CHIPTYPE_t{
- OLD_BOOTROM=0,
- SiS_316VX,
- SiS_216VM,
- SiS_316MX,
- SiS_516PX
- };
- #define BOARDTYPE ((*(unsigned int*)0xba02a031)&3)
- #define IFOLDROM (((pBoard_Info)0xba02a060)->ChipType == OLD_BOOTROM)
- #define CHIPTYPE (((pBoard_Info)0xba02a060)->ChipType)
- #define IFRAM16BITS ((*(unsigned int*)0xbe0200a6)&1)
- #define HDMINUM ( 1 + (((pBoard_Info)0xba02a060)->HDMIx2) )
- #define MEMTYPE (((pBoard_Info)0xba02a060)->MemType)
- #define JPEG_SUPPORT (((pBoard_Info)0xba02a060)->JpegEn)
- #define POPPIP_SUPPORT (CHIPTYPE == SiS516PX)
- #define HVSIZE_SUPPORT ((*(unsigned char*)0xbe000005) == SiS516_B0)
- #define ISSIS516B0 ((*(unsigned char*)0xbe000005) == SiS516_B0)
- //----------------------------------------------------------------------
- //
- // Other definition
- //
- //----------------------------------------------------------------------
- static inline unsigned int MMIORead(unsigned int addr)
- {
- return ((volatile unsigned int) *(volatile unsigned int*)addr);
- }
- static inline unsigned int MMIOReadMask(unsigned int addr, unsigned int mask)
- {
- return ((volatile unsigned int)(*(unsigned int*)addr) & mask);
- }
- static inline void MMIOWrite(unsigned int addr, unsigned int data)
- {
- *(unsigned int*)addr = data;
- }
- static inline void MMIOWriteMask(unsigned int addr, unsigned int mask, unsigned int data)
- {
- unsigned int dwValue;
- dwValue = MMIOReadMask(addr, ~mask);
- MMIOWrite(addr, ((data & mask) | dwValue));
- }
- #endif
|