00001 #ifndef ACCESS_SDSP_H
00002 #define ACCESS_SDSP_H
00003 #include "utilities.h"
00004
00005
00006 #define SDSP_HPIC(sdsp) (REG_BASE +((SDSP_BASE +(sdsp<<15) +0x0000) << 2))
00007 #define SDSP_HPIA(sdsp) (REG_BASE +((SDSP_BASE +(sdsp<<15) +0x0001) << 2))
00008 #define SDSP_HPID_I(sdsp) (REG_BASE +((SDSP_BASE +(sdsp<<15) +0x0002) << 2))
00009 #define SDSP_HPID(sdsp) (REG_BASE +((SDSP_BASE +(sdsp<<15) +0x0003) << 2))
00010
00011 #define SDSP_DOES_NOT_EXIST(x) (x < 0)
00012 #define SDSP_NOT_CONFIGURED(x) (x == 0)
00013 #define SDSP_HOST_LIST_BUSY(x) (!slvHostListIdle(x) || getSlvAck(x))
00014 #define SDSP_IDSP_LIST_BUSY (!intrDspListSendIdle() || getIntrDspAck())
00015
00016 extern uint32 *emifGCR;
00017
00018
00019
00020 #define waitArdy while (!(*emifGCR & 0x00000400))
00021
00022
00023
00024
00025 static inline void writeSdspHpic(uint32 sdsp, uint32 dataValue) {
00026 *((uint32 *) (SDSP_HPIC(sdsp)))= dataValue;
00027 waitArdy;
00028 }
00029
00030
00031 static inline void writeSdspHpia(uint32 sdsp, uint32 dataValue) {
00032 *((uint32 *) (SDSP_HPIA(sdsp)))= dataValue;
00033 waitArdy;
00034
00035
00036
00037 }
00038
00039
00040 static inline void writeSdspHpid(uint32 sdsp, uint32 dataValue) {
00041 *((uint32 *) (SDSP_HPID(sdsp)))= dataValue;
00042 waitArdy;
00043 }
00044
00045
00046 static inline void writeSdspHpid_i(uint32 sdsp, uint32 dataValue) {
00047 *((uint32 *) (SDSP_HPID_I(sdsp)))= dataValue;
00048 waitArdy;
00049 }
00050
00051
00052 static inline uint32 readSdspHpic(uint32 sdsp) {
00053 return *((uint32 *) (SDSP_HPIC(sdsp)));
00054 }
00055
00056
00057 static inline uint32 readSdspHpia(uint32 sdsp) {
00058 return *((uint32 *) (SDSP_HPIA(sdsp)));
00059 }
00060
00061
00062 static inline uint32 readSdspHpid(uint32 sdsp) {
00063 return *((uint32 *) (SDSP_HPID(sdsp)));
00064 }
00065
00066
00067 static inline uint32 readSdspHpid_i(uint32 sdsp) {
00068 return *((uint32 *) (SDSP_HPID_I(sdsp)));
00069 }
00070
00071 static inline void readSdspBlockI(uint32 sdsp, uint32 *sdspPtr, uint32 *ptr, uint32 len) {
00072 uint32 i;
00073
00074
00075 writeSdspHpia(sdsp, (uint32) sdspPtr);
00076
00077 for (i=0; i<(len-1); ++i) *(ptr +i)= readSdspHpid_i(sdsp);
00078 *(ptr +i)= readSdspHpid(sdsp);
00079
00080 }
00081
00082 static inline void readSdspBlockI2(uint32 sdsp, uint32 *sdspPtr, uint32 *ptr, uint32 len) {
00083 uint32 i;
00084
00085
00086 *((uint32 *) (SDSP_HPIA(sdsp)))= (uint32) sdspPtr;
00087 waitArdy;
00088
00089 for (i=0; i<(len-1); ++i) *(ptr +i)= *((uint32 *) (SDSP_HPID_I(sdsp)));
00090 *(ptr +i)= *((uint32 *) (SDSP_HPID(sdsp)));
00091
00092 }
00093
00094
00095 #endif