BootRomInfo.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef BOOTROMINFO_H
  2. #define BOOTROMINFO_H
  3. #define SISSYSTEM_MMIO_BASE 0xBE000000
  4. /*** SYSTEM INFORMATION ***/
  5. typedef struct _SISSYSTEM_MMIO_REG{
  6. union{
  7. __u32 SysInfo[2];
  8. struct{
  9. __u16 VenderID;
  10. __u16 DeviceID;
  11. __u8 Aux_Vss;
  12. __u8 RevisionID;
  13. __u16 Information;
  14. };
  15. };
  16. }SISSYSTEM_MMIO_REG;
  17. enum _Revision_ID{
  18. SiS516_A0=0x0,
  19. SiS516_A1=0x10,
  20. SiS516_B0=0x20
  21. };
  22. enum _SiS328_Revision_ID{
  23. SiS328_A0=0x10,
  24. SiS328_A1=0x11,
  25. SiS328_B0=0x20
  26. };
  27. typedef struct _Board_Info { //0xba02a060
  28. unsigned int ChipType:4;
  29. unsigned int Reserved_0:4;
  30. unsigned int JpegEn:1;
  31. unsigned int HDMIx2:1;
  32. unsigned int Reserved_1:6;
  33. unsigned int MemType:4;
  34. unsigned int Reserved_2:12;
  35. }Board_Info,*pBoard_Info;
  36. enum _CHIPTYPE_t{
  37. OLD_BOOTROM=0,
  38. SiS_316VX,
  39. SiS_216VM,
  40. SiS_316MX,
  41. SiS_516PX
  42. };
  43. #define BOARDTYPE ((*(unsigned int*)0xba02a031)&3)
  44. #define IFOLDROM (((pBoard_Info)0xba02a060)->ChipType == OLD_BOOTROM)
  45. #define CHIPTYPE (((pBoard_Info)0xba02a060)->ChipType)
  46. #define IFRAM16BITS ((*(unsigned int*)0xbe0200a6)&1)
  47. #define HDMINUM ( 1 + (((pBoard_Info)0xba02a060)->HDMIx2) )
  48. #define MEMTYPE (((pBoard_Info)0xba02a060)->MemType)
  49. #define JPEG_SUPPORT (((pBoard_Info)0xba02a060)->JpegEn)
  50. #define POPPIP_SUPPORT (CHIPTYPE == SiS516PX)
  51. #define HVSIZE_SUPPORT ((*(unsigned char*)0xbe000005) == SiS516_B0)
  52. #define ISSIS516B0 ((*(unsigned char*)0xbe000005) == SiS516_B0)
  53. //----------------------------------------------------------------------
  54. //
  55. // Other definition
  56. //
  57. //----------------------------------------------------------------------
  58. static inline unsigned int MMIORead(unsigned int addr)
  59. {
  60. return ((volatile unsigned int) *(volatile unsigned int*)addr);
  61. }
  62. static inline unsigned int MMIOReadMask(unsigned int addr, unsigned int mask)
  63. {
  64. return ((volatile unsigned int)(*(unsigned int*)addr) & mask);
  65. }
  66. static inline void MMIOWrite(unsigned int addr, unsigned int data)
  67. {
  68. *(unsigned int*)addr = data;
  69. }
  70. static inline void MMIOWriteMask(unsigned int addr, unsigned int mask, unsigned int data)
  71. {
  72. unsigned int dwValue;
  73. dwValue = MMIOReadMask(addr, ~mask);
  74. MMIOWrite(addr, ((data & mask) | dwValue));
  75. }
  76. #endif