/[gxemul]/trunk/src/include/maltareg.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/src/include/maltareg.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12 - (show annotations)
Mon Oct 8 16:18:38 2007 UTC (16 years, 6 months ago) by dpavlin
File MIME type: text/plain
File size: 8982 byte(s)
++ trunk/HISTORY	(local)
$Id: HISTORY,v 1.905 2005/08/16 09:16:24 debug Exp $
20050628	Continuing the work on the ARM translation engine. end_of_page
		works. Experimenting with load/store translation caches
		(virtual -> physical -> host).
20050629	More ARM stuff (memory access translation cache, mostly). This
		might break a lot of stuff elsewhere, probably some MIPS-
		related translation things.
20050630	Many load/stores are now automatically generated and included
		into cpu_arm_instr.c; 1024 functions in total (!).
		Fixes based on feedback from Alec Voropay: only print 8 hex
		digits instead of 16 in some cases when emulating 32-bit
		machines; similar 8 vs 16 digit fix for breakpoint addresses;
		4Kc has 16 TLB entries, not 48; the MIPS config select1
		register is now printed with "reg ,0".
		Also changing many other occurances of 16 vs 8 digit output.
		Adding cache associativity fields to mips_cpu_types.h; updating
		some other cache fields; making the output of
		mips_cpu_dumpinfo() look nicer.
		Generalizing the bintrans stuff for device accesses to also
		work with the new translation system. (This might also break
		some MIPS things.)
		Adding multi-load/store instructions to the ARM disassembler
		and the translator, and some optimizations of various kinds.
20050701	Adding a simple dev_disk (it can read/write sectors from
		disk images).
20050712	Adding dev_ether (a simple ethernet send/receive device).
		Debugger command "ninstrs" for toggling show_nr_of_instructions
		during runtime.
		Removing the framebuffer logo.
20050713	Continuing on dev_ether.
		Adding a dummy cpu_alpha (again).
20050714	More work on cpu_alpha.
20050715	More work on cpu_alpha. Many instructions work, enough to run
		a simple framebuffer fill test (similar to the ARM test).
20050716	More Alpha stuff.
20050717	Minor updates (Alpha stuff).
20050718	Minor updates (Alpha stuff).
20050719	Generalizing some Alpha instructions.
20050720	More Alpha-related updates.
20050721	Continuing on cpu_alpha. Importing rpb.h from NetBSD/alpha.
20050722	Alpha-related updates: userland stuff (Hello World using
		write() compiled statically for FreeBSD/Alpha runs fine), and
		more instructions are now implemented.
20050723	Fixing ldq_u and stq_u.
		Adding more instructions (conditional moves, masks, extracts,
		shifts).
20050724	More FreeBSD/Alpha userland stuff, and adding some more
		instructions (inserts).
20050725	Continuing on the Alpha stuff. (Adding dummy ldt/stt.)
		Adding a -A command line option to turn off alignment checks
		in some cases (for translated code).
		Trying to remove the old bintrans code which updated the pc
		and nr_of_executed_instructions for every instruction.
20050726	Making another attempt att removing the pc/nr of instructions
		code. This time it worked, huge performance increase for
		artificial test code, but performance loss for real-world
		code :-( so I'm scrapping that code for now.
		Tiny performance increase on Alpha (by using ret instead of
		jmp, to play nice with the Alpha's branch prediction) for the
		old MIPS bintrans backend.
20050727	Various minor fixes and cleanups.
20050728	Switching from a 2-level virtual to host/physical translation
		system for ARM emulation, to a 1-level translation.
		Trying to switch from 2-level to 1-level for the MIPS bintrans
		system as well (Alpha only, so far), but there is at least one
		problem: caches and/or how they work with device mappings.
20050730	Doing the 2-level to 1-level conversion for the i386 backend.
		The cache/device bug is still there for R2K/3K :(
		Various other minor updates (Malta etc).
		The mc146818 clock now updates the UIP bit in a way which works
		better with Linux for at least sgimips and Malta emulation.
		Beginning the work on refactoring the dyntrans system.
20050731	Continuing the dyntrans refactoring.
		Fixing a small but serious host alignment bug in memory_rw.
		Adding support for big-endian load/stores to the i386 bintrans
		backend.
		Another minor i386 bintrans backend update: stores from the
		zero register are now one (or two) loads shorter.
		The slt and sltu instructions were incorrectly implemented for
		the i386 backend; only using them for 32-bit mode for now.
20050801	Continuing the dyntrans refactoring.
		Cleanup of the ns16550 serial controller (removing unnecessary
		code).
		Bugfix (memory corruption bug) in dev_gt, and a patch/hack from
		Alec Voropay for Linux/Malta.
20050802	More cleanup/refactoring of the dyntrans subsystem: adding
		phys_page pointers to the lookup tables, for quick jumps
		between translated pages.
		Better fix for the ns16550 device (but still no real FIFO
		functionality).
		Converting cpu_ppc to the new dyntrans system. This means that
		I will have to start from scratch with implementing each
		instruction, and figure out how to implement dual 64/32-bit
		modes etc.
		Removing the URISC CPU family, because it was useless.
20050803	When selecting a machine type, the main type can now be omitted
		if the subtype name is unique. (I.e. -E can be omitted.)
		Fixing a dyntrans/device update bug. (Writes to offset 0 of
		a device could sometimes go unnoticed.)
		Adding an experimental "instruction combination" hack for
		ARM for memset-like byte fill loops.
20050804	Minor progress on cpu_alpha and related things.
		Finally fixing the MIPS dmult/dmultu bugs.
		Fixing some minor TODOs.
20050805	Generalizing the 8259 PIC. It now also works with Cobalt
		and evbmips emulation, in addition to the x86 hack.
		Finally converting the ns16550 device to use devinit.
		Continuing the work on the dyntrans system. Thinking about
		how to add breakpoints.
20050806	More dyntrans updates. Breakpoints seem to work now.
20050807	Minor updates: cpu_alpha and related things; removing
		dev_malta (as it isn't used any more).
		Dyntrans: working on general "show trace tree" support.
		The trace tree stuff now works with both the old MIPS code and
		with newer dyntrans modes. :)
		Continuing on Alpha-related stuff (trying to get *BSD to boot
		a bit further, adding more instructions, etc).
20050808	Adding a dummy IA64 cpu family, and continuing the refactoring
		of the dyntrans system.
		Removing the regression test stuff, because it was more or
		less useless.
		Adding loadlinked/storeconditional type instructions to the
		Alpha emulation. (Needed for Linux/alpha. Not very well tested
		yet.)
20050809	The function call trace tree now prints a per-function nr of
		arguments. (Semi-meaningless, since that data isn't read yet
		from the ELFs; some hardcoded symbols such as memcpy() and
		strlen() work fine, though.)
		More dyntrans refactoring; taking out more of the things that
		are common to all cpu families.
20050810	Working on adding support for "dual mode" for PPC dyntrans
		(i.e. both 64-bit and 32-bit modes).
		(Re)adding some simple PPC instructions.
20050811	Adding a dummy M68K cpu family. The dyntrans system isn't ready
		for variable-length ISAs yet, so it's completely bogus so far.
		Re-adding more PPC instructions.
		Adding a hack to src/file.c which allows OpenBSD/mac68k a.out
		kernels to be loaded.
		Beginning to add PPC loads/stores. So far they only work in
		32-bit mode.
20050812	The configure file option "add_remote" now accepts symbolic
		host names, in addition to numeric IPv4 addresses.
		Re-adding more PPC instructions.
20050814	Continuing to port back more PPC instructions.
		Found and fixed the cache/device write-update bug for 32-bit
		MIPS bintrans. :-)
		Triggered a really weird and annoying bug in Compaq's C
		compiler; ccc sometimes outputs code which loads from an
		address _before_ checking whether the pointer was NULL or not.
		(I'm not sure how to handle this problem.)
20050815	Removing all of the old x86 instruction execution code; adding
		a new (dummy) dyntrans module for x86.
		Taking the first steps to extend the dyntrans system to support
		variable-length instructions.
		Slowly preparing for the next release.
20050816	Adding a dummy SPARC cpu module.
		Minor updates (documentation etc) for the release.

==============  RELEASE 0.3.5  ==============


1 /* gxemul: $Id: maltareg.h,v 1.1 2005/07/30 18:11:21 debug Exp $ */
2 /* $NetBSD: maltareg.h,v 1.1 2002/03/07 14:44:04 simonb Exp $ */
3
4 #ifndef MALTAREG_H
5 #define MALTAREG_H
6
7 /*
8 * Copyright 2002 Wasabi Systems, Inc.
9 * All rights reserved.
10 *
11 * Written by Simon Burge for Wasabi Systems, Inc.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. All advertising materials mentioning features or use of this software
22 * must display the following acknowledgement:
23 * This product includes software developed for the NetBSD Project by
24 * Wasabi Systems, Inc.
25 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
26 * or promote products derived from this software without specific prior
27 * written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
31 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
32 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
33 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
34 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
37 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 * POSSIBILITY OF SUCH DAMAGE.
40 */
41
42 /*
43 Memory Map
44
45 0000.0000 * 128MB Typically SDRAM (on Core Board)
46 0800.0000 * 256MB Typically PCI
47 1800.0000 * 62MB Typically PCI
48 1be0.0000 * 2MB Typically System controller's internal registers
49 1c00.0000 * 32MB Typically not used
50 1e00.0000 4MB Monitor Flash
51 1e40.0000 12MB reserved
52 1f00.0000 12MB Switches
53 LEDs
54 ASCII display
55 Soft reset
56 FPGA revision number
57 CBUS UART (tty2)
58 General Purpose I/O
59 I2C controller
60 1f10.0000 * 11MB Typically System Controller specific
61 1fc0.0000 4MB Maps to Monitor Flash
62 1fd0.0000 * 3MB Typically System Controller specific
63
64 * depends on implementation of the Core Board and of software
65 */
66
67 /*
68 CPU interrupts
69
70 NMI South Bridge or NMI button
71 0 South Bridge INTR
72 1 South Bridge SMI
73 2 CBUS UART (tty2)
74 3 COREHI (Core Card)
75 4 CORELO (Core Card)
76 5 Not used, driven inactive (typically CPU internal timer interrupt
77
78 IRQ mapping (as used by YAMON)
79
80 0 Timer South Bridge
81 1 Keyboard SuperIO
82 2 Reserved by South Bridge (for cascading)
83 3 UART (tty1) SuperIO
84 4 UART (tty0) SuperIO
85 5 Not used
86 6 Floppy Disk SuperIO
87 7 Parallel Port SuperIO
88 8 Real Time Clock South Bridge
89 9 I2C bus South Bridge
90 10 PCI A,B,eth PCI slot 1..4, Ethernet
91 11 PCI C,audio PCI slot 1..4, Audio, USB (South Bridge)
92 PCI D,USB
93 12 Mouse SuperIO
94 13 Reserved by South Bridge
95 14 Primary IDE Primary IDE slot
96 15 Secondary IDE Secondary IDE slot/Compact flash connector
97 */
98
99 #define MALTA_SYSTEMRAM_BASE 0x00000000 /* System RAM: */
100 #define MALTA_SYSTEMRAM_SIZE 0x08000000 /* 128 MByte */
101
102 #define MALTA_PCIMEM1_BASE 0x08000000 /* PCI 1 memory: */
103 #define MALTA_PCIMEM1_SIZE 0x08000000 /* 128 MByte */
104
105 #define MALTA_PCIMEM2_BASE 0x10000000 /* PCI 2 memory: */
106 #define MALTA_PCIMEM2_SIZE 0x08000000 /* 128 MByte */
107
108 #define MALTA_PCIMEM3_BASE 0x18000000 /* PCI 3 memory */
109 #define MALTA_PCIMEM3_SIZE 0x03e00000 /* 62 MByte */
110
111 #define MALTA_CORECTRL_BASE 0x1be00000 /* Core control: */
112 #define MALTA_CORECTRL_SIZE 0x00200000 /* 2 MByte */
113
114 #define MALTA_RESERVED_BASE1 0x1c000000 /* Reserved: */
115 #define MALTA_RESERVED_SIZE1 0x02000000 /* 32 MByte */
116
117 #define MALTA_MONITORFLASH_BASE 0x1e000000 /* Monitor Flash: */
118 #define MALTA_MONITORFLASH_SIZE 0x003e0000 /* 4 MByte */
119 #define MALTA_MONITORFLASH_SECTORSIZE 0x00010000 /* Sect. = 64 KB */
120
121 #define MALTA_FILEFLASH_BASE 0x1e3e0000 /* File Flash (for monitor): */
122 #define MALTA_FILEFLASH_SIZE 0x00020000 /* 128 KByte */
123
124 #define MALTA_FILEFLASH_SECTORSIZE 0x00010000 /* Sect. = 64 KB */
125
126 #define MALTA_RESERVED_BASE2 0x1e400000 /* Reserved: */
127 #define MALTA_RESERVED_SIZE2 0x00c00000 /* 12 MByte */
128
129 #define MALTA_FPGA_BASE 0x1f000000 /* FPGA: */
130 #define MALTA_FPGA_SIZE 0x00c00000 /* 12 MByte */
131
132 #define MALTA_NMISTATUS (MALTA_FPGA_BASE + 0x24)
133 #define MALTA_NMI_SB 0x2 /* Pending NMI from the South Bridge */
134 #define MALTA_NMI_ONNMI 0x1 /* Pending NMI from the ON/NMI push button */
135
136 #define MALTA_NMIACK (MALTA_FPGA_BASE + 0x104)
137 #define MALTA_NMIACK_ONNMI 0x1 /* Write 1 to acknowledge ON/NMI */
138
139 #define MALTA_SWITCH (MALTA_FPGA_BASE + 0x200)
140 #define MALTA_SWITCH_MASK 0xff /* settings of DIP switch S2 */
141
142 #define MALTA_STATUS (MALTA_FPGA_BASE + 0x208)
143 #define MALTA_ST_MFWR 0x10 /* Monitor Flash is write protected (JP1) */
144 #define MALTA_S54 0x08 /* switch S5-4 - set YAMON factory default mode */
145 #define MALTA_S53 0x04 /* switch S5-3 */
146 #define MALTA_BIGEND 0x02 /* switch S5-2 - big endian mode */
147
148 #define MALTA_JMPRS (MALTA_FPGA_BASE + 0x210)
149 #define MALTA_JMPRS_PCICLK 0x1c /* PCI clock frequency */
150 #define MALTA_JMPRS_EELOCK 0x02 /* I2C EEPROM is write protected */
151
152 #define MALTA_LEDBAR (MALTA_FPGA_BASE + 0x408)
153 #define MALTA_ASCIIWORD (MALTA_FPGA_BASE + 0x410)
154 #define MALTA_ASCII_BASE (MALTA_FPGA_BASE + 0x418)
155 #define MALTA_ASCIIPOS0 0x00
156 #define MALTA_ASCIIPOS1 0x08
157 #define MALTA_ASCIIPOS2 0x10
158 #define MALTA_ASCIIPOS3 0x18
159 #define MALTA_ASCIIPOS4 0x20
160 #define MALTA_ASCIIPOS5 0x28
161 #define MALTA_ASCIIPOS6 0x30
162 #define MALTA_ASCIIPOS7 0x38
163
164 #define MALTA_SOFTRES (MALTA_FPGA_BASE + 0x500)
165 #define MALTA_GORESET 0x42 /* write this to MALTA_SOFTRES for board reset */
166
167 /*
168 * BRKRES is the number of milliseconds before a "break" on tty will
169 * trigger a reset. A value of 0 will disable the reset.
170 */
171 #define MALTA_BRKRES (MALTA_FPGA_BASE + 0x508)
172 #define MALTA_BRKRES_MASK 0xff
173
174 #define MALTA_CBUSUART (MALTA_FPGA_BASE + 0x900)
175 /* 16C550C UART, 8 bit registers on 8 byte boundaries */
176 /* RXTX 0x00 */
177 /* INTEN 0x08 */
178 /* IIFIFO 0x10 */
179 /* LCTRL 0x18 */
180 /* MCTRL 0x20 */
181 /* LSTAT 0x28 */
182 /* MSTAT 0x30 */
183 /* SCRATCH 0x38 */
184 #define MALTA_CBUSUART_INTR 2
185
186 #define MALTA_GPIO_BASE (MALTA_FPGA_BASE + 0xa00)
187 #define MALTA_GPOUT 0x0
188 #define MALTA_GPINP 0x8
189
190 #define MALTA_I2C_BASE (MALTA_FPGA_BASE + 0xb00)
191 #define MALTA_I2CINP 0x00
192 #define MALTA_I2COE 0x08
193 #define MALTA_I2COUT 0x10
194 #define MALTA_I2CSEL 0x18
195
196 #define MALTA_BOOTROM_BASE 0x1fc00000 /* Boot ROM: */
197 #define MALTA_BOOTROM_SIZE 0x00400000 /* 4 MByte */
198
199 #define MALTA_REVISION 0x1fc00010
200 #define MALTA_REV_FPGRV 0xff0000 /* CBUS FPGA revision */
201 #define MALTA_REV_CORID 0x00fc00 /* Core Board ID */
202 #define MALTA_REV_CORRV 0x000300 /* Core Board Revision */
203 #define MALTA_REV_PROID 0x0000f0 /* Product ID */
204 #define MALTA_REV_PRORV 0x00000f /* Product Revision */
205
206 /* PCI definitions */
207 #define MALTA_SOUTHBRIDGE_INTR 0
208
209 #define MALTA_PCI0_IO_BASE MALTA_PCIMEM3_BASE
210 #define MALTA_PCI0_ADDR( addr ) (MALTA_PCI0_IO_BASE + (addr))
211
212 #define MALTA_RTCADR 0x70 // MALTA_PCI_IO_ADDR8(0x70)
213 #define MALTA_RTCDAT 0x71 // MALTA_PCI_IO_ADDR8(0x71)
214
215 #define MALTA_SMSC_COM1_ADR 0x3f8
216 #define MALTA_SMSC_COM2_ADR 0x2f8
217 #define MALTA_UART0ADR MALTA_SMSC_COM1_ADR // MALTA_PCI0_ADDR(MALTA_SMSC_COM1_ADR)
218 #define MALTA_UART1ADR MALTA_SMSC_COM2_ADR // MALTA_PCI0_ADDR(MALTA_SMSC_COM2_ADR)
219
220 #define MALTA_SMSC_1284_ADR 0x378
221 #define MALTA_1284ADR MALTA_SMSC_1284_ADR // MALTA_PCI0_ADDR(MALTA_SMSC_1284_ADR)
222
223 #define MALTA_SMSC_FDD_ADR 0x3f0
224 #define MALTA_FDDADR MALTA_SMSC_FDD_ADR // MALTA_PCI0_ADDR(MALTA_SMSC_FDD_ADR)
225
226 #define MALTA_SMSC_KYBD_ADR 0x60 /* Fixed 0x60, 0x64 */
227 #define MALTA_KYBDADR MALTA_SMSC_KYBD_ADR // MALTA_PCI0_ADDR(MALTA_SMSC_KYBD_ADR)
228 #define MALTA_SMSC_MOUSE_ADR MALTA_SMSC_KYBD_ADR
229 #define MALTA_MOUSEADR MALTA_KYBDADR
230
231
232 #define MALTA_DMA_PCI_PCIBASE 0x00000000UL
233 #define MALTA_DMA_PCI_PHYSBASE 0x00000000UL
234 #define MALTA_DMA_PCI_SIZE (256 * 1024 * 1024)
235
236 #define MALTA_DMA_ISA_PCIBASE 0x00800000UL
237 #define MALTA_DMA_ISA_PHYSBASE 0x00000000UL
238 #define MALTA_DMA_ISA_SIZE (8 * 1024 * 1024)
239
240 #ifndef _LOCORE
241 void led_bar(uint8_t);
242 void led_display_word(uint32_t);
243 void led_display_str(const char *);
244 void led_display_char(int, uint8_t);
245 #endif
246
247 #endif /* MALTAREG_H */

  ViewVC Help
Powered by ViewVC 1.1.26