Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. #ifndef _SOC_H_
  2. #define _SOC_H_
  3.  
  4. #include "types.h"
  5.  
  6. //#define GDB_SUPPORT
  7. //#define DYNAREC
  8. #define MAX_WTP                 32
  9. #define MAX_BKPT                32
  10.  
  11.  
  12.  
  13.  
  14. #ifndef GDB_SUPPORT
  15.         #ifdef DYNAREC
  16.                 #define _JIT
  17.         #endif
  18. #endif
  19.  
  20.  
  21.  
  22. #define CHAR_CTL_C      -1L
  23. #define CHAR_NONE       -2L
  24. typedef int (*readcharF)(void);
  25. typedef void (*writecharF)(int);
  26.  
  27. #define BLK_DEV_BLK_SZ  512
  28.  
  29. #define BLK_OP_SIZE     0
  30. #define BLK_OP_READ     1
  31. #define BLK_OP_WRITE    2
  32.  
  33. typedef int (*blockOp)(void* data, UInt32 sec, void* ptr, UInt8 op);
  34.  
  35. struct SoC;
  36.  
  37. typedef void (*SocRamAddF)(struct SoC* soc, void* data);
  38.  
  39. typedef struct{
  40.        
  41.         UInt32 (*WordGet)(UInt32 wordAddr);
  42.         void (*WordSet)(UInt32 wordAddr, UInt32 val);
  43.        
  44. }RamCallout;
  45.  
  46. void socRamModeAlloc(struct SoC* soc, void* ignored);
  47. void socRamModeCallout(struct SoC* soc, void* callout); //rally pointer to RamCallout
  48.  
  49. void socInit(struct SoC* soc, SocRamAddF raF, void* raD, readcharF rc, writecharF wc, blockOp blkF, void* blkD);
  50. void socRun(struct SoC* soc, UInt32 gdbPort);
  51.  
  52.  
  53.  
  54. extern volatile UInt32 gRtc;    //needed by SoC
  55.  
  56. #include "CPU.h"
  57. #include "MMU.h"
  58. #include "mem.h"
  59. #include "callout_RAM.h"
  60. #include "RAM.h"
  61. #include "cp15.h"
  62. #include "math64.h"
  63. #include "pxa255_IC.h"
  64. #include "pxa255_TIMR.h"
  65. #include "pxa255_RTC.h"
  66. #include "pxa255_UART.h"
  67. #include "pxa255_PwrClk.h"
  68. #include "pxa255_GPIO.h"
  69. #include "pxa255_DMA.h"
  70. #include "pxa255_DSP.h"
  71. #include "pxa255_LCD.h"
  72.  
  73. typedef struct SoC{
  74.  
  75.         readcharF rcF;
  76.         writecharF wcF;
  77.  
  78.         blockOp blkF;
  79.         void* blkD;
  80.        
  81.         UInt32 blkDevBuf[BLK_DEV_BLK_SZ / sizeof(UInt32)];
  82.  
  83.         union{
  84.                 ArmRam RAM;
  85.                 CalloutRam coRAM;
  86.         }ram;
  87.         ArmRam ROM;
  88.         ArmCpu cpu;
  89.         ArmMmu mmu;
  90.         ArmMem mem;
  91.         ArmCP15 cp15;
  92.         Pxa255ic ic;
  93.         Pxa255timr timr;
  94.         Pxa255rtc rtc;
  95.         Pxa255uart ffuart;
  96.         Pxa255uart btuart;
  97.         Pxa255uart stuart;
  98.         Pxa255pwrClk pwrClk;
  99.         Pxa255gpio gpio;
  100.         Pxa255dma dma;
  101.         Pxa255dsp dsp;
  102.         Pxa255lcd lcd;
  103.        
  104.         UInt8 go        :1;
  105.         UInt8 calloutMem:1;
  106.        
  107.         UInt32 romMem[13];              //space for embeddedBoot
  108.        
  109. #ifdef GDB_SUPPORT
  110.        
  111.         UInt8 nBkpt, nWtp;
  112.         UInt32 bkpt[MAX_BKPT];
  113.         UInt32 wtpA[MAX_WTP];
  114.         UInt8 wtpS[MAX_WTP];
  115.        
  116. #endif
  117.  
  118. }SoC;
  119.  
  120. #endif
  121.  
  122.