74 * 0x00E0-0x00FE A second ATA port? The power-on defaults appear to be the same as the ATA registers above.
75 * 0x0100-0x011A MC146818A RTC registers.
76 * 0x011C-0x01FE unknown Probably the RTC's user RAM region. Seems to be fully readable from and writable to.
77 *
78 * Reading from all the unknown seems to be wonky, as it takes the second read from the register to read in the written value.
79 * Sometimes, it even feels as if the value that is read was from elsewhere. Are they possibly write-only or unmapped?
80 *
81 * The purpose of TIMCFG, COUNT_L and COUNT_H is not known because the official Sony code within the PS2 Linux kernel does not seem to use these registers anywhere.
82 *
83 * INTEN, INTSR and INTCL bits:
84 * Bit 1: ATA0
85 * Bit 2: RTC? The purpose of the bit here isn't known because it isn't used, but it seems likely to be the RTC's because the RTC doesn't have a known interrupt even bit for itself.
86 * Bit 3: PCMCIA interrupt.
87*/
88// clang-format on
89
90#define AIF_REGBASE (SPD_REGBASE + 0x4000000)
91
92#define USE_AIF_REGS volatile u16 *aif_regs = \
93 (volatile u16 *)AIF_REGBASE
94
95enum AIF_REGS {
96 AIF_IDENT = 0x00,
97 AIF_REVISION,
98 AIF_INTSR,
99 AIF_INTEN,
100 AIF_TIMCFG,
101 AIF_COUNT_L = 0x08,
102 AIF_COUNT_H,
103 AIF_ATA_TCFG = 0x20,
104 AIF_ATA = 0x30, // ATA register base.
105 AIF_ATACTL = 0x3C,
106 AIF_RTC = 0x80 // RTC register base.
107};
108
109#define AIF_INTCL AIF_INTSR
110
111// AIF interrupt management
112enum AIF_INUM {
113 AIF_INUM_ATA0 = 0,
114 AIF_INUM_RTC, // I don't know what this interrupt event is, but it should be for the RTC because it doesn't have a known bit for itself.