• Home
  • Raw
  • Download

Lines Matching +full:irq +full:- +full:device

58  *	er	28-Jan-1997	Initial Entry
65 ** Macros for handling device IRQs
67 ** The mask acts as a flag used in mapping actual ISA IRQs (0 - 15)
68 ** to device IRQs (A - H).
79 ** Macros for handling device DRQs
82 ** channels to device DMA channels (A - C).
95 ** SMC37c669 Device Function Definitions
105 ** Default Device Function Mappings
125 ** SMC 37c669 Device IRQs
137 ** SMC 37c669 Device DMA Channel Definitions
216 ** CR00 - default value 0x28
219 ** 0x - 30ua pull-ups on nIDEEN, nHDCS0, NHDCS1
220 ** 11 - IRQ_H available as IRQ output,
222 ** 10 - nIDEEN, nHDCS0, nHDCS1 used to control IDE
245 ** CR01 - default value 0x9C
255 unsigned lock_crx: 1; /* Lock CR00 - CR18 */
260 ** CR02 - default value 0x88
273 ** CR03 - default value 0x78
276 ** ------- ------- ------
282 ** ------- ------- -------
295 unsigned drvden : 1; /* 1 = high, 0 - output */
302 ** CR04 - default value 0x00
306 ** 00 - Standard and Bidirectional
307 ** 01 - EPP mode and SPP
308 ** 10 - ECP mode
313 ** 11 - ECP mode and EPP mode
322 ** 00 - Normal
323 ** 01 - PPFD1
324 ** 10 - PPFD2
325 ** 11 - Reserved
337 ** 0 - Use pins IRRX, IRTX
338 ** 1 - Use pins IRRX2, IRTX2
357 ** CR05 - default value 0x00
360 ** 00 - Densel output normal
361 ** 01 - Reserved
362 ** 10 - Densel output 1
363 ** 11 - Densel output 0
370 unsigned fdc_dma_mode : 1; /* 0 = burst, 1 = non-burst */
379 ** CR06 - default value 0xFF
392 ** CR07 - default value 0x00
395 ** 0 - Auto Powerdown disabled (default)
396 ** 1 - Auto Powerdown enabled
415 ** CR08 - default value 0x00
426 ** CR09 - default value 0x00
429 ** 00 - ADRx disabled
430 ** 01 - 1 byte decode A<3:0> = 0000b
431 ** 10 - 8 byte block decode A<3:0> = 0XXXb
432 ** 11 - 16 byte block decode A<3:0> = XXXXb
445 ** CR0A - default value 0x00
456 ** CR0B - default value 0x00
469 ** CR0C - default value 0x00
472 ** 000 - Standard (default)
473 ** 001 - IrDA (HPSIR)
474 ** 010 - Amplitude Shift Keyed IR @500 KHz
475 ** 011 - Reserved
476 ** 1xx - Reserved
492 ** CR0D - default value 0x03
494 ** Device ID Register - read only
504 ** CR0E - default value 0x02
506 ** Device Revision Register - read only
516 ** CR0F - default value 0x00
521 unsigned test0 : 1; /* Reserved - set to 0 */
522 unsigned test1 : 1; /* Reserved - set to 0 */
523 unsigned test2 : 1; /* Reserved - set to 0 */
524 unsigned test3 : 1; /* Reserved - set t0 0 */
525 unsigned test4 : 1; /* Reserved - set to 0 */
526 unsigned test5 : 1; /* Reserved - set t0 0 */
527 unsigned test6 : 1; /* Reserved - set t0 0 */
528 unsigned test7 : 1; /* Reserved - set to 0 */
533 ** CR10 - default value 0x00
548 ** CR11 - default value 0x00
560 ** CR12 - CR1D are reserved registers
564 ** CR1E - default value 0x80
567 ** 00 - GAMECS disabled
568 ** 01 - 1 byte decode ADR<3:0> = 0001b
569 ** 10 - 8 byte block decode ADR<3:0> = 0XXXb
570 ** 11 - 16 byte block decode ADR<3:0> = XXXXb
582 ** CR1F - default value 0x00
585 ** --- --- ------- ------- ----------
588 ** 2/1.6/1 MB 3.5" (3-mode)
594 ** pins - DRVDEN0 and DRVDEN1.
608 ** CR20 - default value 0x3C
611 ** - To disable this decode set Addr<9:8> = 0
612 ** - A<10> = 0, A<3:0> = 0XXXb to access.
624 ** CR21 - default value 0x3C
627 ** - To disable this decode set Addr<9:8> = 0
628 ** - A<10> = 0, A<3:0> = 0XXXb to access.
640 ** CR22 - default value 0x3D
643 ** - To disable this decode set Addr<9:8> = 0
644 ** - A<10> = 0, A<3:0> = 0110b to access.
656 ** CR23 - default value 0x00
659 ** - To disable this decode set Addr<9:8> = 0
660 ** - A<10> = 0 to access.
661 ** - If EPP is enabled, A<2:0> = XXXb to access.
673 ** CR24 - default value 0x00
676 ** - To disable this decode set Addr<9:8> = 0
677 ** - A<10> = 0, A<2:0> = XXXb to access.
689 ** CR25 - default value 0x00
692 ** - To disable this decode set Addr<9:8> = 0
693 ** - A<10> = 0, A<2:0> = XXXb to access.
705 ** CR26 - default value 0x00
709 ** D3 - D0 DMA
710 ** D7 - D4 Selected
711 ** ------- --------
727 ** CR27 - default value 0x00
729 ** Parallel Port / FDC IRQ Select Register
731 ** D3 - D0 IRQ
732 ** D7 - D4 Selected
733 ** ------- --------
744 ** Any unselected IRQ REQ is in tristate
756 ** CR28 - default value 0x00
758 ** UART IRQ Select Register
760 ** D3 - D0 IRQ
761 ** D7 - D4 Selected
762 ** ------- --------
774 ** Any unselected IRQ REQ is in tristate
776 ** To share an IRQ between UART1 and UART2, set
777 ** UART1 to use the desired IRQ and set UART2 to
790 ** CR29 - default value 0x00
792 ** IRQIN IRQ Select Register
794 ** D3 - D0 IRQ
795 ** D7 - D4 Selected
796 ** ------- --------
807 ** Any unselected IRQ REQ is in tristate
824 ** this we only define 1 alias here - for CR24 - as the serial
830 ** here - for CR21 - as the IDE address register.
844 ** ISA/Device IRQ Translation Table Entry Definition
852 ** ISA/Device DMA Translation Table Entry Definition
878 int irq,
925 * 28-Jan-1997
929 * er 01-May-1997 Fixed pointer conversion errors in
931 * er 28-Jan-1997 Initial version.
933 *--
947 ** Local storage for device configuration information.
950 ** mechanism for enabling/disabling individual device
951 ** functions, other than unmapping the device, local
952 ** storage for device configuration information is
959 int irq; member
974 ** Global Pointer to the Super I/O device
979 ** IRQ Translation Table
981 ** The IRQ translation table is a list of SMC37c669 device
988 ** The following definition is for the default IRQ
994 { SMC37c669_DEVICE_IRQ_A, -1 },
995 { SMC37c669_DEVICE_IRQ_B, -1 },
1000 { SMC37c669_DEVICE_IRQ_H, -1 },
1001 { -1, -1 } /* End of table */
1005 ** The following definition is for the MONET (XP1000) IRQ
1011 { SMC37c669_DEVICE_IRQ_A, -1 },
1012 { SMC37c669_DEVICE_IRQ_B, -1 },
1017 { SMC37c669_DEVICE_IRQ_H, -1 },
1018 { -1, -1 } /* End of table */
1030 ** The DRQ translation table is a list of SMC37c669 device and
1045 { SMC37c669_DEVICE_DRQ_C, -1 },
1046 { -1, -1 } /* End of table */
1061 int *irq,
1086 int irq
1108 ** Returns a pointer to the device if found, otherwise,
1115 **--
1124 ** Initialize the device pointer even though we don't yet know if in SMC37c669_detect()
1126 ** the controller through this device pointer so we need to set it in SMC37c669_detect()
1135 ** Read the device id in SMC37c669_detect()
1143 ** Does the device id match? If so, assume we have found an in SMC37c669_detect()
1148 ** Initialize the IRQ and DRQ translation tables. in SMC37c669_detect()
1155 ** If the platform can't use the IRQ and DRQ defaults set up in this in SMC37c669_detect()
1156 ** file, it should call a platform-specific external routine at this in SMC37c669_detect()
1157 ** point to reset the IRQ and DRQ translation table pointers to point in SMC37c669_detect()
1182 ** address so set the device pointer to NULL. in SMC37c669_detect()
1195 ** This function enables an SMC37c669 device function.
1200 ** Which device function to enable
1204 ** Returns TRUE is the device function was enabled, otherwise, FALSE
1212 ** Enabling a device function in the SMC37c669 controller involves
1213 ** setting all of its mappings (port, irq, drq ...). A local
1214 ** "shadow" copy of the device configuration is kept so we can
1218 ** the device function being enabled, even if the device is always
1221 ** function to the update the real device.
1223 **--
1229 ** Put the device into configuration mode in SMC37c669_enable_device()
1236 SMC37c669_SERIAL_IRQ_REGISTER irq; in SMC37c669_enable_device() local
1238 ** Enable the serial 1 IRQ mapping in SMC37c669_enable_device()
1240 irq.as_uchar = in SMC37c669_enable_device()
1243 irq.by_field.uart1_irq = in SMC37c669_enable_device()
1245 SMC37c669_xlate_irq( local_config[ func ].irq ) in SMC37c669_enable_device()
1248 SMC37c669_write_config( SMC37c669_SERIAL_IRQ_INDEX, irq.as_uchar ); in SMC37c669_enable_device()
1265 SMC37c669_SERIAL_IRQ_REGISTER irq; in SMC37c669_enable_device() local
1267 ** Enable the serial 2 IRQ mapping in SMC37c669_enable_device()
1269 irq.as_uchar = in SMC37c669_enable_device()
1272 irq.by_field.uart2_irq = in SMC37c669_enable_device()
1274 SMC37c669_xlate_irq( local_config[ func ].irq ) in SMC37c669_enable_device()
1277 SMC37c669_write_config( SMC37c669_SERIAL_IRQ_INDEX, irq.as_uchar ); in SMC37c669_enable_device()
1294 SMC37c669_PARALLEL_FDC_IRQ_REGISTER irq; in SMC37c669_enable_device() local
1312 ** Enable the parallel port IRQ mapping in SMC37c669_enable_device()
1314 irq.as_uchar = in SMC37c669_enable_device()
1317 irq.by_field.ppt_irq = in SMC37c669_enable_device()
1319 SMC37c669_xlate_irq( local_config[ func ].irq ) in SMC37c669_enable_device()
1324 irq.as_uchar in SMC37c669_enable_device()
1342 SMC37c669_PARALLEL_FDC_IRQ_REGISTER irq; in SMC37c669_enable_device() local
1360 ** Enable the floppy controller IRQ mapping in SMC37c669_enable_device()
1362 irq.as_uchar = in SMC37c669_enable_device()
1365 irq.by_field.fdc_irq = in SMC37c669_enable_device()
1367 SMC37c669_xlate_irq( local_config[ func ].irq ) in SMC37c669_enable_device()
1372 irq.as_uchar in SMC37c669_enable_device()
1427 ** This function disables a device function within the
1437 ** Return TRUE if the device function was disabled, otherwise, FALSE
1445 ** Disabling a function in the SMC37c669 device involves
1446 ** disabling all the function's mappings (port, irq, drq ...).
1447 ** A shadow copy of the device configuration is maintained
1451 **--
1458 ** Put the device into configuration mode in SMC37c669_disable_device()
1465 SMC37c669_SERIAL_IRQ_REGISTER irq; in SMC37c669_disable_device() local
1467 ** Disable the serial 1 IRQ mapping in SMC37c669_disable_device()
1469 irq.as_uchar = in SMC37c669_disable_device()
1472 irq.by_field.uart1_irq = 0; in SMC37c669_disable_device()
1474 SMC37c669_write_config( SMC37c669_SERIAL_IRQ_INDEX, irq.as_uchar ); in SMC37c669_disable_device()
1489 SMC37c669_SERIAL_IRQ_REGISTER irq; in SMC37c669_disable_device() local
1491 ** Disable the serial 2 IRQ mapping in SMC37c669_disable_device()
1493 irq.as_uchar = in SMC37c669_disable_device()
1496 irq.by_field.uart2_irq = 0; in SMC37c669_disable_device()
1498 SMC37c669_write_config( SMC37c669_SERIAL_IRQ_INDEX, irq.as_uchar ); in SMC37c669_disable_device()
1514 SMC37c669_PARALLEL_FDC_IRQ_REGISTER irq; in SMC37c669_disable_device() local
1529 ** Disable the parallel port IRQ mapping in SMC37c669_disable_device()
1531 irq.as_uchar = in SMC37c669_disable_device()
1534 irq.by_field.ppt_irq = 0; in SMC37c669_disable_device()
1538 irq.as_uchar in SMC37c669_disable_device()
1555 SMC37c669_PARALLEL_FDC_IRQ_REGISTER irq; in SMC37c669_disable_device() local
1570 ** Disable the floppy controller IRQ mapping in SMC37c669_disable_device()
1572 irq.as_uchar = in SMC37c669_disable_device()
1575 irq.by_field.fdc_irq = 0; in SMC37c669_disable_device()
1579 irq.as_uchar in SMC37c669_disable_device()
1631 ** This function configures a device function within the
1637 ** Which device function
1642 ** irq:
1643 ** IRQ for the device function to use
1646 ** DMA channel for the device function to use
1650 ** Returns TRUE if the device function was configured,
1660 ** the configuration is also updated. If the device function
1662 ** updated and the actual device function will be updated
1665 **--
1670 int irq, in SMC37c669_configure_device() argument
1683 cp->drq = drq; in SMC37c669_configure_device()
1685 if ( ( irq & ~0xFF ) == 0 ) { in SMC37c669_configure_device()
1686 cp->irq = irq; in SMC37c669_configure_device()
1689 cp->port1 = port; in SMC37c669_configure_device()
1692 ** If the device function is enabled, update the actual in SMC37c669_configure_device()
1693 ** device configuration. in SMC37c669_configure_device()
1708 ** This function determines whether a device function
1714 ** Which device function
1718 ** Returns TRUE if the device function is enabled, otherwise, FALSE
1726 ** To check whether a device is enabled we will only look at
1732 **--
1772 ** If we have a valid device, check base_addr<7:6> to see if the in SMC37c669_is_device_enabled()
1773 ** device is enabled (mapped). in SMC37c669_is_device_enabled()
1797 ** device function within the SMC37c699 Super I/O controller.
1802 ** Which device function
1807 ** irq:
1808 ** IRQ returned
1815 ** Returns TRUE if the device configuration was successfully
1820 ** The data pointed to by the port, irq, and drq parameters
1826 ** The device configuration is fetched from the local shadow
1827 ** copy. Any unused parameters will be set to -1. Any
1831 **--
1836 int *irq,
1842 ** Check for a valid device configuration
1846 *drq = cp->drq;
1849 if ( irq != NULL ) {
1850 *irq = cp->irq;
1854 *port = cp->port1;
1868 ** Super I/O controller's device functions.
1882 **--
1887 printk( " Serial 0: Enabled [ Port 0x%x, IRQ %d ]\n", in SMC37c669_display_device_info()
1889 local_config[ SERIAL_0 ].irq in SMC37c669_display_device_info()
1897 printk( " Serial 1: Enabled [ Port 0x%x, IRQ %d ]\n", in SMC37c669_display_device_info()
1899 local_config[ SERIAL_1 ].irq in SMC37c669_display_device_info()
1907 printk( " Parallel: Enabled [ Port 0x%x, IRQ %d/%d ]\n", in SMC37c669_display_device_info()
1909 local_config[ PARALLEL_0 ].irq, in SMC37c669_display_device_info()
1918 printk( " Floppy Ctrl: Enabled [ Port 0x%x, IRQ %d/%d ]\n", in SMC37c669_display_device_info()
1920 local_config[ FLOPPY_0 ].irq, in SMC37c669_display_device_info()
1929 printk( " IDE 0: Enabled [ Port 0x%x, IRQ %d ]\n", in SMC37c669_display_device_info()
1931 local_config[ IDE_0 ].irq in SMC37c669_display_device_info()
1960 **--
1974 wb( &SMC37c669->index_port, SMC37c669_CONFIG_ON_KEY ); in SMC37c669_config_mode()
1975 wb( &SMC37c669->index_port, SMC37c669_CONFIG_ON_KEY ); in SMC37c669_config_mode()
1979 wb( &SMC37c669->index_port, SMC37c669_CONFIG_OFF_KEY ); in SMC37c669_config_mode()
1989 ** device is already in configuration mode.
2004 **--
2009 wb(&SMC37c669->index_port, index); in SMC37c669_read_config()
2010 return rb(&SMC37c669->data_port); in SMC37c669_read_config()
2019 ** device is already in configuration mode.
2037 **--
2043 wb( &SMC37c669->index_port, index ); in SMC37c669_write_config()
2044 wb( &SMC37c669->data_port, data ); in SMC37c669_write_config()
2052 ** This function initializes the local device
2054 ** that the device is already in configuration
2067 ** Local storage for device configuration information
2070 **--
2097 local_config[SERIAL_0].irq = in SMC37c669_init_local_config()
2110 local_config[SERIAL_1].irq = in SMC37c669_init_local_config()
2133 local_config[PARALLEL_0].irq = in SMC37c669_init_local_config()
2150 local_config[FLOPPY_0].irq = in SMC37c669_init_local_config()
2173 local_config[IDE_0].irq = 14; in SMC37c669_init_local_config()
2182 ** configuration of the requested device function.
2187 ** Which device function
2198 **--
2229 ** IRQs and SMC37c669 device IRQs.
2233 ** irq:
2234 ** The IRQ to translate
2238 ** Returns the translated IRQ, otherwise, returns -1.
2244 **--
2246 static int __init SMC37c669_xlate_irq ( int irq ) in SMC37c669_xlate_irq() argument
2248 int i, translated_irq = -1; in SMC37c669_xlate_irq()
2250 if ( SMC37c669_IS_DEVICE_IRQ( irq ) ) { in SMC37c669_xlate_irq()
2252 ** We are translating a device IRQ to an ISA IRQ in SMC37c669_xlate_irq()
2254 …for ( i = 0; ( SMC37c669_irq_table[i].device_irq != -1 ) || ( SMC37c669_irq_table[i].isa_irq != -1… in SMC37c669_xlate_irq()
2255 if ( irq == SMC37c669_irq_table[i].device_irq ) { in SMC37c669_xlate_irq()
2263 ** We are translating an ISA IRQ to a device IRQ in SMC37c669_xlate_irq()
2265 …for ( i = 0; ( SMC37c669_irq_table[i].isa_irq != -1 ) || ( SMC37c669_irq_table[i].device_irq != -1… in SMC37c669_xlate_irq()
2266 if ( irq == SMC37c669_irq_table[i].isa_irq ) { in SMC37c669_xlate_irq()
2281 ** ISA DMA channels and SMC37c669 device DMA channels.
2290 ** Returns the translated DMA channel, otherwise, returns -1
2296 **--
2300 int i, translated_drq = -1; in SMC37c669_xlate_drq()
2304 ** We are translating a device DMA channel to an ISA DMA channel in SMC37c669_xlate_drq()
2306 …for ( i = 0; ( SMC37c669_drq_table[i].device_drq != -1 ) || ( SMC37c669_drq_table[i].isa_drq != -1… in SMC37c669_xlate_drq()
2315 ** We are translating an ISA DMA channel to a device DMA channel in SMC37c669_xlate_drq()
2317 …for ( i = 0; ( SMC37c669_drq_table[i].isa_drq != -1 ) || ( SMC37c669_drq_table[i].device_drq != -1… in SMC37c669_xlate_drq()
2333 ip->dva = &smc_ddb;
2334 ip->attr = ATTR$M_WRITE | ATTR$M_READ;
2335 ip->len[0] = 0x30;
2336 ip->misc = 0;
2346 ** Allow multiple readers but only one writer. ip->misc keeps track
2349 ip = fp->ip;
2351 if ( fp->mode & ATTR$M_WRITE ) {
2352 if ( ip->misc ) {
2356 ip->misc++;
2361 *fp->offset = xtoi( info );
2371 ip = fp->ip;
2372 if ( fp->mode & ATTR$M_WRITE ) {
2374 ip->misc--;
2390 ip = fp->ip;
2396 if ( !inrange( *fp->offset, 0, ip->len[0] ) )
2398 *buf++ = SMC37c669_read_config( *fp->offset );
2399 *fp->offset += 1;
2415 ip = fp->ip;
2421 if ( !inrange( *fp->offset, 0, ip->len[0] ) )
2423 SMC37c669_write_config( *fp->offset, *buf );
2424 *fp->offset += 1;
2438 printk("-- CR%02x : %02x\n", i, SMC37c669_read_config(i)); in SMC37c669_dump_registers()
2442 * = SMC_init - SMC37c669 Super I/O controller initialization =
2447 * This routine configures and enables device functions on the
2485 -1 in SMC669_Init()
2494 -1 in SMC669_Init()