xref: /openbmc/linux/arch/m68k/ifpsp060/TEST.DOC (revision e5451c8f8330e03ad3cfa16048b4daf961af434f)
11da177e4SLinus Torvalds~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21da177e4SLinus TorvaldsMOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
31da177e4SLinus TorvaldsM68000 Hi-Performance Microprocessor Division
41da177e4SLinus TorvaldsM68060 Software Package
51da177e4SLinus TorvaldsProduction Release P1.00 -- October 10, 1994
61da177e4SLinus Torvalds
7*96de0e25SJan EngelhardtM68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
81da177e4SLinus Torvalds
91da177e4SLinus TorvaldsTHE SOFTWARE is provided on an "AS IS" basis and without warranty.
101da177e4SLinus TorvaldsTo the maximum extent permitted by applicable law,
111da177e4SLinus TorvaldsMOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
121da177e4SLinus TorvaldsINCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
131da177e4SLinus Torvaldsand any warranty against infringement with regard to the SOFTWARE
141da177e4SLinus Torvalds(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
151da177e4SLinus Torvalds
161da177e4SLinus TorvaldsTo the maximum extent permitted by applicable law,
171da177e4SLinus TorvaldsIN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
181da177e4SLinus Torvalds(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
191da177e4SLinus TorvaldsBUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)
201da177e4SLinus TorvaldsARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
211da177e4SLinus TorvaldsMotorola assumes no responsibility for the maintenance and support of the SOFTWARE.
221da177e4SLinus Torvalds
231da177e4SLinus TorvaldsYou are hereby granted a copyright license to use, modify, and distribute the SOFTWARE
241da177e4SLinus Torvaldsso long as this entire notice is retained without alteration in any modified and/or
251da177e4SLinus Torvaldsredistributed versions, and that such modified versions are clearly identified as such.
261da177e4SLinus TorvaldsNo licenses are granted by implication, estoppel or otherwise under any patents
271da177e4SLinus Torvaldsor trademarks of Motorola, Inc.
281da177e4SLinus Torvalds~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
291da177e4SLinus Torvalds68060 SOFTWARE PACKAGE (Kernel version) SIMPLE TESTS
301da177e4SLinus Torvalds-----------------------------------------------------
311da177e4SLinus Torvalds
321da177e4SLinus TorvaldsThe files itest.sa and ftest.sa contain simple tests to check
331da177e4SLinus Torvaldsthe state of the 68060ISP and 68060FPSP once they have been installed.
341da177e4SLinus Torvalds
351da177e4SLinus TorvaldsRelease file format:
361da177e4SLinus Torvalds--------------------
371da177e4SLinus TorvaldsThe release files itest.sa and ftest.sa are essentially
381da177e4SLinus Torvaldshexadecimal images of the actual tests. This format is the
391da177e4SLinus TorvaldsONLY format that will be supported. The hex images were created
401da177e4SLinus Torvaldsby assembling the source code and then converting the resulting
411da177e4SLinus Torvaldsbinary output images into ASCII text files. The hexadecimal
421da177e4SLinus Torvaldsnumbers are listed using the Motorola Assembly syntax assembler
431da177e4SLinus Torvaldsdirective "dc.l" (define constant longword). The files can be
441da177e4SLinus Torvaldsconverted to other assembly syntaxes by using any word processor
451da177e4SLinus Torvaldswith a global search and replace function.
461da177e4SLinus Torvalds
471da177e4SLinus TorvaldsTo assist in assembling and linking these modules with other modules,
481da177e4SLinus Torvaldsthe installer should add symbolic labels to the top of the files.
491da177e4SLinus TorvaldsThis will allow the calling routines to access the entry points
501da177e4SLinus Torvaldsof these packages.
511da177e4SLinus Torvalds
521da177e4SLinus TorvaldsThe source code itest.s and ftest.s have been included but only
531da177e4SLinus Torvaldsfor documentation purposes.
541da177e4SLinus Torvalds
551da177e4SLinus TorvaldsRelease file structure:
561da177e4SLinus Torvalds-----------------------
571da177e4SLinus Torvalds
581da177e4SLinus Torvalds(top of module)
591da177e4SLinus Torvalds	-----------------
601da177e4SLinus Torvalds	|		| - 128 byte-sized section
611da177e4SLinus Torvalds   (1)  |   Call-Out	| - 4 bytes per entry (user fills these in)
621da177e4SLinus Torvalds	|		|
631da177e4SLinus Torvalds	-----------------
641da177e4SLinus Torvalds	|		| - 8 bytes per entry
651da177e4SLinus Torvalds   (2)  | Entry Point	| - user does "bsr" or "jsr" to this address
661da177e4SLinus Torvalds	|		|
671da177e4SLinus Torvalds	-----------------
681da177e4SLinus Torvalds	|		| - code section
691da177e4SLinus Torvalds   (3)  ~		~
701da177e4SLinus Torvalds	|		|
711da177e4SLinus Torvalds	-----------------
721da177e4SLinus Torvalds(bottom of module)
731da177e4SLinus Torvalds
741da177e4SLinus TorvaldsThe first section of this module is the "Call-out" section. This section
751da177e4SLinus Torvaldsis NOT INCLUDED in {i,f}test.sa (an example "Call-out" section is provided at
761da177e4SLinus Torvaldsthe end of this file). The purpose of this section is to allow the test
771da177e4SLinus Torvaldsroutines to reference external printing functions that must be provided
781da177e4SLinus Torvaldsby the host operating system. This section MUST be exactly 128 bytes in
791da177e4SLinus Torvaldssize. There are 32 fields, each 4 bytes in size. Each field corresponds
801da177e4SLinus Torvaldsto a function required by the test packages (these functions and their
811da177e4SLinus Torvaldslocation are listed in "68060{ISP,FPSP}-TEST call-outs" below). Each field
821da177e4SLinus Torvaldsentry should contain the address of the corresponding function RELATIVE to
831da177e4SLinus Torvaldsthe starting address of the "call-out" section. The "Call-out" section must
841da177e4SLinus Torvaldssit adjacent to the {i,f}test.sa image in memory. Since itest.sa and ftest.sa
851da177e4SLinus Torvaldsare individual tests, they each require their own "Call-out" sections.
861da177e4SLinus Torvalds
871da177e4SLinus TorvaldsThe second section, the "Entry-point" section, is used by external routines
881da177e4SLinus Torvaldsto access the test routines. Since the {i,f}test.sa hex files contain
891da177e4SLinus Torvaldsno symbol names, this section contains function entry points that are fixed
901da177e4SLinus Torvaldswith respect to the top of the package. The currently defined entry-points
911da177e4SLinus Torvaldsare listed in section "68060{ISP,FPSP}-TEST entry points" below. A calling
921da177e4SLinus Torvaldsroutine would simply execute a "bsr" or "jsr" that jumped to the selected
931da177e4SLinus Torvaldsfunction entry-point.
941da177e4SLinus Torvalds
951da177e4SLinus TorvaldsFor example, to run the 060ISP test, write a program that includes the
961da177e4SLinus Torvaldsitest.sa data and execute something similar to:
971da177e4SLinus Torvalds
981da177e4SLinus Torvalds	bsr	_060ISP_TEST+128+0
991da177e4SLinus Torvalds
1001da177e4SLinus Torvalds(_060ISP_TEST is the starting address of the "Call-out" section; the "Call-out"
1011da177e4SLinus Torvaldssection is 128 bytes long; and the 68060ISP test entry point is located
1021da177e4SLinus Torvalds0 bytes from the top of the "Entry-point" section.)
1031da177e4SLinus Torvalds
1041da177e4SLinus TorvaldsThe third section is the code section. After entering through an "Entry-point",
1051da177e4SLinus Torvaldsthe entry code jumps to the appropriate test code within the code section.
1061da177e4SLinus Torvalds
1071da177e4SLinus Torvalds68060ISP-TEST Call-outs:
1081da177e4SLinus Torvalds------------------------
1091da177e4SLinus Torvalds0x0: _print_string()
1101da177e4SLinus Torvalds0x4: _print_number()
1111da177e4SLinus Torvalds
1121da177e4SLinus Torvalds68060FPSP-TEST Call-outs:
1131da177e4SLinus Torvalds-------------------------
1141da177e4SLinus Torvalds0x0: _print_string()
1151da177e4SLinus Torvalds0x4: _print_number()
1161da177e4SLinus Torvalds
1171da177e4SLinus TorvaldsThe test packages call _print_string() and _print_number()
1181da177e4SLinus Torvaldsas subroutines and expect the main program to print a string
1191da177e4SLinus Torvaldsor a number to a file or to the screen.
1201da177e4SLinus TorvaldsIn "C"-like fashion, the test program calls:
1211da177e4SLinus Torvalds
1221da177e4SLinus Torvalds	print_string("Test passed");
1231da177e4SLinus Torvalds
1241da177e4SLinus Torvalds		or
1251da177e4SLinus Torvalds
1261da177e4SLinus Torvalds	print_number(20);
1271da177e4SLinus Torvalds
1281da177e4SLinus TorvaldsFor _print_string(), the test programs pass a longword address
1291da177e4SLinus Torvaldsof the string on the stack. For _print_number(), the test programs pass
1301da177e4SLinus Torvaldsa longword number to be printed.
1311da177e4SLinus Torvalds
1321da177e4SLinus TorvaldsFor debugging purposes, after the main program performs a "print"
1331da177e4SLinus Torvaldsfor a test package, it should flush the output so that it's not
1341da177e4SLinus Torvaldsbuffered. In this way, if the test program crashes, at least the previous
1351da177e4SLinus Torvaldsstatements printed will be seen.
1361da177e4SLinus Torvalds
1371da177e4SLinus Torvalds68060ISP-TEST Entry-points:
1381da177e4SLinus Torvalds---------------------------
1391da177e4SLinus Torvalds0x0: integer test
1401da177e4SLinus Torvalds
1411da177e4SLinus Torvalds68060FPSP-TEST Entry-points:
1421da177e4SLinus Torvalds----------------------------
1431da177e4SLinus Torvalds0x00: main fp test
1441da177e4SLinus Torvalds0x08: FP unimplemented test
1451da177e4SLinus Torvalds0x10: FP enabled snan/operr/ovfl/unfl/dz/inex
1461da177e4SLinus Torvalds
1471da177e4SLinus TorvaldsThe floating-point unit test has 3 entry points which will require
1481da177e4SLinus Torvalds3 different calls to the package if each of the three following tests
1491da177e4SLinus Torvaldsis desired:
1501da177e4SLinus Torvalds
1511da177e4SLinus Torvaldsmain fp test: tests (1) unimp effective address exception
1521da177e4SLinus Torvalds		    (2) unsupported data type exceptions
1531da177e4SLinus Torvalds		    (3) non-maskable overflow/underflow exceptions
1541da177e4SLinus Torvalds
1551da177e4SLinus TorvaldsFP unimplemented: tests FP unimplemented exception. this one is
1561da177e4SLinus Torvalds		  separate from the previous tests for systems that don't
1571da177e4SLinus Torvalds		  want FP unimplemented instructions.
1581da177e4SLinus Torvalds
1591da177e4SLinus TorvaldsFP enabled: tests enabled snan/operr/ovfl/unfl/dz/inex.
1601da177e4SLinus Torvalds	    basically, it enables each of these exceptions and forces
1611da177e4SLinus Torvalds	    each using an implemented FP instruction. this process
1621da177e4SLinus Torvalds	    exercises _fpsp_{snan,operr,ovfl,unfl,dz,inex}() and
1631da177e4SLinus Torvalds	    _real_{snan,operr,ovfl,unfl,dz,inex}(). the test expects
1641da177e4SLinus Torvalds	    _real_XXXX() to do nothing except clear the exception
1651da177e4SLinus Torvalds	    and "rte". if a system's _real_XXXX() handler creates an
1661da177e4SLinus Torvalds	    alternate result, the test will print "failed" but this
1671da177e4SLinus Torvalds	    is acceptable.
1681da177e4SLinus Torvalds
1691da177e4SLinus TorvaldsMiscellaneous:
1701da177e4SLinus Torvalds--------------
1711da177e4SLinus TorvaldsAgain, itest.sa and ftest.sa are simple tests and do not thoroughly
1721da177e4SLinus Torvaldstest all 68060SP connections. For example, they do not test connections
1731da177e4SLinus Torvaldsto _real_access(), _real_trace(), _real_trap(), etc. because these
1741da177e4SLinus Torvaldswill be system-implemented several different ways and the test packages
1751da177e4SLinus Torvaldsmust remain system independent.
1761da177e4SLinus Torvalds
1771da177e4SLinus TorvaldsExample test package set-up:
1781da177e4SLinus Torvalds----------------------------
1791da177e4SLinus Torvalds_print_str:
1801da177e4SLinus Torvalds	.			# provided by system
1811da177e4SLinus Torvalds	rts
1821da177e4SLinus Torvalds
1831da177e4SLinus Torvalds_print_num:
1841da177e4SLinus Torvalds	.			# provided by system
1851da177e4SLinus Torvalds	rts
1861da177e4SLinus Torvalds
1871da177e4SLinus Torvalds	.
1881da177e4SLinus Torvalds	.
1891da177e4SLinus Torvalds	bsr	_060FPSP_TEST+128+0
1901da177e4SLinus Torvalds	.
1911da177e4SLinus Torvalds	.
1921da177e4SLinus Torvalds	rts
1931da177e4SLinus Torvalds
1941da177e4SLinus Torvalds# beginning of "Call-out" section; provided by integrator.
1951da177e4SLinus Torvalds# MUST be 128 bytes long.
1961da177e4SLinus Torvalds_060FPSP_TEST:
1971da177e4SLinus Torvalds	long	_print_str - _060FPSP_TEST
1981da177e4SLinus Torvalds	long	_print_num - _060FPSP_TEST
1991da177e4SLinus Torvalds	space	120
2001da177e4SLinus Torvalds
2011da177e4SLinus Torvalds# ftest.sa starts here; start of "Entry-point" section.
2021da177e4SLinus Torvalds	long	0x60ff0000, 0x00002346
2031da177e4SLinus Torvalds	long	0x60ff0000, 0x00018766
2041da177e4SLinus Torvalds	long	0x60ff0000, 0x00023338
2051da177e4SLinus Torvalds	long	0x24377299, 0xab2643ea
2061da177e4SLinus Torvalds		.
2071da177e4SLinus Torvalds		.
2081da177e4SLinus Torvalds		.
209