Loading...
Searching...
No Matches
Go to the documentation of this file.
74#define RDRAM_0_START 0x00000000
75#define RDRAM_0_END 0x001FFFFF
76#define RDRAM_1_START 0x00200000
77#define RDRAM_1_END 0x003FFFFF
79#define RDRAM_START RDRAM_0_START
80#define RDRAM_END RDRAM_1_END
85#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
86#define IS_RDRAM(x) ((unsigned) (x) >= RDRAM_START && (unsigned) (x) < RDRAM_END)
92#define RDRAM_BASE_REG 0x03F00000
94#define RDRAM_CONFIG_REG (RDRAM_BASE_REG + 0x00)
95#define RDRAM_DEVICE_TYPE_REG (RDRAM_BASE_REG + 0x00)
96#define RDRAM_DEVICE_ID_REG (RDRAM_BASE_REG + 0x04)
97#define RDRAM_DELAY_REG (RDRAM_BASE_REG + 0x08)
98#define RDRAM_MODE_REG (RDRAM_BASE_REG + 0x0c)
99#define RDRAM_REF_INTERVAL_REG (RDRAM_BASE_REG + 0x10)
100#define RDRAM_REF_ROW_REG (RDRAM_BASE_REG + 0x14)
101#define RDRAM_RAS_INTERVAL_REG (RDRAM_BASE_REG + 0x18)
102#define RDRAM_MIN_INTERVAL_REG (RDRAM_BASE_REG + 0x1c)
103#define RDRAM_ADDR_SELECT_REG (RDRAM_BASE_REG + 0x20)
104#define RDRAM_DEVICE_MANUF_REG (RDRAM_BASE_REG + 0x24)
106#define RDRAM_0_DEVICE_ID 0
107#define RDRAM_1_DEVICE_ID 1
109#define RDRAM_RESET_MODE 0
110#define RDRAM_ACTIVE_MODE 1
111#define RDRAM_STANDBY_MODE 2
113#define RDRAM_LENGTH (2 * 512 * 2048)
114#define RDRAM_0_BASE_ADDRESS (RDRAM_0_DEVICE_ID * RDRAM_LENGTH)
115#define RDRAM_1_BASE_ADDRESS (RDRAM_1_DEVICE_ID * RDRAM_LENGTH)
117#define RDRAM_0_CONFIG 0x00000
118#define RDRAM_1_CONFIG 0x00400
119#define RDRAM_GLOBAL_CONFIG 0x80000
132#define PIF_ROM_START 0x1FC00000
133#define PIF_ROM_END 0x1FC007BF
134#define PIF_RAM_START 0x1FC007C0
135#define PIF_RAM_END 0x1FC007FF
143#define CHNL_ERR_NORESP 0x80
144#define CHNL_ERR_OVERRUN 0x40
145#define CHNL_ERR_FRAME 0x80
146#define CHNL_ERR_COLLISION 0x40
148#define CHNL_ERR_MASK 0xC0
153#define DEVICE_TYPE_CART 0
154#define DEVICE_TYPE_BULK 1
155#define DEVICE_TYPE_64DD 2
156#define DEVICE_TYPE_SRAM 3
161#define SP_DMEM_START 0x04000000
162#define SP_DMEM_END 0x04000FFF
163#define SP_IMEM_START 0x04001000
164#define SP_IMEM_END 0x04001FFF
170#define SP_BASE_REG 0x04040000
173#define SP_MEM_ADDR_REG (SP_BASE_REG + 0x00)
176#define SP_DRAM_ADDR_REG (SP_BASE_REG + 0x04)
180#define SP_RD_LEN_REG (SP_BASE_REG + 0x08)
184#define SP_WR_LEN_REG (SP_BASE_REG + 0x0C)
187#define SP_STATUS_REG (SP_BASE_REG + 0x10)
190#define SP_DMA_FULL_REG (SP_BASE_REG + 0x14)
193#define SP_DMA_BUSY_REG (SP_BASE_REG + 0x18)
197#define SP_SEMAPHORE_REG (SP_BASE_REG + 0x1C)
200#define SP_PC_REG 0x04080000
203#define SP_DMA_DMEM 0x0000
204#define SP_DMA_IMEM 0x1000
209#define SP_CLR_HALT 0x00001
210#define SP_SET_HALT 0x00002
211#define SP_CLR_BROKE 0x00004
212#define SP_CLR_INTR 0x00008
213#define SP_SET_INTR 0x00010
214#define SP_CLR_SSTEP 0x00020
215#define SP_SET_SSTEP 0x00040
216#define SP_CLR_INTR_BREAK 0x00080
217#define SP_SET_INTR_BREAK 0x00100
218#define SP_CLR_SIG0 0x00200
219#define SP_SET_SIG0 0x00400
220#define SP_CLR_SIG1 0x00800
221#define SP_SET_SIG1 0x01000
222#define SP_CLR_SIG2 0x02000
223#define SP_SET_SIG2 0x04000
224#define SP_CLR_SIG3 0x08000
225#define SP_SET_SIG3 0x10000
226#define SP_CLR_SIG4 0x20000
227#define SP_SET_SIG4 0x40000
228#define SP_CLR_SIG5 0x80000
229#define SP_SET_SIG5 0x100000
230#define SP_CLR_SIG6 0x200000
231#define SP_SET_SIG6 0x400000
232#define SP_CLR_SIG7 0x800000
233#define SP_SET_SIG7 0x1000000
238#define SP_STATUS_HALT 0x001
239#define SP_STATUS_BROKE 0x002
240#define SP_STATUS_DMA_BUSY 0x004
241#define SP_STATUS_DMA_FULL 0x008
242#define SP_STATUS_IO_FULL 0x010
243#define SP_STATUS_SSTEP 0x020
244#define SP_STATUS_INTR_BREAK 0x040
245#define SP_STATUS_SIG0 0x080
246#define SP_STATUS_SIG1 0x100
247#define SP_STATUS_SIG2 0x200
248#define SP_STATUS_SIG3 0x400
249#define SP_STATUS_SIG4 0x800
250#define SP_STATUS_SIG5 0x1000
251#define SP_STATUS_SIG6 0x2000
252#define SP_STATUS_SIG7 0x4000
257#define SP_CLR_YIELD SP_CLR_SIG0
258#define SP_SET_YIELD SP_SET_SIG0
259#define SP_STATUS_YIELD SP_STATUS_SIG0
260#define SP_CLR_YIELDED SP_CLR_SIG1
261#define SP_SET_YIELDED SP_SET_SIG1
262#define SP_STATUS_YIELDED SP_STATUS_SIG1
263#define SP_CLR_TASKDONE SP_CLR_SIG2
264#define SP_SET_TASKDONE SP_SET_SIG2
265#define SP_STATUS_TASKDONE SP_STATUS_SIG2
266#define SP_CLR_RSPSIGNAL SP_CLR_SIG3
267#define SP_SET_RSPSIGNAL SP_SET_SIG3
268#define SP_STATUS_RSPSIGNAL SP_STATUS_SIG3
269#define SP_CLR_CPUSIGNAL SP_CLR_SIG4
270#define SP_SET_CPUSIGNAL SP_SET_SIG4
271#define SP_STATUS_CPUSIGNAL SP_STATUS_SIG4
274#define SP_IBIST_REG 0x04080004
279#define SP_IBIST_CHECK 0x01
280#define SP_IBIST_GO 0x02
281#define SP_IBIST_CLEAR 0x04
289#define SP_IBIST_DONE 0x04
290#define SP_IBIST_FAILED 0x78
295#define DPC_BASE_REG 0x04100000
298#define DPC_START_REG (DPC_BASE_REG + 0x00)
301#define DPC_END_REG (DPC_BASE_REG + 0x04)
304#define DPC_CURRENT_REG (DPC_BASE_REG + 0x08)
307#define DPC_STATUS_REG (DPC_BASE_REG + 0x0C)
310#define DPC_CLOCK_REG (DPC_BASE_REG + 0x10)
313#define DPC_BUFBUSY_REG (DPC_BASE_REG + 0x14)
316#define DPC_PIPEBUSY_REG (DPC_BASE_REG + 0x18)
319#define DPC_TMEM_REG (DPC_BASE_REG + 0x1C)
324#define DPC_CLR_XBUS_DMEM_DMA 0x0001
325#define DPC_SET_XBUS_DMEM_DMA 0x0002
326#define DPC_CLR_FREEZE 0x0004
327#define DPC_SET_FREEZE 0x0008
328#define DPC_CLR_FLUSH 0x0010
329#define DPC_SET_FLUSH 0x0020
330#define DPC_CLR_TMEM_CTR 0x0040
331#define DPC_CLR_PIPE_CTR 0x0080
332#define DPC_CLR_CMD_CTR 0x0100
333#define DPC_CLR_CLOCK_CTR 0x0200
338#define DPC_STATUS_XBUS_DMEM_DMA 0x001
339#define DPC_STATUS_FREEZE 0x002
340#define DPC_STATUS_FLUSH 0x004
342#define DPC_STATUS_START_GCLK 0x008
343#define DPC_STATUS_TMEM_BUSY 0x010
344#define DPC_STATUS_PIPE_BUSY 0x020
345#define DPC_STATUS_CMD_BUSY 0x040
346#define DPC_STATUS_CBUF_READY 0x080
347#define DPC_STATUS_DMA_BUSY 0x100
348#define DPC_STATUS_END_VALID 0x200
349#define DPC_STATUS_START_VALID 0x400
354#define DPS_BASE_REG 0x04200000
357#define DPS_TBIST_REG (DPS_BASE_REG + 0x00)
360#define DPS_TEST_MODE_REG (DPS_BASE_REG + 0x04)
363#define DPS_BUFTEST_ADDR_REG (DPS_BASE_REG + 0x08)
366#define DPS_BUFTEST_DATA_REG (DPS_BASE_REG + 0x0C)
371#define DPS_TBIST_CHECK 0x01
372#define DPS_TBIST_GO 0x02
373#define DPS_TBIST_CLEAR 0x04
381#define DPS_TBIST_DONE 0x004
382#define DPS_TBIST_FAILED 0x7F8
387#define MI_BASE_REG 0x04300000
394#define MI_INIT_MODE_REG (MI_BASE_REG + 0x00)
395#define MI_MODE_REG MI_INIT_MODE_REG
400#define MI_CLR_INIT 0x0080
401#define MI_SET_INIT 0x0100
402#define MI_CLR_EBUS 0x0200
403#define MI_SET_EBUS 0x0400
404#define MI_CLR_DP_INTR 0x0800
405#define MI_CLR_RDRAM 0x1000
406#define MI_SET_RDRAM 0x2000
411#define MI_MODE_INIT 0x0080
412#define MI_MODE_EBUS 0x0100
413#define MI_MODE_RDRAM 0x0200
416#define MI_VERSION_REG (MI_BASE_REG + 0x04)
417#define MI_NOOP_REG MI_VERSION_REG
420#define MI_INTR_REG (MI_BASE_REG + 0x08)
426#define MI_INTR_MASK_REG (MI_BASE_REG + 0x0C)
431#define MI_INTR_SP 0x01
432#define MI_INTR_SI 0x02
433#define MI_INTR_AI 0x04
434#define MI_INTR_VI 0x08
435#define MI_INTR_PI 0x10
436#define MI_INTR_DP 0x20
443#define MI_INTR_MASK_CLR_SP 0x0001
444#define MI_INTR_MASK_SET_SP 0x0002
445#define MI_INTR_MASK_CLR_SI 0x0004
446#define MI_INTR_MASK_SET_SI 0x0008
447#define MI_INTR_MASK_CLR_AI 0x0010
448#define MI_INTR_MASK_SET_AI 0x0020
449#define MI_INTR_MASK_CLR_VI 0x0040
450#define MI_INTR_MASK_SET_VI 0x0080
451#define MI_INTR_MASK_CLR_PI 0x0100
452#define MI_INTR_MASK_SET_PI 0x0200
453#define MI_INTR_MASK_CLR_DP 0x0400
454#define MI_INTR_MASK_SET_DP 0x0800
460#define MI_INTR_MASK_SP 0x01
461#define MI_INTR_MASK_SI 0x02
462#define MI_INTR_MASK_AI 0x04
463#define MI_INTR_MASK_VI 0x08
464#define MI_INTR_MASK_PI 0x10
465#define MI_INTR_MASK_DP 0x20
470#define VI_BASE_REG 0x04400000
493#define VI_STATUS_REG (VI_BASE_REG + 0x00)
494#define VI_CONTROL_REG VI_STATUS_REG
497#define VI_ORIGIN_REG (VI_BASE_REG + 0x04)
498#define VI_DRAM_ADDR_REG VI_ORIGIN_REG
501#define VI_WIDTH_REG (VI_BASE_REG + 0x08)
502#define VI_H_WIDTH_REG VI_WIDTH_REG
505#define VI_INTR_REG (VI_BASE_REG + 0x0C)
506#define VI_V_INTR_REG VI_INTR_REG
515#define VI_CURRENT_REG (VI_BASE_REG + 0x10)
516#define VI_V_CURRENT_LINE_REG VI_CURRENT_REG
524#define VI_BURST_REG (VI_BASE_REG + 0x14)
525#define VI_TIMING_REG VI_BURST_REG
528#define VI_V_SYNC_REG (VI_BASE_REG + 0x18)
534#define VI_H_SYNC_REG (VI_BASE_REG + 0x1C)
540#define VI_LEAP_REG (VI_BASE_REG + 0x20)
541#define VI_H_SYNC_LEAP_REG VI_LEAP_REG
547#define VI_H_START_REG (VI_BASE_REG + 0x24)
548#define VI_H_VIDEO_REG VI_H_START_REG
554#define VI_V_START_REG (VI_BASE_REG + 0x28)
555#define VI_V_VIDEO_REG VI_V_START_REG
561#define VI_V_BURST_REG (VI_BASE_REG + 0x2C)
566#define VI_X_SCALE_REG (VI_BASE_REG + 0x30)
571#define VI_Y_SCALE_REG (VI_BASE_REG + 0x34)
576#define VI_CTRL_TYPE_16 0x00002
577#define VI_CTRL_TYPE_32 0x00003
578#define VI_CTRL_GAMMA_DITHER_ON 0x00004
579#define VI_CTRL_GAMMA_ON 0x00008
580#define VI_CTRL_DIVOT_ON 0x00010
581#define VI_CTRL_SERRATE_ON 0x00040
582#define VI_CTRL_ANTIALIAS_MASK 0x00300
583#define VI_CTRL_DITHER_FILTER_ON 0x10000
588#define VI_NTSC_CLOCK 48681812
589#define VI_PAL_CLOCK 49656530
590#define VI_MPAL_CLOCK 48628316
599#define AI_BASE_REG 0x04500000
602#define AI_DRAM_ADDR_REG (AI_BASE_REG + 0x00)
606#define AI_LEN_REG (AI_BASE_REG + 0x04)
609#define AI_CONTROL_REG (AI_BASE_REG + 0x08)
616#define AI_STATUS_REG (AI_BASE_REG + 0x0C)
623#define AI_DACRATE_REG (AI_BASE_REG + 0x10)
630#define AI_BITRATE_REG (AI_BASE_REG + 0x14)
633#define AI_CONTROL_DMA_ON 0x01
634#define AI_CONTROL_DMA_OFF 0x00
637#define AI_STATUS_FIFO_FULL 0x80000000
638#define AI_STATUS_DMA_BUSY 0x40000000
643#define AI_MAX_DAC_RATE 16384
644#define AI_MIN_DAC_RATE 132
647#define AI_MAX_BIT_RATE 16
648#define AI_MIN_BIT_RATE 2
655#define AI_NTSC_MAX_FREQ 368000
656#define AI_NTSC_MIN_FREQ 3000
658#define AI_PAL_MAX_FREQ 376000
659#define AI_PAL_MIN_FREQ 3050
661#define AI_MPAL_MAX_FREQ 368000
662#define AI_MPAL_MIN_FREQ 3000
667#define PI_BASE_REG 0x04600000
670#define PI_DRAM_ADDR_REG (PI_BASE_REG + 0x00)
673#define PI_CART_ADDR_REG (PI_BASE_REG + 0x04)
676#define PI_RD_LEN_REG (PI_BASE_REG + 0x08)
679#define PI_WR_LEN_REG (PI_BASE_REG + 0x0C)
685#define PI_STATUS_REG (PI_BASE_REG + 0x10)
688#define PI_BSD_DOM1_LAT_REG (PI_BASE_REG + 0x14)
691#define PI_BSD_DOM1_PWD_REG (PI_BASE_REG + 0x18)
694#define PI_BSD_DOM1_PGS_REG (PI_BASE_REG + 0x1C)
697#define PI_BSD_DOM1_RLS_REG (PI_BASE_REG + 0x20)
700#define PI_BSD_DOM2_LAT_REG (PI_BASE_REG + 0x24)
703#define PI_BSD_DOM2_PWD_REG (PI_BASE_REG + 0x28)
706#define PI_BSD_DOM2_PGS_REG (PI_BASE_REG + 0x2C)
709#define PI_BSD_DOM2_RLS_REG (PI_BASE_REG + 0x30)
711#define PI_DOMAIN1_REG PI_BSD_DOM1_LAT_REG
712#define PI_DOMAIN2_REG PI_BSD_DOM2_LAT_REG
714#define PI_DOM_LAT_OFS 0x00
715#define PI_DOM_PWD_OFS 0x04
716#define PI_DOM_PGS_OFS 0x08
717#define PI_DOM_RLS_OFS 0x0C
725#define PI_STATUS_ERROR 0x04
726#define PI_STATUS_IO_BUSY 0x02
727#define PI_STATUS_DMA_BUSY 0x01
753#define PI_STATUS_RESET 0x01
754#define PI_SET_RESET PI_STATUS_RESET
756#define PI_STATUS_CLR_INTR 0x02
757#define PI_CLR_INTR PI_STATUS_CLR_INTR
759#define PI_DMA_BUFFER_SIZE 128
761#define PI_DOM1_ADDR1 0x06000000
762#define PI_DOM1_ADDR2 0x10000000
763#define PI_DOM1_ADDR3 0x1FD00000
764#define PI_DOM2_ADDR1 0x05000000
765#define PI_DOM2_ADDR2 0x08000000
770#define RI_BASE_REG 0x04700000
773#define RI_MODE_REG (RI_BASE_REG + 0x00)
776#define RI_CONFIG_REG (RI_BASE_REG + 0x04)
779#define RI_CURRENT_LOAD_REG (RI_BASE_REG + 0x08)
782#define RI_SELECT_REG (RI_BASE_REG + 0x0C)
788#define RI_REFRESH_REG (RI_BASE_REG + 0x10)
789#define RI_COUNT_REG RI_REFRESH_REG
792#define RI_LATENCY_REG (RI_BASE_REG + 0x14)
795#define RI_RERROR_REG (RI_BASE_REG + 0x18)
798#define RI_WERROR_REG (RI_BASE_REG + 0x1C)
803#define SI_BASE_REG 0x04800000
806#define SI_DRAM_ADDR_REG (SI_BASE_REG + 0x00)
809#define SI_PIF_ADDR_RD64B_REG (SI_BASE_REG + 0x04)
814#define SI_PIF_ADDR_WR64B_REG (SI_BASE_REG + 0x10)
821#define SI_STATUS_REG (SI_BASE_REG + 0x18)
829#define SI_STATUS_DMA_BUSY 0x0001
830#define SI_STATUS_RD_BUSY 0x0002
831#define SI_STATUS_DMA_ERROR 0x0008
832#define SI_STATUS_INTERRUPT 0x1000
838#define GIO_BASE_REG 0x18000000
841#define GIO_GIO_INTR_REG (GIO_BASE_REG + 0x000)
844#define GIO_GIO_SYNC_REG (GIO_BASE_REG + 0x400)
847#define GIO_CART_INTR_REG (GIO_BASE_REG + 0x800)
852#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
853#define IO_READ(addr) (*(vu32*) PHYS_TO_K1(addr))
854#define IO_WRITE(addr, data) (*(vu32*) PHYS_TO_K1(addr) = (u32) (data))
855#define RCP_STAT_PRINT \
856 rmonPrintf("current=%x start=%x end=%x dpstat=%x spstat=%x\n", IO_READ(DPC_CURRENT_REG), IO_READ(DPC_START_REG), \
857 IO_READ(DPC_END_REG), IO_READ(DPC_STATUS_REG), IO_READ(SP_STATUS_REG))