xref: /OK3568_Linux_fs/kernel/arch/m68k/ifpsp060/isp.doc (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2*4882a593SmuzhiyunMOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
3*4882a593SmuzhiyunM68000 Hi-Performance Microprocessor Division
4*4882a593SmuzhiyunM68060 Software Package
5*4882a593SmuzhiyunProduction Release P1.00 -- October 10, 1994
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunM68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunTHE SOFTWARE is provided on an "AS IS" basis and without warranty.
10*4882a593SmuzhiyunTo the maximum extent permitted by applicable law,
11*4882a593SmuzhiyunMOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
12*4882a593SmuzhiyunINCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
13*4882a593Smuzhiyunand any warranty against infringement with regard to the SOFTWARE
14*4882a593Smuzhiyun(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunTo the maximum extent permitted by applicable law,
17*4882a593SmuzhiyunIN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
18*4882a593Smuzhiyun(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
19*4882a593SmuzhiyunBUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)
20*4882a593SmuzhiyunARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
21*4882a593SmuzhiyunMotorola assumes no responsibility for the maintenance and support of the SOFTWARE.
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunYou are hereby granted a copyright license to use, modify, and distribute the SOFTWARE
24*4882a593Smuzhiyunso long as this entire notice is retained without alteration in any modified and/or
25*4882a593Smuzhiyunredistributed versions, and that such modified versions are clearly identified as such.
26*4882a593SmuzhiyunNo licenses are granted by implication, estoppel or otherwise under any patents
27*4882a593Smuzhiyunor trademarks of Motorola, Inc.
28*4882a593Smuzhiyun~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29*4882a593Smuzhiyun68060 INTEGER SOFTWARE PACKAGE (Kernel version)
30*4882a593Smuzhiyun------------------------------------------------
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunThe file isp.sa contains the 68060 Integer Software Package.
33*4882a593SmuzhiyunThis package is essentially an exception handler that can be
34*4882a593Smuzhiyunintegrated into an operating system to handle the "Unimplemented
35*4882a593SmuzhiyunInteger Instruction" exception vector #61.
36*4882a593SmuzhiyunThis exception is taken when any of the integer instructions
37*4882a593Smuzhiyunnot hardware implemented on the 68060 are encountered. The
38*4882a593Smuzhiyunisp.sa provides full emulation support for these instructions.
39*4882a593Smuzhiyun
40*4882a593SmuzhiyunThe unimplemented integer instructions are:
41*4882a593Smuzhiyun	64-bit divide
42*4882a593Smuzhiyun	64-bit multiply
43*4882a593Smuzhiyun	movep
44*4882a593Smuzhiyun	cmp2
45*4882a593Smuzhiyun	chk2
46*4882a593Smuzhiyun	cas (w/ a misaligned effective address)
47*4882a593Smuzhiyun	cas2
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunRelease file format:
50*4882a593Smuzhiyun--------------------
51*4882a593SmuzhiyunThe file isp.sa is essentially a hexadecimal image of the
52*4882a593Smuzhiyunrelease package. This is the ONLY format which will be supported.
53*4882a593SmuzhiyunThe hex image was created by assembling the source code and
54*4882a593Smuzhiyunthen converting the resulting binary output image into an
55*4882a593SmuzhiyunASCII text file. The hexadecimal numbers are listed
56*4882a593Smuzhiyunusing the Motorola Assembly Syntax assembler directive "dc.l"
57*4882a593Smuzhiyun(define constant longword). The file can be converted to other
58*4882a593Smuzhiyunassembly syntaxes by using any word processor with a global
59*4882a593Smuzhiyunsearch and replace function.
60*4882a593Smuzhiyun
61*4882a593SmuzhiyunTo assist in assembling and linking this module with other modules,
62*4882a593Smuzhiyunthe installer should add a symbolic label to the top of the file.
63*4882a593SmuzhiyunThis will allow calling routines to access the entry points
64*4882a593Smuzhiyunof this package.
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunThe source code isp.s has also been included but only for
67*4882a593Smuzhiyundocumentation purposes.
68*4882a593Smuzhiyun
69*4882a593SmuzhiyunRelease file structure:
70*4882a593Smuzhiyun-----------------------
71*4882a593Smuzhiyun
72*4882a593Smuzhiyun(top of module)
73*4882a593Smuzhiyun	-----------------
74*4882a593Smuzhiyun	|		| - 128 byte-sized section
75*4882a593Smuzhiyun   (1)  |   Call-Out    | - 4 bytes per entry (user fills these in)
76*4882a593Smuzhiyun	|		| - example routines in iskeleton.s
77*4882a593Smuzhiyun	-----------------
78*4882a593Smuzhiyun	|		| - 8 bytes per entry
79*4882a593Smuzhiyun   (2)  | Entry Point   | - user does a "bra" or "jmp" to this address
80*4882a593Smuzhiyun	|               |
81*4882a593Smuzhiyun	-----------------
82*4882a593Smuzhiyun	|		| - code section
83*4882a593Smuzhiyun   (3)  ~		~
84*4882a593Smuzhiyun	|		|
85*4882a593Smuzhiyun	-----------------
86*4882a593Smuzhiyun(bottom of module)
87*4882a593Smuzhiyun
88*4882a593SmuzhiyunThe first section of this module is the "Call-out" section. This section
89*4882a593Smuzhiyunis NOT INCLUDED in isp.sa (an example "Call-out" section is provided at
90*4882a593Smuzhiyunthe end of the file iskeleton.s). The purpose of this section is to allow
91*4882a593Smuzhiyunthe ISP routines to reference external functions that must be provided
92*4882a593Smuzhiyunby the host operating system. This section MUST be exactly 128 bytes in
93*4882a593Smuzhiyunsize. There are 32 fields, each 4 bytes in size. Each field corresponds
94*4882a593Smuzhiyunto a function required by the ISP (these functions and their location are
95*4882a593Smuzhiyunlisted in "68060ISP call-outs" below). Each field entry should contain
96*4882a593Smuzhiyunthe address of the corresponding function RELATIVE to the starting address
97*4882a593Smuzhiyunof the "call-out" section. The "Call-out" section must sit adjacent to the
98*4882a593Smuzhiyunisp.sa image in memory.
99*4882a593Smuzhiyun
100*4882a593SmuzhiyunThe second section, the "Entry-point" section, is used by external routines
101*4882a593Smuzhiyunto access the functions within the ISP. Since the isp.sa hex file contains
102*4882a593Smuzhiyunno symbol names, this section contains function entry points that are fixed
103*4882a593Smuzhiyunwith respect to the top of the package. The currently defined entry-points
104*4882a593Smuzhiyunare listed in section "68060 ISP entry points" below. A calling routine
105*4882a593Smuzhiyunwould simply execute a "bra" or "jmp" that jumped to the selected function
106*4882a593Smuzhiyunentry-point.
107*4882a593Smuzhiyun
108*4882a593SmuzhiyunFor example, if the 68060 hardware took a "Unimplemented Integer Instruction"
109*4882a593Smuzhiyunexception (vector #61), the operating system should execute something
110*4882a593Smuzhiyunsimilar to:
111*4882a593Smuzhiyun
112*4882a593Smuzhiyun	bra	_060ISP_TOP+128+0
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun(_060ISP_TOP is the starting address of the "Call-out" section; the "Call-out"
115*4882a593Smuzhiyunsection is 128 bytes long; and the Unimplemented Integer ISP handler entry
116*4882a593Smuzhiyunpoint is located 0 bytes from the top of the "Entry-point" section.)
117*4882a593Smuzhiyun
118*4882a593SmuzhiyunThe third section is the code section. After entering through an "Entry-point",
119*4882a593Smuzhiyunthe entry code jumps to the appropriate emulation code within the code section.
120*4882a593Smuzhiyun
121*4882a593Smuzhiyun68060ISP call-outs: (details in iskeleton.s)
122*4882a593Smuzhiyun--------------------
123*4882a593Smuzhiyun0x000:	_060_real_chk
124*4882a593Smuzhiyun0x004:	_060_real_divbyzero
125*4882a593Smuzhiyun0x008:	_060_real_trace
126*4882a593Smuzhiyun0x00c:	_060_real_access
127*4882a593Smuzhiyun0x010:	_060_isp_done
128*4882a593Smuzhiyun
129*4882a593Smuzhiyun0x014:	_060_real_cas
130*4882a593Smuzhiyun0x018:	_060_real_cas2
131*4882a593Smuzhiyun0x01c:	_060_real_lock_page
132*4882a593Smuzhiyun0x020:	_060_real_unlock_page
133*4882a593Smuzhiyun
134*4882a593Smuzhiyun0x024:	(Motorola reserved)
135*4882a593Smuzhiyun0x028:	(Motorola reserved)
136*4882a593Smuzhiyun0x02c:	(Motorola reserved)
137*4882a593Smuzhiyun0x030:	(Motorola reserved)
138*4882a593Smuzhiyun0x034:	(Motorola reserved)
139*4882a593Smuzhiyun0x038:	(Motorola reserved)
140*4882a593Smuzhiyun0x03c:	(Motorola reserved)
141*4882a593Smuzhiyun
142*4882a593Smuzhiyun0x040:	_060_imem_read
143*4882a593Smuzhiyun0x044:	_060_dmem_read
144*4882a593Smuzhiyun0x048:	_060_dmem_write
145*4882a593Smuzhiyun0x04c:	_060_imem_read_word
146*4882a593Smuzhiyun0x050:	_060_imem_read_long
147*4882a593Smuzhiyun0x054:	_060_dmem_read_byte
148*4882a593Smuzhiyun0x058:	_060_dmem_read_word
149*4882a593Smuzhiyun0x05c:	_060_dmem_read_long
150*4882a593Smuzhiyun0x060:	_060_dmem_write_byte
151*4882a593Smuzhiyun0x064:	_060_dmem_write_word
152*4882a593Smuzhiyun0x068:	_060_dmem_write_long
153*4882a593Smuzhiyun
154*4882a593Smuzhiyun0x06c:	(Motorola reserved)
155*4882a593Smuzhiyun0x070:	(Motorola reserved)
156*4882a593Smuzhiyun0x074:	(Motorola reserved)
157*4882a593Smuzhiyun0x078:	(Motorola reserved)
158*4882a593Smuzhiyun0x07c:	(Motorola reserved)
159*4882a593Smuzhiyun
160*4882a593Smuzhiyun68060ISP entry points:
161*4882a593Smuzhiyun-----------------------
162*4882a593Smuzhiyun0x000:	_060_isp_unimp
163*4882a593Smuzhiyun
164*4882a593Smuzhiyun0x008:	_060_isp_cas
165*4882a593Smuzhiyun0x010:	_060_isp_cas2
166*4882a593Smuzhiyun0x018:	_060_isp_cas_finish
167*4882a593Smuzhiyun0x020:	_060_isp_cas2_finish
168*4882a593Smuzhiyun0x028:	_060_isp_cas_inrange
169*4882a593Smuzhiyun0x030:	_060_isp_cas_terminate
170*4882a593Smuzhiyun0x038:	_060_isp_cas_restart
171*4882a593Smuzhiyun
172*4882a593SmuzhiyunIntegrating cas/cas2:
173*4882a593Smuzhiyun---------------------
174*4882a593SmuzhiyunThe instructions "cas2" and "cas" (when used with a misaligned effective
175*4882a593Smuzhiyunaddress) take the Unimplemented Integer Instruction exception. When the
176*4882a593Smuzhiyun060ISP is installed properly, these instructions will enter through the
177*4882a593Smuzhiyun_060_isp_unimp() entry point of the ISP.
178*4882a593Smuzhiyun
179*4882a593SmuzhiyunAfter the 060ISP decodes the instruction type and fetches the appropriate
180*4882a593Smuzhiyundata registers, and BEFORE the actual emulated transfers occur, the
181*4882a593Smuzhiyunpackage calls either the "Call-out" _060_real_cas() or _060_real_cas2().
182*4882a593SmuzhiyunIf the emulation code provided by the 060ISP is sufficient for the
183*4882a593Smuzhiyunhost system (see isp.s source code), then these "Call-out"s should be
184*4882a593Smuzhiyunmade, by the system integrator, to point directly back into the package
185*4882a593Smuzhiyunthrough the "Entry-point"s _060_isp_cas() or _060_isp_cas2().
186*4882a593Smuzhiyun
187*4882a593SmuzhiyunOne other necessary action by the integrator is to supply the routines
188*4882a593Smuzhiyun_060_real_lock_page() and _060_real_unlock_page(). These functions are
189*4882a593Smuzhiyundefined further in iskeleton.s and the 68060 Software Package Specification.
190*4882a593Smuzhiyun
191*4882a593SmuzhiyunIf the "core" emulation routines of either "cas" or "cas2" perform some
192*4882a593Smuzhiyunactions which are too system-specific, then the system integrator must
193*4882a593Smuzhiyunsupply new emulation code. This new emulation code should reside within
194*4882a593Smuzhiyunthe functions _060_real_cas() or _060_real_cas2(). When this new emulation
195*4882a593Smuzhiyuncode has completed, then it should re-enter the 060ISP package through the
196*4882a593Smuzhiyun"Entry-point" _060_isp_cas_finish() or _060_isp_cas2_finish().
197*4882a593SmuzhiyunTo see what the register state is upon entering _060_real_cas() or
198*4882a593Smuzhiyun_060_real_cas2() and what it should be upon return to the package through
199*4882a593Smuzhiyun_060_isp_cas_finish() or _060_isp_cas2_finish(), please refer to the
200*4882a593Smuzhiyunsource code in isp.s.
201*4882a593Smuzhiyun
202*4882a593SmuzhiyunMiscellaneous:
203*4882a593Smuzhiyun--------------
204*4882a593Smuzhiyun
205*4882a593Smuzhiyun_060_isp_unimp:
206*4882a593Smuzhiyun----------------
207*4882a593Smuzhiyun- documented in 2.2 in spec.
208*4882a593Smuzhiyun- Basic flow:
209*4882a593Smuzhiyun	exception taken ---> enter _060_isp_unimp   --|
210*4882a593Smuzhiyun						      |
211*4882a593Smuzhiyun						      |
212*4882a593Smuzhiyun            may exit through _060_real_itrace    <----|
213*4882a593Smuzhiyun						  or  |
214*4882a593Smuzhiyun            may exit through _060_real_chk       <----|
215*4882a593Smuzhiyun						  or  |
216*4882a593Smuzhiyun            may exit through _060_real_divbyzero <----|
217*4882a593Smuzhiyun						  or  |
218*4882a593Smuzhiyun            may exit through _060_isp_done       <----|
219