📄 smc37c669.c
字号:
unsigned test2 : 1; /* Reserved - set to 0 */ unsigned test3 : 1; /* Reserved - set t0 0 */ unsigned test4 : 1; /* Reserved - set to 0 */ unsigned test5 : 1; /* Reserved - set t0 0 */ unsigned test6 : 1; /* Reserved - set t0 0 */ unsigned test7 : 1; /* Reserved - set to 0 */ } by_field;} SMC37c669_CR0F;/*** CR10 - default value 0x00*/typedef union _SMC37c669_CR10 { unsigned char as_uchar; struct { unsigned reserved1 : 3; /* RAZ */ unsigned pll_gain : 1; /* 1 = 3V, 2 = 5V operation */ unsigned pll_stop : 1; /* 1 = stop PLLs */ unsigned ace_stop : 1; /* 1 = stop UART clocks */ unsigned pll_clock_ctrl : 1; /* 0 = 14.318 MHz, 1 = 24 MHz */ unsigned ir_test : 1; /* Enable IR test mode */ } by_field;} SMC37c669_CR10;/*** CR11 - default value 0x00*/typedef union _SMC37c669_CR11 { unsigned char as_uchar; struct { unsigned ir_loopback : 1; /* Internal IR loop back */ unsigned test_10ms : 1; /* Test 10ms autopowerdown FDC timeout */ unsigned reserved1 : 6; /* RAZ */ } by_field;} SMC37c669_CR11;/*** CR12 - CR1D are reserved registers*//*** CR1E - default value 0x80**** GAMECS:** 00 - GAMECS disabled** 01 - 1 byte decode ADR<3:0> = 0001b** 10 - 8 byte block decode ADR<3:0> = 0XXXb** 11 - 16 byte block decode ADR<3:0> = XXXXb***/typedef union _SMC37c66_CR1E { unsigned char as_uchar; struct { unsigned gamecs_config: 2; /* See note above */ unsigned gamecs_addr9_4 : 6; /* GAMECS Addr<9:4> */ } by_field;} SMC37c669_CR1E;/*** CR1F - default value 0x00**** DT0 DT1 DRVDEN0 DRVDEN1 Drive Type** --- --- ------- ------- ----------** 0 0 DENSEL DRATE0 4/2/1 MB 3.5"** 2/1 MB 5.25"** 2/1.6/1 MB 3.5" (3-mode)** 0 1 DRATE1 DRATE0** 1 0 nDENSEL DRATE0 PS/2** 1 1 DRATE0 DRATE1**** Note: DENSEL, DRATE1, and DRATE0 map onto two output** pins - DRVDEN0 and DRVDEN1.***/typedef union _SMC37c669_CR1F { unsigned char as_uchar; struct { unsigned fdd0_drive_type : 2; /* FDD0 drive type */ unsigned fdd1_drive_type : 2; /* FDD1 drive type */ unsigned fdd2_drive_type : 2; /* FDD2 drive type */ unsigned fdd3_drive_type : 2; /* FDD3 drive type */ } by_field;} SMC37c669_CR1F;/*** CR20 - default value 0x3C**** FDC Base Address Register** - To disable this decode set Addr<9:8> = 0** - A<10> = 0, A<3:0> = 0XXXb to access.***/typedef union _SMC37c669_CR20 { unsigned char as_uchar; struct { unsigned zero : 2; /* 0 */ unsigned addr9_4 : 6; /* FDC Addr<9:4> */ } by_field;} SMC37c669_CR20;/*** CR21 - default value 0x3C**** IDE Base Address Register** - To disable this decode set Addr<9:8> = 0** - A<10> = 0, A<3:0> = 0XXXb to access.***/typedef union _SMC37c669_CR21 { unsigned char as_uchar; struct { unsigned zero : 2; /* 0 */ unsigned addr9_4 : 6; /* IDE Addr<9:4> */ } by_field;} SMC37c669_CR21;/*** CR22 - default value 0x3D**** IDE Alternate Status Base Address Register** - To disable this decode set Addr<9:8> = 0** - A<10> = 0, A<3:0> = 0110b to access.***/typedef union _SMC37c669_CR22 { unsigned char as_uchar; struct { unsigned zero : 2; /* 0 */ unsigned addr9_4 : 6; /* IDE Alt Status Addr<9:4> */ } by_field;} SMC37c669_CR22;/*** CR23 - default value 0x00**** Parallel Port Base Address Register** - To disable this decode set Addr<9:8> = 0** - A<10> = 0 to access.** - If EPP is enabled, A<2:0> = XXXb to access.** If EPP is NOT enabled, A<1:0> = XXb to access***/typedef union _SMC37c669_CR23 { unsigned char as_uchar; struct { unsigned addr9_2 : 8; /* Parallel Port Addr<9:2> */ } by_field;} SMC37c669_CR23;/*** CR24 - default value 0x00**** UART1 Base Address Register** - To disable this decode set Addr<9:8> = 0** - A<10> = 0, A<2:0> = XXXb to access.***/typedef union _SMC37c669_CR24 { unsigned char as_uchar; struct { unsigned zero : 1; /* 0 */ unsigned addr9_3 : 7; /* UART1 Addr<9:3> */ } by_field;} SMC37c669_CR24;/*** CR25 - default value 0x00**** UART2 Base Address Register** - To disable this decode set Addr<9:8> = 0** - A<10> = 0, A<2:0> = XXXb to access.***/typedef union _SMC37c669_CR25 { unsigned char as_uchar; struct { unsigned zero : 1; /* 0 */ unsigned addr9_3 : 7; /* UART2 Addr<9:3> */ } by_field;} SMC37c669_CR25;/*** CR26 - default value 0x00**** Parallel Port / FDC DMA Select Register**** D3 - D0 DMA** D7 - D4 Selected** ------- --------** 0000 None** 0001 DMA_A** 0010 DMA_B** 0011 DMA_C***/typedef union _SMC37c669_CR26 { unsigned char as_uchar; struct { unsigned ppt_drq : 4; /* See note above */ unsigned fdc_drq : 4; /* See note above */ } by_field;} SMC37c669_CR26;/*** CR27 - default value 0x00**** Parallel Port / FDC IRQ Select Register**** D3 - D0 IRQ** D7 - D4 Selected** ------- --------** 0000 None** 0001 IRQ_A** 0010 IRQ_B** 0011 IRQ_C** 0100 IRQ_D** 0101 IRQ_E** 0110 IRQ_F** 0111 Reserved** 1000 IRQ_H**** Any unselected IRQ REQ is in tristate***/typedef union _SMC37c669_CR27 { unsigned char as_uchar; struct { unsigned ppt_irq : 4; /* See note above */ unsigned fdc_irq : 4; /* See note above */ } by_field;} SMC37c669_CR27;/*** CR28 - default value 0x00**** UART IRQ Select Register**** D3 - D0 IRQ** D7 - D4 Selected** ------- --------** 0000 None** 0001 IRQ_A** 0010 IRQ_B** 0011 IRQ_C** 0100 IRQ_D** 0101 IRQ_E** 0110 IRQ_F** 0111 Reserved** 1000 IRQ_H** 1111 share with UART1 (only for UART2)**** Any unselected IRQ REQ is in tristate**** To share an IRQ between UART1 and UART2, set** UART1 to use the desired IRQ and set UART2 to** 0xF to enable sharing mechanism.***/typedef union _SMC37c669_CR28 { unsigned char as_uchar; struct { unsigned uart2_irq : 4; /* See note above */ unsigned uart1_irq : 4; /* See note above */ } by_field;} SMC37c669_CR28;/*** CR29 - default value 0x00**** IRQIN IRQ Select Register**** D3 - D0 IRQ** D7 - D4 Selected** ------- --------** 0000 None** 0001 IRQ_A** 0010 IRQ_B** 0011 IRQ_C** 0100 IRQ_D** 0101 IRQ_E** 0110 IRQ_F** 0111 Reserved** 1000 IRQ_H**** Any unselected IRQ REQ is in tristate***/typedef union _SMC37c669_CR29 { unsigned char as_uchar; struct { unsigned irqin_irq : 4; /* See note above */ unsigned reserved1 : 4; /* RAZ */ } by_field;} SMC37c669_CR29;/*** Aliases of Configuration Register formats (should match** the set of index aliases).**** Note that CR24 and CR25 have the same format and are the** base address registers for UART1 and UART2. Because of** this we only define 1 alias here - for CR24 - as the serial** base address register.**** Note that CR21 and CR22 have the same format and are the** base address and alternate status address registers for** the IDE controller. Because of this we only define 1 alias** here - for CR21 - as the IDE address register.***/typedef SMC37c669_CR0D SMC37c669_DEVICE_ID_REGISTER;typedef SMC37c669_CR0E SMC37c669_DEVICE_REVISION_REGISTER;typedef SMC37c669_CR20 SMC37c669_FDC_BASE_ADDRESS_REGISTER;typedef SMC37c669_CR21 SMC37c669_IDE_ADDRESS_REGISTER;typedef SMC37c669_CR23 SMC37c669_PARALLEL_BASE_ADDRESS_REGISTER;typedef SMC37c669_CR24 SMC37c669_SERIAL_BASE_ADDRESS_REGISTER;typedef SMC37c669_CR26 SMC37c669_PARALLEL_FDC_DRQ_REGISTER;typedef SMC37c669_CR27 SMC37c669_PARALLEL_FDC_IRQ_REGISTER;typedef SMC37c669_CR28 SMC37c669_SERIAL_IRQ_REGISTER;/*** ISA/Device IRQ Translation Table Entry Definition*/typedef struct _SMC37c669_IRQ_TRANSLATION_ENTRY { int device_irq; int isa_irq;} SMC37c669_IRQ_TRANSLATION_ENTRY;/*** ISA/Device DMA Translation Table Entry Definition*/typedef struct _SMC37c669_DRQ_TRANSLATION_ENTRY { int device_drq; int isa_drq;} SMC37c669_DRQ_TRANSLATION_ENTRY;/*** External Interface Function Prototype Declarations*/SMC37c669_CONFIG_REGS *SMC37c669_detect( int);unsigned int SMC37c669_enable_device( unsigned int func );unsigned int SMC37c669_disable_device( unsigned int func );unsigned int SMC37c669_configure_device( unsigned int func, int port, int irq, int drq );void SMC37c669_display_device_info( void );#endif /* __SMC37c669_H *//* file: smcc669.c * * Copyright (C) 1997 by * Digital Equipment Corporation, Maynard, Massachusetts. * All rights reserved. * * This software is furnished under a license and may be used and copied * only in accordance of the terms of such license and with the * inclusion of the above copyright notice. This software or any other * copies thereof may not be provided or otherwise made available to any * other person. No title to and ownership of the software is hereby * transferred. * * The information in this software is subject to change without notice * and should not be construed as a commitment by digital equipment * corporation. * * Digital assumes no responsibility for the use or reliability of its * software on equipment which is not supplied by digital. *//* *++ * FACILITY: * * Alpha SRM Console Firmware * * MODULE DESCRIPTION: * * SMC37c669 Super I/O controller configuration routines. * * AUTHORS: * * Eric Rasmussen * * CREATION DATE: * * 28-Jan-1997 * * MODIFICATION HISTORY: * * er 01-May-1997 Fixed pointer conversion errors in * SMC37c669_get_device_config(). * er 28-Jan-1997 Initial version. * *-- */#if 0/* $INCLUDE_OPTIONS$ */#include "cp$inc:platform_io.h"/* $INCLUDE_OPTIONS_END$ */#include "cp$src:common.h"#include "cp$inc:prototypes.h"#include "cp$src:kernel_def.h"#include "cp$src:msg_def.h"#include "cp$src:smcc669_def.h"/* Platform-specific includes */#include "cp$src:platform.h"#endif#ifndef TRUE#define TRUE 1#endif#ifndef FALSE#define FALSE 0#endif#define wb( _x_, _y_ ) outb( _y_, (unsigned int)((unsigned long)_x_) )#define rb( _x_ ) inb( (unsigned int)((unsigned long)_x_) )/*** Local storage for device configuration information.**** Since the SMC37c669 does not provide an explicit** mechanism for enabling/disabling individual device ** functions, other than unmapping the device, local ** storage for device configuration information is ** allocated here for use in implementing our own ** function enable/disable scheme.*/static struct DEVICE_CONFIG { unsigned int port1; unsigned int port2; unsigned int irq; unsigned int drq;} local_config [NUM_FUNCS];/*** List of all possible addresses for the Super I/O chip*/static unsigned long SMC37c669_Addresses[] __initdata = { 0x3F0UL, /* Primary address */ 0x370UL, /* Secondary address */ 0UL /* End of list */ };/*** Global Pointer to the Super I/O device*/static SMC37c669_CONFIG_REGS *SMC37c669 __initdata = NULL;/*** IRQ Translation Table**** The IRQ translation table is a list of SMC37c669 device ** and standard ISA IRQs.***/static SMC37c669_IRQ_TRANSLATION_ENTRY *SMC37c669_irq_table __initdata = 0; /*** The following definition is for the default IRQ ** translation table.*/static SMC37c669_IRQ_TRANSLATION_ENTRY SMC37c669_default_irq_table[]__initdata = { { SMC37c669_DEVICE_IRQ_A, -1 }, { SMC37c669_DEVICE_IRQ_B, -1 }, { SMC37c669_DEVICE_IRQ_C, 7 }, { SMC37c669_DEVICE_IRQ_D, 6 }, { SMC37c669_DEVICE_IRQ_E, 4 }, { SMC37c669_DEVICE_IRQ_F, 3 }, { SMC37c669_DEVICE_IRQ_H, -1 }, { -1, -1 } /* End of table */ };/*** The following definition is for the MONET (XP1000) IRQ ** translation table.*/static SMC37c669_IRQ_TRANSLATION_ENTRY SMC37c669_monet_irq_table[]__initdata = { { SMC37c669_DEVICE_IRQ_A, -1 }, { SMC37c669_DEVICE_IRQ_B, -1 }, { SMC37c669_DEVICE_IRQ_C, 6 }, { SMC37c669_DEVICE_IRQ_D, 7 }, { SMC37c669_DEVICE_IRQ_E, 4 }, { SMC37c669_DEVICE_IRQ_F, 3 }, { SMC37c669_DEVICE_IRQ_H, -1 }, { -1, -1 } /* End of table */ };static SMC37c669_IRQ_TRANSLATION_ENTRY *SMC37c669_irq_tables[] __initdata = { SMC37c669_default_irq_table, SMC37c669_monet_irq_table }; /*** DRQ Translation Table**** The DRQ translation table is a list of SMC37c669 device and** ISA DMA channels.***/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -