This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Support for MIPS R5900 (Sony Playstation 2)


Hello,

The following patches add support for the MIPS R5900 CPU:
http://kernelloader.cvs.sourceforge.net/viewvc/kernelloader/linux/simple-toolchain/binutils-cvs-20121124-mipsel-ps2-tests.patch?view=markup
http://kernelloader.cvs.sourceforge.net/viewvc/kernelloader/linux/simple-toolchain/binutils-cvs-20121124-mipsel-ps2.patch?view=markup

It would be nice when this can be added to the offical binutils. Please tell me if this acceptable or there is a problem.

The R5900 CPU is used as the main processor in the Sony Playstation 2 (ps2).
The CPU supports MIPS ISA I, II, III and IV, but not all instructions. There are only few instructions which are MIPS IV, so it is configured as MIPS III in binutils.
R5900 supports 32-bit, 64-bit and 128-bit data transfers and registers.
The address bus is 32-bit. There fore the CPU can run MIPS ABI o32 and n32 code. o64 and n64 code would run until an address outside the first 4 GByte is addressed (Indeed the PS2 has 32 MByte RAM and the PS2 Tool has 128 MByte).
The CPU doesn't support 64-bit multiplication, but have double size lo and hi registers for parallel multiplication.
The FPU is 32 bit and has odd and even registers.
The patch adds the following features:
- Support for R5900 in the toolchain mips64el-linux-gnu.
- Support for R5900 in the toolchain mips64r5900el-linux-gnu.
- Support for R5900 in the toolchain mips64r5900el-ps2-elf (for native PS2 development).
- Support for R5900 in the toolchain mipsel-linux-gnu.
- Support for R5900 in the toolchain mipsr5900el-linux-gnu.
- Support for R5900 in the toolchain mipsr5900el-ps2-elf (for native PS2 development).
- Support for VU instructions of the COP 2 (VU0 in Macro Mode). This includes special register suffixes.
- Support for MMI instructions (parallel computing, specific for R5900).
- Detecting of short loops because of a CPU bug (minimum number of instructions needed in a conditional loop).
- Fixing of short loops in a "reorder" section.
- New parameter "-mhard-ldsd" to support ld and sd instructions in MIPS ABI o32. This is needed to compile the Linux kernel with support for 64 bit registers, because otherwise the instructions ld and sd are replaced by lw and sw.
- The "-mtune=r5900" parameter forces "-march=r5900", because this is the only configurable option of GCC to support R5900 as default with mips64el-linux-gnu or mipsel-linux-gnu.
- Included linker scripts for Sony Playstation 2 native ELF files (toolchain mips64r5900el-ps2-elf and mipsr5900el-ps2-elf).
- The opcode for c.lt.s and c.le.s is different to other MIPS CPUs.
- The instruction cvt.w.s always behaves as trunc.w.s.
- The second patch includes the tests for the testsuite.
- The test results of the testsuite are unchanged after patching for mips64el-linux-gnu and mipsel-linux-gnu. Some existing test cases are not designed to run on R5900, therefore tests fail with mips64r5900el-linux-gnu, mips64r5900el-ps2-elf, mipsr5900el-linux-gnu and mipsr5900el-ps2-elf. This is just normal, because the default is changed from r4000 or r3000 to r5900.
- Support for odd single floating point registers on R5900.

Toolchain with r5900 in the name has MIPS R5900 configured as default.
The other toolchains need the parameters for gas: -march=r5900 -mtune=r5900 -mhard-ldsd

The main 2 websites which targets the development for PS2 are:
http://forums.ps2dev.org/viewforum.php?f=11
http://psx-scene.com/forums/ps2-linux/

(Note: no one can register at the first website, because there is an E-Mail bug since years).

Best regards
JÃrgen Urban


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]