upcreg.h revision 1.2
11.2Sbjh21/* $NetBSD: upcreg.h,v 1.2 2000/08/16 23:56:12 bjh21 Exp $ */
21.1Sbjh21
31.1Sbjh21/*
41.1Sbjh21 * Ben Harris, 2000
51.1Sbjh21 *
61.1Sbjh21 * This file is in the public domain.
71.1Sbjh21 */
81.1Sbjh21
91.1Sbjh21/*
101.1Sbjh21 * upcreg.h - CHIPS and Technologies Universal Peripheral Controllers
111.1Sbjh21 */
121.1Sbjh21
131.1Sbjh21/*
141.1Sbjh21 * This file contains register details for:
151.1Sbjh21 * CHIPS 82C710 Universal Peripheral Controller
161.1Sbjh21 * CHIPS 82C711 Universal Peripheral Controller II
171.1Sbjh21 * CHIPS 82C721 Universal Peripheral Controller III
181.1Sbjh21 */
191.1Sbjh21
201.2Sbjh21#define UPC_BUS_SIZE		0x400 /* Approximate */
211.2Sbjh21
221.1Sbjh21/* Fixed port addresses */
231.1Sbjh21
241.1Sbjh21#define UPC_PORT_CFGADDR	0x3f0 /* Configuration register address */
251.1Sbjh21#define UPC_PORT_CFGDATA	0x3f1 /* Configuration register value */
261.1Sbjh21#define UPC_PORT_IDECMDBASE    	0x1f0 /* IDE primary base */
271.1Sbjh21#define UPC_PORT_IDECTLBASE    	0x3f6 /* IDE secondary base */
281.1Sbjh21#define UPC_PORT_FDCBASE	0x3f4 /* FDC base address (82C721 only) */
291.1Sbjh21#define UPC_PORT_GAME		0x201 /* -GAMECS active */
301.1Sbjh21
311.1Sbjh21/* Configuration magic sequences */
321.1Sbjh21
331.1Sbjh21#define UPC_CFGMAGIC_ENTER	0x55 /* Write twice to enter config mode. */
341.1Sbjh21#define UPC_CFGMAGIC_EXIT	0xaa /* Write once to exit config mode. */
351.1Sbjh21
361.1Sbjh21/* Configuration registers */
371.1Sbjh21#define UPC_CFGADDR_CR0		0x00 /* Configuration Register 0 */
381.1Sbjh21#define UPC_CFGADDR_CR1		0x01 /* Configuration Register 1 */
391.1Sbjh21#define UPC_CFGADDR_CR2		0x02 /* Configuration Register 2 */
401.1Sbjh21#define UPC_CFGADDR_CR3		0x03 /* Configuration Register 3 */
411.1Sbjh21#define UPC_CFGADDR_CR4		0x04 /* Configuration Register 4 */
421.1Sbjh21
431.1Sbjh21/* Configuration register 0 */
441.1Sbjh21#define UPC_CR0_VALID		0x80 /* Device has been configured */
451.1Sbjh21#define UPC_CR0_OSC_MASK	0x60 /* Oscillator control */
461.1Sbjh21#define UPC_CR0_OSC_ON		0x00 /* Oscillator always on */
471.1Sbjh21#define UPC_CR0_OSC_PWRGD	0x20 /* Oscillator on when PWRGD */
481.1Sbjh21#define UPC_CR0_OSC_OFF		0x60 /* Oscillator always off */
491.1Sbjh21#define UPC_CR0_FDC_ENABLE	0x10 /* FDC enabled */
501.1Sbjh21#define UPC_CR0_FDC_ON		0x08 /* FDC powered */
511.1Sbjh21#define UPC_CR0_IDE_AT		0x02 /* IDE controller is AT type */
521.1Sbjh21#define UPC_CR0_IDE_ENABLE	0x01 /* IDE controller enabled */
531.1Sbjh21
541.1Sbjh21/* Configuration register 1 */
551.1Sbjh21#define UPC_CR1_READ_ENABLE	0x80 /* Enable reading of config regs */
561.1Sbjh21#define UPC_CR1_COM34_MASK	0x60 /* COM3/COM4 addresses */
571.1Sbjh21#define UPC_CR1_COM34_338_238	0x00 /* COM3 = 0x338; COM4 = 0x238 */
581.1Sbjh21#define UPC_CR1_COM34_3E8_2E8	0x20 /* COM3 = 0x3E8; COM4 = 0x2E8 */
591.1Sbjh21#define UPC_CR1_COM34_2E8_2E0	0x40 /* COM3 = 0x2E8; COM4 = 0x2E0 */
601.1Sbjh21#define UPC_CR1_COM34_220_228	0x60 /* COM3 = 0x220; COM4 = 0x228 */
611.1Sbjh21#define UPC_CR1_IRQ_ACTHIGH	0x10 /* IRQ is active-high */
621.1Sbjh21#define UPC_CR1_LPT_BORING	0x08 /* Parallel port is not EPP */
631.1Sbjh21#define UPC_CR1_LPT_ON		0x04 /* Parallel port is powered */
641.1Sbjh21#define UPC_CR1_LPT_MASK	0x03 /* Parallel port address */
651.1Sbjh21#define UPC_CR1_LPT_DISABLE	0x00 /* Parallel port disabled */
661.1Sbjh21#define UPC_CR1_LPT_3BC		0x01 /* Parallel port at 0x3BC */
671.1Sbjh21#define UPC_CR1_LPT_378		0x02 /* Parallel port at 0x378 */
681.1Sbjh21#define UPC_CR1_LPT_278		0x03 /* Parallel port at 0x278 */
691.1Sbjh21
701.1Sbjh21/* Configuration register 2 */
711.1Sbjh21/* I believe 2ndary serial is absent on 82C710 */
721.1Sbjh21#define UPC_CR2_UART2_ON	0x80 /* 2ndary serial powered */
731.1Sbjh21#define UPC_CR2_UART2_ENABLE	0x40 /* 2ndary serial enabled */
741.1Sbjh21#define UPC_CR2_UART2_MASK	0x30 /* 2ndary serial address */
751.1Sbjh21#define UPC_CR2_UART2_3F8	0x00 /* 2ndary serial at 0x3F8 */
761.1Sbjh21#define UPC_CR2_UART2_2F8	0x10 /* 2ndary serial at 0x2F8 */
771.1Sbjh21#define UPC_CR2_UART2_COM3	0x20 /* 2ndary serial at COM3 (see CR1) */
781.1Sbjh21#define UPC_CR2_UART2_COM4	0x30 /* 2ndary serial at COM4 (see CR1) */
791.2Sbjh21#define UPC_CR2_UART1_ON	0x08 /* primary serial powered */
801.2Sbjh21#define UPC_CR2_UART1_ENABLE	0x04 /* primary serial enabled */
811.2Sbjh21#define UPC_CR2_UART1_MASK	0x03 /* primary serial address */
821.1Sbjh21#define UPC_CR2_UART1_3F8	0x00 /* primary serial at 0x3F8 */
831.2Sbjh21#define UPC_CR2_UART1_2F8	0x01 /* primary serial at 0x2F8 */
841.2Sbjh21#define UPC_CR2_UART1_COM3	0x02 /* primary serial at COM3 (see CR1) */
851.2Sbjh21#define UPC_CR2_UART1_COM4	0x03 /* primary serial at COM4 (see CR1) */
861.1Sbjh21
871.1Sbjh21/* Configuration register 3 */
881.1Sbjh21#define UPC_CR3_UART2_TEST	0x80 /* 2ndary serial test mode */
891.1Sbjh21#define UPC_CR3_UART1_TEST	0x40 /* primary serial test mode */
901.1Sbjh21#define UPC_CR3_FDC_TEST_MASK	0x30 /* FDC test modes */
911.1Sbjh21#define UPC_CR3_FDC_TEST_NORMAL	0x00 /* FDC normal mode */
921.1Sbjh21
931.1Sbjh21/* Configuration register 4 (82C721 only) */
941.1Sbjh21#define UPC_CR4_UART2_DIV13	0x01 /* Use normal (cf MIDI) clock for UART2 */
95