2 * Milkymist VJ SoC (Software)
3 * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include <hw/common.h>
23 #define CSR_PFPU_CTL MMPTR(0x80005000)
24 #define PFPU_CTL_START 0x01
25 #define PFPU_CTL_BUSY 0x01
27 #define CSR_PFPU_MESHBASE MMPTR(0x80005004)
28 #define CSR_PFPU_HMESHLAST MMPTR(0x80005008)
29 #define CSR_PFPU_VMESHLAST MMPTR(0x8000500C)
31 #define CSR_PFPU_CODEPAGE MMPTR(0x80005010)
33 #define CSR_PFPU_VERTICES MMPTR(0x80005014)
34 #define CSR_PFPU_COLLISIONS MMPTR(0x80005018)
35 #define CSR_PFPU_STRAYWRITES MMPTR(0x8000501C)
36 #define CSR_PFPU_LASTDMA MMPTR(0x80005020)
37 #define CSR_PFPU_PC MMPTR(0x80005024)
39 #define CSR_PFPU_DREGBASE (0x80005400)
40 #define CSR_PFPU_CODEBASE (0x80005800)
42 #define PFPU_OPCODE_NOP (0x0)
43 #define PFPU_OPCODE_FADD (0x1)
44 #define PFPU_OPCODE_FSUB (0x2)
45 #define PFPU_OPCODE_FMUL (0x3)
46 #define PFPU_OPCODE_FABS (0x4)
47 #define PFPU_OPCODE_F2I (0x5)
48 #define PFPU_OPCODE_I2F (0x6)
49 #define PFPU_OPCODE_VECTOUT (0x7)
50 #define PFPU_OPCODE_SIN (0x8)
51 #define PFPU_OPCODE_COS (0x9)
52 #define PFPU_OPCODE_ABOVE (0xa)
53 #define PFPU_OPCODE_EQUAL (0xb)
54 #define PFPU_OPCODE_COPY (0xc)
55 #define PFPU_OPCODE_IF (0xd)
56 #define PFPU_OPCODE_TSIGN (0xe)
57 #define PFPU_OPCODE_QUAKE (0xf)
59 #define PFPU_LATENCY_FADD (4)
60 #define PFPU_LATENCY_FSUB (4)
61 #define PFPU_LATENCY_FMUL (7)
62 #define PFPU_LATENCY_FABS (2)
63 #define PFPU_LATENCY_F2I (2)
64 #define PFPU_LATENCY_I2F (3)
65 #define PFPU_LATENCY_VECTOUT (0)
66 #define PFPU_LATENCY_SIN (4)
67 #define PFPU_LATENCY_COS (4)
68 #define PFPU_LATENCY_ABOVE (2)
69 #define PFPU_LATENCY_EQUAL (2)
70 #define PFPU_LATENCY_COPY (2)
71 #define PFPU_LATENCY_IF (2)
72 #define PFPU_LATENCY_TSIGN (2)
73 #define PFPU_LATENCY_QUAKE (2)
75 #define PFPU_PROGSIZE (2048)
76 #define PFPU_PAGESIZE (512)
78 #define PFPU_REG_COUNT (128)
79 #define PFPU_SPREG_COUNT (2)
80 #define PFPU_REG_X (0)
81 #define PFPU_REG_Y (1)
83 #define PFPU_REG_IFB (2)
85 #define PFPU_TRIG_CONV (8192.0/(2.0*3.14159265358))
94 } i __attribute__((packed));
98 #endif /* __HW_PFPU_H */