uOFW
Reverse engineered PSP kernel 6.60.
Loading...
Searching...
No Matches
include
common
hardware.h
1
/* Copyright (C) 2011, 2012, 2013 The uOFW team
2
See the file COPYING for copying permission.
3
*/
4
5
#ifndef COMMON_INCLUDED
6
# error "Only include common_imp.h or common_header.h!"
7
#endif
8
9
#define HW(addr) (*(vs32 *)(addr))
10
#define HWPTR(addr) ((vs32 *)(addr))
11
12
#define RAM_TYPE_32_MB (1)
13
#define RAM_TYPE_64_MB (2)
14
15
#define HW_SYS_NMI_ENABLE_MASK 0xBC100000
16
17
#define HW_SYS_PLL_FREQ 0xBC100068
18
19
#define HW_SYS_IO_ENABLE 0xBC100078
20
#define HW_SYS_IO_ENABLE_AUDIOCLKOUT 0x800
21
22
#define HW_SYS_GPIO_ENABLE 0xBC10007C
23
24
// Pin used for Jigkick
25
#define HW_SYS_GPIO_ENABLE_PIN4 0x10
26
27
#define HW_RAM_SIZE 0xBC100040
28
29
#define HW_TIMER_0 0xBC500000
30
#define HW_TIMER_1 0xBC500010
31
#define HW_TIMER_2 0xBC500020
32
#define HW_TIMER_3 0xBC500030
33
34
#define HW_NAND_CONTROL 0xBD101000
35
#define HW_NAND_STATUS 0xBD101004
36
#define HW_NAND_COMMAND 0xBD101008
37
#define HW_NAND_COMMAND_RESET 0xFF
38
#define HW_NAND_ADDRESS 0xBD10100C
39
#define HW_NAND_RESET 0xBD101014
40
#define HW_NAND_DMA_ADDRESS 0xBD101020
41
#define HW_NAND_DMA_CONTROL 0xBD101024
42
#define HW_NAND_DMA_STATUS 0xBD101028
43
44
#define HW_NAND_DMA_BUFFER 0xBFF00000
45
#define HW_NAND_DMA_ECC 0xBFF00800
46
#define HW_NAND_DMA_SPARE0 0xBFF00900
47
#define HW_NAND_DMA_SPARE1 0xBFF00904
48
#define HW_NAND_DMA_SPARE2 0xBFF00908
49
50
#define HW_MEMORYSTICK_START_TPC 0xBD200030
51
#define HW_MEMORYSTICK_TPC 0xBD200034
52
#define HW_MEMORYSTICK_STATUS 0xBD200038
53
#define HW_MEMORYSTICK_STATUS_TIMEOUT 0x100
54
#define HW_MEMORYSTICK_STATUS_CRC_ERROR 0x200
55
#define HW_MEMORYSTICK_STATUS_READY 0x1000
56
#define HW_MEMORYSTICK_STATUS_UNK13 0x2000
57
#define HW_MEMORYSTICK_STATUS_FIFO_RW 0x4000
58
#define HW_MEMORYSTICK_SYS 0xBD20003C
59
#define HW_MEMORYSTICK_SYS_RESET 0x8000
60
61
#define HW_KIRK_SIGNATURE 0xBDE00000
62
#define HW_KIRK_VERSION 0xBDE00004
63
#define HW_KIRK_ERROR 0xBDE00008
64
#define HW_KIRK_START 0xBDE0000C
65
#define HW_KIRK_START_PHASE1 1
66
#define HW_KIRK_START_PHASE2 2
67
#define HW_KIRK_COMMAND 0xBDE00010
68
#define HW_KIRK_COMMAND_PRIV_DEC 0x01
69
#define HW_KIRK_COMMAND_ENC_2 0x02
70
#define HW_KIRK_COMMAND_DEC_2 0x03
71
#define HW_KIRK_COMMAND_ENC_3_IV_ZERO 0x04
72
#define HW_KIRK_COMMAND_ENC_3_IV_FUSEID 0x05
73
#define HW_KIRK_COMMAND_ENC_3_IV_USER 0x06
74
#define HW_KIRK_COMMAND_DEC_3_IV_ZERO 0x07
75
#define HW_KIRK_COMMAND_DEC_3_IV_FUSEID 0x08
76
#define HW_KIRK_COMMAND_DEC_3_IV_USER 0x09
77
#define HW_KIRK_COMMAND_PRIV_SIGNCHECK 0x0A
78
#define HW_KIRK_COMMAND_SHA1 0x0B
79
#define HW_KIRK_COMMAND_ECDSA_KEYGEN 0x0C
80
#define HW_KIRK_COMMAND_ECDSA_MULT 0x0D
81
#define HW_KIRK_COMMAND_PRNG 0x0E
82
#define HW_KIRK_COMMAND_PRNG_SEED 0x0F
83
#define HW_KIRK_COMMAND_ECDSA_SIGN 0x10
84
#define HW_KIRK_COMMAND_ECDSA_SIGNCHECK 0x11
85
86
#define HW_KIRK_COMMAND_RESULT 0xBDE00014
87
#define HW_KIRK_STATUS 0xBDE0001C
88
#define HW_KIRK_STATUS_PHASE1_FINISH 0x01
89
#define HW_KIRK_STATUS_PHASE2_FINISH 0x02
90
#define HW_KIRK_STATUS_NEEDPHASE2 0x10
91
92
93
#define HW_KIRK_COMMAND_END 0xBDE00028
94
#define HW_KIRK_SRC_BUF 0xBDE0002C
95
#define HW_KIRK_DST_BUF 0xBDE00030
96
97
#define HW_GPIO_READ 0xBE240004
98
#define HW_GPIO_READ_PIN4 0x00000010
99
100
#define HW_RESET_VECTOR 0xBFC00000
101
#define HW_RESET_VECTOR_SIZE (0x1000)
102
103
/*
104
* GE hardware registers
105
*/
106
107
/*
108
* Main GE stuff
109
*/
110
// RW bit 1: set to 1 to reset, wait until bit is 0 to know the GE has been reset
111
#define HW_GE_RESET HW(0xBD400000)
112
// Unknown (possibly read-only?); accessible through sceGeSet/GetReg() (SCE_GE_REG_UNK004),
113
// saved on suspend and passed in the interrupt handling functions but never used
114
#define HW_GE_UNK004 HW(0xBD400004)
115
// RO bits 0x0000FFFF: shifted left by 10, gives the EDRAM hardware size
116
// (sceGeEdramGetHwSize()) (only used for tachyon < 0x00500000)
117
#define HW_GE_EDRAM_HW_SIZE HW(0xBD400008)
118
119
/*
120
* GE execution/display list handling
121
*/
122
// RW bit 0x001: 0 = stopped, 1 = running
123
// R bit 0x002: 0 = branching condition true, 1 = false
124
// R bit 0x100: 1 = is at depth 1 (or 2) of calls
125
// R bit 0x200: 1 = is at depth 2 of calls
126
#define HW_GE_EXEC HW(0xBD400100)
127
#define HW_GE_EXEC_RUNNING 0x001
128
#define HW_GE_EXEC_BRANCHING 0x002
129
#define HW_GE_EXEC_DEPTH1 0x100
130
#define HW_GE_EXEC_DEPTH2 0x200
131
// Never used, accessible through sceGeSet/GetReg() (SCE_GE_REG_UNK104)
132
#define HW_GE_UNK104 HW(0xBD400104)
133
// RW: address of the display list currently being run (not sure if it's the current point of
134
// execution or the starting address)
135
#define HW_GE_LISTADDR HW(0xBD400108)
136
// RW: stall address of the display list (0 = no stall address)
137
#define HW_GE_STALLADDR HW(0xBD40010C)
138
// RW: first return address (after the first CALL command)
139
#define HW_GE_RADR1 HW(0xBD400110)
140
// RW: second return address (after the second CALL command)
141
#define HW_GE_RADR2 HW(0xBD400114)
142
// RW: address of vertices (for bezier etc)
143
#define HW_GE_VADR HW(0xBD400118)
144
// RW: address of indices (for bezier etc)
145
#define HW_GE_IADR HW(0xBD40011C)
146
// RW: address of the origin (set by ORIGIN, destination address for JUMP/BJUMP/CALL after adding BASE and the address specified in the command)
147
#define HW_GE_OADR HW(0xBD400120)
148
// RW: same, for the first call
149
#define HW_GE_OADR1 HW(0xBD400124)
150
// RW: same, for the second call
151
#define HW_GE_OADR2 HW(0xBD400128)
152
153
/*
154
* GE geometry clock
155
*/
156
// RW, bit 1 set by sceGeSetGeometryClock(), exact usage unknown
157
#define HW_GE_GEOMETRY_CLOCK HW(0xBD400200)
158
159
// Never used, accessible through sceGeSet/GetReg() (SCE_GE_REG_UNK300)
160
#define HW_GE_UNK300 HW(0xBD400300)
161
162
// RO memory for the commands
163
// Each type a command is executed by the GE, its value, including arguments,
164
// is saved there.
165
#define HW_GE_CMD(i) HW(0xBD400800 + i * 4)
166
// RO registers for the different matrices
167
#define HW_GE_BONES ((vs32*)HWPTR(0xBD400C00))
168
#define HW_GE_BONE(i) ((vs32*)HWPTR(0xBD400C00 + i * 48))
169
#define HW_GE_WORLDS ((vs32*)HWPTR(0xBD400D80))
170
#define HW_GE_VIEWS ((vs32*)HWPTR(0xBD400DB0))
171
#define HW_GE_PROJS ((vs32*)HWPTR(0xBD400DE0))
172
#define HW_GE_TGENS ((vs32*)HWPTR(0xBD400E20))
173
174
175
// Interrupt statuses
176
// Triggered by the SIGNAL command
177
#define HW_GE_INTSIG 1
178
// Triggered by the END command
179
#define HW_GE_INTEND 2
180
// Triggered by the FINISH command
181
#define HW_GE_INTFIN 4
182
// Triggered by an error (?)
183
#define HW_GE_INTERR 8
184
// RO: current interrupt status?
185
#define HW_GE_INTERRUPT_TYPE1 HW(0xBD400304)
186
// RW: currently accepted interrupts?
187
// Set to HW_GE_INTSIG | HW_GE_INTEND | HW_GE_INTFIN on init & reset
188
#define HW_GE_INTERRUPT_TYPE2 HW(0xBD400308)
189
// WO: set to HW_GE_INTERRUPT_TYPE2 on init & reset
190
#define HW_GE_INTERRUPT_TYPE3 HW(0xBD40030C)
191
// WO: set current interrupt status? set to HW_GE_INTERRUPT_TYPE1 on init & reset
192
#define HW_GE_INTERRUPT_TYPE4 HW(0xBD400310)
193
194
// RW: set to 4 when the used edram size is 0x00200000 and 2 when it's 0x00400000 (!)
195
#define HW_GE_EDRAM_ENABLED_SIZE HW(0xBD400400)
196
// RW: unknown, bits 0x00F00000 set by sceGeEdramSetRefreshParam's 4th argument
197
#define HW_GE_EDRAM_REFRESH_UNK1 HW(0xBD500000)
198
// RW: set to 2 before reset and 0 after reset is done, bit 1 seems to be initialization
199
// (used by sceGeEdramInit())
200
#define HW_GE_EDRAM_UNK10 HW(0xBD500010)
201
// RW, set to 0x6C4 by default and bits 0x007FFFFF set by sceGeEdramSetRefreshParam's second argument
202
#define HW_GE_EDRAM_REFRESH_UNK2 HW(0xBD500020)
203
// RW, bits 0x000003FF set by sceGeEdramSetRefreshParam's third argument
204
#define HW_GE_EDRAM_REFRESH_UNK3 HW(0xBD500030)
205
// RW, set to 1 in sceGeEdramInit(), and to 3 if sceGeEdramSetRefreshParam's first argument (mode) is 1
206
// and the bit 2 isn't set
207
#define HW_GE_EDRAM_UNK40 HW(0xBD500040)
208
// Unknown, accessible through sceGeSetReg/GetReg() (SCE_GE_REG_EDRAM_UNK50)
209
#define HW_GE_EDRAM_UNK50 HW(0xBD500050)
210
// Unknown, accessible through sceGeSetReg/GetReg() (SCE_GE_REG_EDRAM_UNK60)
211
#define HW_GE_EDRAM_UNK60 HW(0xBD500060)
212
// RW bit 1: disable address translation
213
#define HW_GE_EDRAM_ADDR_TRANS_DISABLE HW(0xBD500070)
214
// RW: the address translation value
215
#define HW_GE_EDRAM_ADDR_TRANS_VALUE HW(0xBD500080)
216
// Unknown, set to 3 in sceGeEdramInit(), accessible through sceGeSetReg/GetReg() (SCE_GE_REG_EDRAM_UNK90)
217
#define HW_GE_EDRAM_UNK90 HW(0xBD500090)
218
// Unknown, accessible through sceGeSetReg/GetReg() (SCE_GE_REG_EDRAM_UNKA0)
219
#define HW_GE_EDRAM_UNKA0 HW(0xBD5000A0)
Generated on Sat May 10 2025 16:45:52 for uOFW by
1.9.8