To: efi332@coulomb Subject: new m68k-coff RedHat package -------- I packaged up the latest versions of the efi332 development environment. Everything should be very close to "install-n-play" on a RH-4.0 Linux distribution. Possible changes you may want to make are described below. Other Linux distributions can use the rpm2cpio tool to convert the RedHat distribution to normal cpio files. BTW, the bdm-load load tool (for programming the FLASH) is not yet part of this package because it doesn't yet work with the latest bdm.o driver. An improved "README" file follows..... Needed files (ftp://efi332.eng.ohio-state.edu/pub/efi332/RedHat): m68k-libgloss-2.7.2-1.i386.rpm m68k-binutils-2.7.2-1.i386.rpm m68k-gdb-2.7.2-1.i386.rpm m68k-newlib-2.7.2-1.i386.rpm m68k-gcc-2.7.2-1.i386.rpm m68k-libg++-2.7.2-1.i386.rpm Optional files: m68k-examples.tar.gz (example Makefile and example tpu code) *.src.rpm (these contain virgin source code with _all_ of the details on how I choose to compile the packages.) Notes: The gcc package loads into /usr/m68k-coff (rather than something like /usr/local/m68k-coff). This is to parallel the native Linux gcc installation. Directories like /usr/lib/gcc-lib will correctly contain the native and cross compiler structures as intended by the gcc distribution. You should use RedHat-4.0; other releases should work but some minor changes may be needed (see bdm.o below). The native gcc version should be 2.7.2. If you use a different version, you may need to fully specify the cross complier in the makefile. To install and configure: A) Load the all of the required packages listed above with the RedHat rpm tool. If you do not use RedHat, use the rpm2cpio tool to convert the format to cpio. B) To customize your startup SIM register settings: (You should not need to do this for a stock RH-4.0 and efi332 board... with the exception of the programming the FLASH (see below). You do _not_ need any FLASH memory to test the board using the RAM model.) For additional rpm information, see the RPMHOWTO on the RedHat www page. B.1) load the libgloss source package: "rpm -i m68k-libgloss-2.7.2-1.src.rpm" B.2) unpack the above: "cd /usr/src/redhat/SPEC" "rpm -bp m68k-libgloss-2.7.2-1.spec" B.3) There are currently three files that the user must modify to match the hardware configuration being used (_Most_ will not need to modify anything). Note that the distribution is structured to allow support of more than one configuration at a time. The files to configure are: B.3.a) In the directory /usr/src/redhat/BUILD/m68k-coff-2.7.2/ \ newlib-1.6.1/libgloss_332_0.40/m68k, locate the files EFI332_RAM.ld and EFI332_ROM.ld. In these files, check and set the parameters ram:origin, ram:length, _stack, and _endheap. By default they are: =====================cut here==================== /* * User modifiable values: * * ram: ORIGIN set to location of the start of RAM * ram: LENGTH set to the length of RAM * _stack set to the last location of RAM * _ENDHEAP set to the last location of heap space; i.e. * leave room for the stack . */ MEMORY { ram : ORIGIN = 0x80000, LENGTH = 256K } __stack = 0xC0000; /* the last location of RAM (+1)*/ _ENDHEAP = __stack - 4k; /* leave space for the stack */ =====================cut here==================== These default settings should be fine, but you should be aware of them in case, for example, you run out of stack space. B.3.b) The file EFI332_crt0.c, in the same directory as above, contains the code to initialize the SIM registers. The contents of the SIM registers must be configured for you hardware. *Only* registers that need be initialized before the C-library should be set here. Others should be part of your application's software. Please note that portions of this code are automatically parsed to form ram_init; the file that gdb will load to configure the SIM before loading your application. For more information on configuring these registers, look at the file m68k-coff/include/EFI/sim.h. The defaults should be fine at least for programs ran in RAM. I have change the CS line for the flash on most of my boards to allow for more flexibility on the 50-pin expansion port. Once you are ready to run in FLASH, you may need to change one or two lines here. (Someone with an original board to test the changes will hopefully post the settings). The current default settings follow: =====================cut here==================== /* Chip-Select Base Address Register */ /* see section 7 of the SIM Reference Manual */ *CSBARBT = (unsigned short int) ((0x000000 >> 8)&0xfff8 | BS_512K ); /* 512k bytes located at 0x0000 */ *CSBAR0 = (unsigned short int) ((0x000000 >> 8)&0xfff8 | BS_1M ); /* 1M bytes located at 0x0000 */ *CSBAR1 = (unsigned short int) ((0x080000 >> 8)&0xfff8 | BS_256K ); /* 256k bytes located at 0x80000 */ *CSBAR2 = (unsigned short int) ((0x080000 >> 8)&0xfff8 | BS_256K ); /* 256k bytes located at 0x80000 */ *CSBAR3 = (unsigned short int) (0xfff8 | BS_64K); /* AVEC interrupts */ *CSBAR6 = (unsigned short int) ((0x000000 >> 8)&0xfff8 | BS_512K ); /* 512k bytes located at 0x0000 */ *CSBAR8 = (unsigned short int) /* PCMCIA IOCS */ ((0x0c0000 >> 8)&0xfff8 | BS_64K ); /* 64k bytes located at 0xc0000 */ *CSBAR9 = (unsigned short int) /* PCMCIA MEMCS */ ((0x0D0000 >> 8)&0xfff8 | BS_64K ); /* 64k bytes located at 0xd0000 */ /* Chip-Select Options Registers */ /* see section 7 of the SIM Reference Manual */ *CSORBT = (unsigned short int) ( BothBytes | ReadWrite | SyncAS | WaitStates_2 | UserSupSpace ); *CSOR0 = (unsigned short int) ( BothBytes | ReadOnly | SyncAS | External | UserSupSpace ); *CSOR1 = (unsigned short int) ( LowerByte | ReadWrite | SyncAS | FastTerm | UserSupSpace ); *CSOR2 = (unsigned short int) ( UpperByte | ReadWrite | SyncAS | FastTerm | UserSupSpace ); *CSOR3 = (unsigned short int) ( BothBytes | ReadWrite | SyncAS | CPUSpace | IPLevel_any | AVEC ); *CSOR6 = (unsigned short int) ( BothBytes | ReadOnly | SyncAS | External | UserSupSpace ); *CSOR8 = (unsigned short int) ( BothBytes | ReadWrite | SyncAS | External | UserSupSpace ); *CSOR9 = (unsigned short int) ( BothBytes | ReadWrite | SyncAS | External | UserSupSpace ); /* Chip Select Pin Assignment Register 0 */ /* see section 7 of the SIM Reference Manual */ *CSPAR0 = (unsigned short int)( SAM(DisOut,CS_5,0x3000) | /* PC2 */ SAM(DisOut,CS_4,0x0c00) | /* PC1 */ SAM(DisOut,CS_3,0x0300) | /* AVEC (internally) */ SAM(CS16bit,CS_2,0x00c0)| /* RAM UDS */ SAM(CS16bit,CS_1,0x0030)| /* RAM LDS */ SAM(CS16bit,CS_0,0x000c)| /* W/!R */ SAM(CS16bit,CSBOOT,0x0003) /* ROM DS */ ); /* Chip Select Pin Assignment Register 1 */ /* see section 7 of the SIM Reference Manual */ *CSPAR1 = (unsigned short int)( SAM(DisOut,CS_10,0x300)| /* ECLK */ SAM(CS16bit,CS_9,0x0c0) | /* PC6 */ SAM(CS16bit,CS_8,0x030) | /* PC5 */ SAM(DisOut,CS_7,0x00c) | /* PC4 */ SAM(CS16bit,CS_6,0x003) /* PC3 */ ); =====================cut here==================== B.3) Configure the RS232 baud rate in EFI332.h of the same directory. The default baud rate is 115.2k. Modify the 'BAUD' definition if you need to change this. B.4) For the changes to take effect, you must now finish the rpm build and install. Use the commands: "cd /usr/src/redhat/SPEC" "rpm -bc --short-circuit m68k-libgloss-2.7.2-1.spec" "rpm -bi --short-circuit m68k-libgloss-2.7.2-1.spec" You can now clean the /usr/src/redhat area of related files. C) If you are not running the stock RH-4.0 kernel, you may have to recompile bdm.o to get the right kernel version numbers. Simply locate the the bdm-driver directory in the gdb-bdm package (it's included in the m68k-gdb-2.7.2-1.src.rpm package) and type "make" as root. D) Give the examples in m68k-examples.tar.gz a try. t1.c - prints "hello world" and exits t2.cc - sample C++ code... (I didn't write it...some code from a C++ homework assignment) t3.c - displays a growing sinusoid t4.c - an _over_-simplified memory test program. wheel - 60-2 tooth wheel test program with example of how to load the TPU RAM and more) good luck..... John S Gwynne Gwynne.1@osu.edu _______________________________________________________________________________ T h e O h i o - S t a t e U n i v e r s i t y ElectroScience Laboratory, 1320 Kinnear Road, Columbus, Ohio 43212, USA Telephone: (614) 292-7981 * Fax: (614) 292-7297 -------------------------------------------------------------------------------