1 // Definitions for X86 IO port access. 2 // 3 // Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net> 4 // 5 // This file may be distributed under the terms of the GNU LGPLv3 license. 6 // 7 // This file copied (somewhat) intact from SeaBIOS. 8 9 #ifndef IOPORT_H 10 #define IOPORT_H 11 12 #define PORT_DMA_ADDR_2 0x0004 13 #define PORT_DMA_CNT_2 0x0005 14 #define PORT_DMA1_MASK_REG 0x000a 15 #define PORT_DMA1_MODE_REG 0x000b 16 #define PORT_DMA1_CLEAR_FF_REG 0x000c 17 #define PORT_DMA1_MASTER_CLEAR 0x000d 18 #define PORT_PIC1_CMD 0x0020 19 #define PORT_PIC1_DATA 0x0021 20 #define PORT_PIT_COUNTER0 0x0040 21 #define PORT_PIT_COUNTER1 0x0041 22 #define PORT_PIT_COUNTER2 0x0042 23 #define PORT_PIT_MODE 0x0043 24 #define PORT_PS2_DATA 0x0060 25 #define PORT_PS2_CTRLB 0x0061 26 #define PORT_PS2_STATUS 0x0064 27 #define PORT_CMOS_INDEX 0x0070 28 #define PORT_CMOS_DATA 0x0071 29 #define PORT_DIAG 0x0080 30 #define PORT_DMA_PAGE_2 0x0081 31 #define PORT_A20 0x0092 32 #define PORT_PIC2_CMD 0x00a0 33 #define PORT_PIC2_DATA 0x00a1 34 #define PORT_SMI_CMD 0x00b2 35 #define PORT_SMI_STATUS 0x00b3 36 #define PORT_DMA2_MASK_REG 0x00d4 37 #define PORT_DMA2_MODE_REG 0x00d6 38 #define PORT_DMA2_MASTER_CLEAR 0x00da 39 #define PORT_MATH_CLEAR 0x00f0 40 #define PORT_ATA2_CMD_BASE 0x0170 41 #define PORT_ATA1_CMD_BASE 0x01f0 42 #define PORT_LPT2 0x0278 43 #define PORT_SERIAL4 0x02e8 44 #define PORT_SERIAL2 0x02f8 45 #define PORT_ATA2_CTRL_BASE 0x0374 46 #define PORT_LPT1 0x0378 47 #define PORT_SERIAL3 0x03e8 48 #define PORT_ATA1_CTRL_BASE 0x03f4 49 #define PORT_FD_BASE 0x03f0 50 #define PORT_FD_DOR 0x03f2 51 #define PORT_FD_STATUS 0x03f4 52 #define PORT_FD_DATA 0x03f5 53 #define PORT_HD_DATA 0x03f6 54 #define PORT_FD_DIR 0x03f7 55 #define PORT_SERIAL1 0x03f8 56 #define PORT_PIC1_ELCR 0x04d0 57 #define PORT_PIC2_ELCR 0x04d1 58 #define PORT_PCI_CMD 0x0cf8 59 #define PORT_PCI_REBOOT 0x0cf9 60 #define PORT_PCI_DATA 0x0cfc 61 #define PORT_BIOS_DEBUG 0x0402 62 #define PORT_QEMU_CFG_CTL 0x0510 63 #define PORT_QEMU_CFG_DATA 0x0511 64 #define PORT_ACPI_PM_BASE 0xb000 65 #define PORT_SMB_BASE 0xb100 66 #define PORT_BIOS_APM 0x8900 67 68 // Serial port offsets 69 #define SEROFF_DATA 0 70 #define SEROFF_DLL 0 71 #define SEROFF_IER 1 72 #define SEROFF_DLH 1 73 #define SEROFF_IIR 2 74 #define SEROFF_LCR 3 75 #define SEROFF_LSR 5 76 #define SEROFF_MSR 6 77 78 // PORT_A20 bitdefs 79 #define A20_ENABLE_BIT 0x02 80 81 // PORT_CMOS_INDEX nmi disable bit 82 #define NMI_DISABLE_BIT 0x80 83 84 #endif // ioport.h 85