use libdragon io

This commit is contained in:
ariahiro64 2023-10-17 09:10:17 -04:00
parent 35e4727c16
commit 3d61ed89f1

View File

@ -14,9 +14,7 @@
// FIXME: redefined because its in a .c instead of a .h // FIXME: redefined because its in a .c instead of a .h
#define PI_BASE_REG 0x04600000 #define PI_BASE_REG 0x04600000
#define IO_READ(addr) (*(volatile uint32_t *)PHYS_TO_K1(addr)) ///////////////////////////////////////////////////////
#define IO_WRITE(addr,data) \
(*(volatile uint32_t *)PHYS_TO_K1(addr) = (uint32_t)(data))
#define PIF_RAM_START 0x1FC007C0 #define PIF_RAM_START 0x1FC007C0
#define PI_STATUS_ERROR 0x04 #define PI_STATUS_ERROR 0x04
@ -38,6 +36,7 @@
#define PI_BSD_DOM2_PWD_REG (PI_BASE_REG+0x28) #define PI_BSD_DOM2_PWD_REG (PI_BASE_REG+0x28)
#define PI_BSD_DOM2_PGS_REG (PI_BASE_REG+0x2C) #define PI_BSD_DOM2_PGS_REG (PI_BASE_REG+0x2C)
#define PI_BSD_DOM2_RLS_REG (PI_BASE_REG+0x30) #define PI_BSD_DOM2_RLS_REG (PI_BASE_REG+0x30)
///////////////////////////////////////////////////////
#define PHYS_TO_K0(x) ((unsigned long)(x)|0x80000000) /* physical to kseg0 */ #define PHYS_TO_K0(x) ((unsigned long)(x)|0x80000000) /* physical to kseg0 */
#define K0_TO_PHYS(x) ((unsigned long)(x)&0x1FFFFFFF) /* kseg0 to physical */ #define K0_TO_PHYS(x) ((unsigned long)(x)&0x1FFFFFFF) /* kseg0 to physical */