From 16cdb489509c88409a1554a56b401da0c6576bf0 Mon Sep 17 00:00:00 2001 From: uyjulian Date: Fri, 23 Dec 2022 10:39:15 -0600 Subject: [PATCH] Patch, taken from kernelloader, to allow spu2 and usb to work together --- iop/sound/ahx/src/spu2.c | 7 +++++++ iop/sound/libsd/src/freesd.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/iop/sound/ahx/src/spu2.c b/iop/sound/ahx/src/spu2.c index d0b47089e35..4dcd2a16313 100644 --- a/iop/sound/ahx/src/spu2.c +++ b/iop/sound/ahx/src/spu2.c @@ -164,7 +164,14 @@ void InitSpu2() *U32_REGISTER(0x1404) = 0xBF900000; *U32_REGISTER(0x140C) = 0xBF900800; *U32_REGISTER(0x10F0) |= 0x80000; +#if 0 + // Original *U32_REGISTER(0x1570) |= 8; +#else + // Patch to allow SPU2 and USB to work together on newer slims + // Taken from https://gitlab.com/ps2max/linux/kernelloader/-/blob/7255483bf03e42fa3b34c4a990ffcb0e61a7b7da/loader/loader.c#L564 + *U32_REGISTER(0x1570) |= 0x8000008; +#endif *U32_REGISTER(0x1014) = 0x200B31E1; *U32_REGISTER(0x1414) = 0x200B31E1; } diff --git a/iop/sound/libsd/src/freesd.c b/iop/sound/libsd/src/freesd.c index 0d510a91e6a..8246e5c9700 100644 --- a/iop/sound/libsd/src/freesd.c +++ b/iop/sound/libsd/src/freesd.c @@ -116,7 +116,14 @@ void InitSpu2() U32_REGISTER_WRITE(U32_REGISTER(0x1404), 0xBF900000); U32_REGISTER_WRITE(U32_REGISTER(0x140C), 0xBF900800); U32_REGISTER_WRITEOR(U32_REGISTER(0x10F0), 0x80000); +#if 0 + // Original U32_REGISTER_WRITEOR(U32_REGISTER(0x1570), 8); +#else + // Patch to allow SPU2 and USB to work together on newer slims + // Taken from https://gitlab.com/ps2max/linux/kernelloader/-/blob/7255483bf03e42fa3b34c4a990ffcb0e61a7b7da/loader/loader.c#L564 + U32_REGISTER_WRITEOR(U32_REGISTER(0x1570), 0x8000008); +#endif U32_REGISTER_WRITE(U32_REGISTER(0x1014), 0x200B31E1); U32_REGISTER_WRITE(U32_REGISTER(0x1414), 0x200B31E1); }