diff --git a/arm11/source/hw/mcu.c b/arm11/source/hw/mcu.c index 2e8b178..3c5a291 100755 --- a/arm11/source/hw/mcu.c +++ b/arm11/source/hw/mcu.c @@ -172,14 +172,14 @@ void MCU_HandleInterrupts(u32 __attribute__((unused)) irqn) case MCU_SHELL_OPEN: MCU_PushToLCD(true); MCU_UpdateShellState(true); - TIMER_WaitTicks(CLK_MS_TO_TICKS(10)); + TIMER_WaitTicks(CLK_MS_TO_TICKS(5)); MCU_ResetLED(); break; case MCU_SHELL_CLOSE: MCU_PushToLCD(false); MCU_UpdateShellState(false); - TIMER_WaitTicks(CLK_MS_TO_TICKS(10)); + TIMER_WaitTicks(CLK_MS_TO_TICKS(5)); break; case MCU_VOL_SLIDER: @@ -196,7 +196,7 @@ void MCU_HandleInterrupts(u32 __attribute__((unused)) irqn) void MCU_Init(void) { - u32 mask = 0xFFBF0800; + const u32 mask = 0xFFBF0800; MCU_WriteRegBuf(REG_INT_EN, (const u8*)&mask, sizeof(mask)); MCU_ResetLED(); diff --git a/arm11/source/hw/spi.c b/arm11/source/hw/spi.c index a5bbc39..358f546 100755 --- a/arm11/source/hw/spi.c +++ b/arm11/source/hw/spi.c @@ -126,3 +126,10 @@ void SPI_Init(void) // interface used during the NDS days *REG_CFG_SPI_CNT = 7; } + +void SPI_Deinit(void) +{ + // Keep backwards compatibility with software that + // assumes all bus interfaces will be set to old + *REG_CFG_SPI_CNT = 0; +} diff --git a/arm11/source/hw/spi.h b/arm11/source/hw/spi.h index 6b3a24b..bea9251 100755 --- a/arm11/source/hw/spi.h +++ b/arm11/source/hw/spi.h @@ -29,3 +29,4 @@ typedef struct { int SPI_DoXfer(u32 dev, const SPI_XferInfo *xfer, u32 xfer_cnt); void SPI_Init(void); +void SPI_Deinit(void); diff --git a/arm11/source/system/sys.c b/arm11/source/system/sys.c index c8a2a50..a607421 100755 --- a/arm11/source/system/sys.c +++ b/arm11/source/system/sys.c @@ -118,7 +118,7 @@ void SYS_CoreZeroInit(void) GPU_SetFramebufferMode(1, PDC_RGB24); MCU_PushToLCD(true); - TIMER_WaitTicks(CLK_MS_TO_TICKS(10)); + TIMER_WaitTicks(CLK_MS_TO_TICKS(5)); } void SYS_CoreInit(void) @@ -163,6 +163,8 @@ void __attribute__((noreturn)) SYS_CoreShutdown(void) ARM_SetACR(ARM_GetACR() & ~(ACR_RETSTK | ACR_DBPRED | ACR_SBPRED | ACR_FOLDING | ACR_SMP)); + SPI_Deinit(); + if (!core) { while(*LEGACY_BOOT_ENTRYPOINT == 0); ((void (*)(void))(*LEGACY_BOOT_ENTRYPOINT))(); diff --git a/common/pxi.h b/common/pxi.h index 7012076..1bb5ee0 100644 --- a/common/pxi.h +++ b/common/pxi.h @@ -68,6 +68,7 @@ enum { #define PXI_CNT_RECV_FIFO_EMPTY (BIT(8)) #define PXI_CNT_RECV_FIFO_FULL (BIT(9)) #define PXI_CNT_RECV_FIFO_AVAIL_IRQ (BIT(10)) +#define PXI_CNT_ACKNOWLEDGE_ERROR (BIT(14)) #define PXI_CNT_ENABLE_FIFO (BIT(15)) static inline void PXI_SetRemote(u8 msg) @@ -93,7 +94,8 @@ static inline void PXI_Reset(void) *PXI_RECV; *PXI_CNT = 0; - *PXI_CNT = PXI_CNT_RECV_FIFO_AVAIL_IRQ | PXI_CNT_ENABLE_FIFO; + *PXI_CNT = PXI_CNT_RECV_FIFO_AVAIL_IRQ | PXI_CNT_ENABLE_FIFO | + PXI_CNT_ACKNOWLEDGE_ERROR; PXI_SetRemote(0xFF); }