00001
00002
00003
00004 #include <linux/kernel.h>
00005
00006 #include <linux/malloc.h>
00007 #include <linux/mm.h>
00008 #include <linux/init.h>
00009 #include <linux/delay.h>
00010
00011 #include <asm/hwrpb.h>
00012 #include <asm/io.h>
00013 #include <asm/segment.h>
00014
00015 #if 0
00016 # define DBG_DEVS(args) printk args
00017 #else
00018 # define DBG_DEVS(args)
00019 #endif
00020
00021 #define KB 1024
00022 #define MB (1024*KB)
00023 #define GB (1024*MB)
00024
00025 #define SMC_DEBUG 0
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 #ifndef __SMC37c669_H
00063 #define __SMC37c669_H
00064
00065
00066
00067
00068
00069
00070
00071 #define SMC37c669_DEVICE_IRQ_MASK 0x80000000
00072 #define SMC37c669_DEVICE_IRQ( __i ) \
00073 ((SMC37c669_DEVICE_IRQ_MASK) | (__i))
00074 #define SMC37c669_IS_DEVICE_IRQ(__i) \
00075 (((__i) & (SMC37c669_DEVICE_IRQ_MASK)) == (SMC37c669_DEVICE_IRQ_MASK))
00076 #define SMC37c669_RAW_DEVICE_IRQ(__i) \
00077 ((__i) & ~(SMC37c669_DEVICE_IRQ_MASK))
00078
00079
00080
00081
00082
00083
00084
00085 #define SMC37c669_DEVICE_DRQ_MASK 0x80000000
00086 #define SMC37c669_DEVICE_DRQ(__d) \
00087 ((SMC37c669_DEVICE_DRQ_MASK) | (__d))
00088 #define SMC37c669_IS_DEVICE_DRQ(__d) \
00089 (((__d) & (SMC37c669_DEVICE_DRQ_MASK)) == (SMC37c669_DEVICE_DRQ_MASK))
00090 #define SMC37c669_RAW_DEVICE_DRQ(__d) \
00091 ((__d) & ~(SMC37c669_DEVICE_DRQ_MASK))
00092
00093 #define SMC37c669_DEVICE_ID 0x3
00094
00095
00096
00097
00098 #define SERIAL_0 0
00099 #define SERIAL_1 1
00100 #define PARALLEL_0 2
00101 #define FLOPPY_0 3
00102 #define IDE_0 4
00103 #define NUM_FUNCS 5
00104
00105
00106
00107
00108 #define COM1_BASE 0x3F8
00109 #define COM1_IRQ 4
00110 #define COM2_BASE 0x2F8
00111 #define COM2_IRQ 3
00112 #define PARP_BASE 0x3BC
00113 #define PARP_IRQ 7
00114 #define PARP_DRQ 3
00115 #define FDC_BASE 0x3F0
00116 #define FDC_IRQ 6
00117 #define FDC_DRQ 2
00118
00119
00120
00121
00122 #define SMC37c669_CONFIG_ON_KEY 0x55
00123 #define SMC37c669_CONFIG_OFF_KEY 0xAA
00124
00125
00126
00127
00128 #define SMC37c669_DEVICE_IRQ_A ( SMC37c669_DEVICE_IRQ( 0x01 ) )
00129 #define SMC37c669_DEVICE_IRQ_B ( SMC37c669_DEVICE_IRQ( 0x02 ) )
00130 #define SMC37c669_DEVICE_IRQ_C ( SMC37c669_DEVICE_IRQ( 0x03 ) )
00131 #define SMC37c669_DEVICE_IRQ_D ( SMC37c669_DEVICE_IRQ( 0x04 ) )
00132 #define SMC37c669_DEVICE_IRQ_E ( SMC37c669_DEVICE_IRQ( 0x05 ) )
00133 #define SMC37c669_DEVICE_IRQ_F ( SMC37c669_DEVICE_IRQ( 0x06 ) )
00134
00135 #define SMC37c669_DEVICE_IRQ_H ( SMC37c669_DEVICE_IRQ( 0x08 ) )
00136
00137
00138
00139
00140 #define SMC37c669_DEVICE_DRQ_A ( SMC37c669_DEVICE_DRQ( 0x01 ) )
00141 #define SMC37c669_DEVICE_DRQ_B ( SMC37c669_DEVICE_DRQ( 0x02 ) )
00142 #define SMC37c669_DEVICE_DRQ_C ( SMC37c669_DEVICE_DRQ( 0x03 ) )
00143
00144
00145
00146
00147 #define SMC37c669_CR00_INDEX 0x00
00148 #define SMC37c669_CR01_INDEX 0x01
00149 #define SMC37c669_CR02_INDEX 0x02
00150 #define SMC37c669_CR03_INDEX 0x03
00151 #define SMC37c669_CR04_INDEX 0x04
00152 #define SMC37c669_CR05_INDEX 0x05
00153 #define SMC37c669_CR06_INDEX 0x06
00154 #define SMC37c669_CR07_INDEX 0x07
00155 #define SMC37c669_CR08_INDEX 0x08
00156 #define SMC37c669_CR09_INDEX 0x09
00157 #define SMC37c669_CR0A_INDEX 0x0A
00158 #define SMC37c669_CR0B_INDEX 0x0B
00159 #define SMC37c669_CR0C_INDEX 0x0C
00160 #define SMC37c669_CR0D_INDEX 0x0D
00161 #define SMC37c669_CR0E_INDEX 0x0E
00162 #define SMC37c669_CR0F_INDEX 0x0F
00163 #define SMC37c669_CR10_INDEX 0x10
00164 #define SMC37c669_CR11_INDEX 0x11
00165 #define SMC37c669_CR12_INDEX 0x12
00166 #define SMC37c669_CR13_INDEX 0x13
00167 #define SMC37c669_CR14_INDEX 0x14
00168 #define SMC37c669_CR15_INDEX 0x15
00169 #define SMC37c669_CR16_INDEX 0x16
00170 #define SMC37c669_CR17_INDEX 0x17
00171 #define SMC37c669_CR18_INDEX 0x18
00172 #define SMC37c669_CR19_INDEX 0x19
00173 #define SMC37c669_CR1A_INDEX 0x1A
00174 #define SMC37c669_CR1B_INDEX 0x1B
00175 #define SMC37c669_CR1C_INDEX 0x1C
00176 #define SMC37c669_CR1D_INDEX 0x1D
00177 #define SMC37c669_CR1E_INDEX 0x1E
00178 #define SMC37c669_CR1F_INDEX 0x1F
00179 #define SMC37c669_CR20_INDEX 0x20
00180 #define SMC37c669_CR21_INDEX 0x21
00181 #define SMC37c669_CR22_INDEX 0x22
00182 #define SMC37c669_CR23_INDEX 0x23
00183 #define SMC37c669_CR24_INDEX 0x24
00184 #define SMC37c669_CR25_INDEX 0x25
00185 #define SMC37c669_CR26_INDEX 0x26
00186 #define SMC37c669_CR27_INDEX 0x27
00187 #define SMC37c669_CR28_INDEX 0x28
00188 #define SMC37c669_CR29_INDEX 0x29
00189
00190
00191
00192
00193 #define SMC37c669_DEVICE_ID_INDEX SMC37c669_CR0D_INDEX
00194 #define SMC37c669_DEVICE_REVISION_INDEX SMC37c669_CR0E_INDEX
00195 #define SMC37c669_FDC_BASE_ADDRESS_INDEX SMC37c669_CR20_INDEX
00196 #define SMC37c669_IDE_BASE_ADDRESS_INDEX SMC37c669_CR21_INDEX
00197 #define SMC37c669_IDE_ALTERNATE_ADDRESS_INDEX SMC37c669_CR22_INDEX
00198 #define SMC37c669_PARALLEL0_BASE_ADDRESS_INDEX SMC37c669_CR23_INDEX
00199 #define SMC37c669_SERIAL0_BASE_ADDRESS_INDEX SMC37c669_CR24_INDEX
00200 #define SMC37c669_SERIAL1_BASE_ADDRESS_INDEX SMC37c669_CR25_INDEX
00201 #define SMC37c669_PARALLEL_FDC_DRQ_INDEX SMC37c669_CR26_INDEX
00202 #define SMC37c669_PARALLEL_FDC_IRQ_INDEX SMC37c669_CR27_INDEX
00203 #define SMC37c669_SERIAL_IRQ_INDEX SMC37c669_CR28_INDEX
00204
00205
00206
00207
00208
00209
00210
00211 typedef struct _SMC37c669_CONFIG_REGS {
00212 unsigned char index_port;
00213 unsigned char data_port;
00214 } SMC37c669_CONFIG_REGS;
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234 typedef union _SMC37c669_CR00 {
00235 unsigned char as_uchar;
00236 struct {
00237 unsigned ide_en : 2;
00238 unsigned reserved1 : 1;
00239 unsigned fdc_pwr : 1;
00240 unsigned reserved2 : 3;
00241 unsigned valid : 1;
00242 } by_field;
00243 } SMC37c669_CR00;
00244
00245
00246
00247
00248 typedef union _SMC37c669_CR01 {
00249 unsigned char as_uchar;
00250 struct {
00251 unsigned reserved1 : 2;
00252 unsigned ppt_pwr : 1;
00253 unsigned ppt_mode : 1;
00254 unsigned reserved2 : 1;
00255 unsigned reserved3 : 2;
00256 unsigned lock_crx: 1;
00257 } by_field;
00258 } SMC37c669_CR01;
00259
00260
00261
00262
00263 typedef union _SMC37c669_CR02 {
00264 unsigned char as_uchar;
00265 struct {
00266 unsigned reserved1 : 3;
00267 unsigned uart1_pwr : 1;
00268 unsigned reserved2 : 3;
00269 unsigned uart2_pwr : 1;
00270 } by_field;
00271 } SMC37c669_CR02;
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289 typedef union _SMC37c669_CR03 {
00290 unsigned char as_uchar;
00291 struct {
00292 unsigned pwrgd_gamecs : 1;
00293 unsigned fdc_mode2 : 1;
00294 unsigned pin94_0 : 1;
00295 unsigned reserved1 : 1;
00296 unsigned drvden : 1;
00297 unsigned op_mode : 2;
00298 unsigned pin94_1 : 1;
00299 } by_field;
00300 } SMC37c669_CR03;
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345 typedef union _SMC37c669_CR04 {
00346 unsigned char as_uchar;
00347 struct {
00348 unsigned ppt_ext_mode : 2;
00349 unsigned ppt_fdc : 2;
00350 unsigned midi1 : 1;
00351 unsigned midi2 : 1;
00352 unsigned epp_type : 1;
00353 unsigned alt_io : 1;
00354 } by_field;
00355 } SMC37c669_CR04;
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367 typedef union _SMC37c669_CR05 {
00368 unsigned char as_uchar;
00369 struct {
00370 unsigned reserved1 : 2;
00371 unsigned fdc_dma_mode : 1;
00372 unsigned den_sel : 2;
00373 unsigned swap_drv : 1;
00374 unsigned extx4 : 1;
00375 unsigned reserved2 : 1;
00376 } by_field;
00377 } SMC37c669_CR05;
00378
00379
00380
00381
00382 typedef union _SMC37c669_CR06 {
00383 unsigned char as_uchar;
00384 struct {
00385 unsigned floppy_a : 2;
00386 unsigned floppy_b : 2;
00387 unsigned floppy_c : 2;
00388 unsigned floppy_d : 2;
00389 } by_field;
00390 } SMC37c669_CR06;
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403 typedef union _SMC37c669_CR07 {
00404 unsigned char as_uchar;
00405 struct {
00406 unsigned floppy_boot : 2;
00407 unsigned reserved1 : 2;
00408 unsigned ppt_en : 1;
00409 unsigned uart1_en : 1;
00410 unsigned uart2_en : 1;
00411 unsigned fdc_en : 1;
00412 } by_field;
00413 } SMC37c669_CR07;
00414
00415
00416
00417
00418 typedef union _SMC37c669_CR08 {
00419 unsigned char as_uchar;
00420 struct {
00421 unsigned zero : 4;
00422 unsigned addrx7_4 : 4;
00423 } by_field;
00424 } SMC37c669_CR08;
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436 typedef union _SMC37c669_CR09 {
00437 unsigned char as_uchar;
00438 struct {
00439 unsigned adra8 : 3;
00440 unsigned reserved1 : 3;
00441 unsigned adrx_config : 2;
00442 } by_field;
00443 } SMC37c669_CR09;
00444
00445
00446
00447
00448 typedef union _SMC37c669_CR0A {
00449 unsigned char as_uchar;
00450 struct {
00451 unsigned ecp_fifo_threshold : 4;
00452 unsigned reserved1 : 4;
00453 } by_field;
00454 } SMC37c669_CR0A;
00455
00456
00457
00458
00459 typedef union _SMC37c669_CR0B {
00460 unsigned char as_uchar;
00461 struct {
00462 unsigned fdd0_drtx : 2;
00463 unsigned fdd1_drtx : 2;
00464 unsigned fdd2_drtx : 2;
00465 unsigned fdd3_drtx : 2;
00466 } by_field;
00467 } SMC37c669_CR0B;
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480 typedef union _SMC37c669_CR0C {
00481 unsigned char as_uchar;
00482 struct {
00483 unsigned uart2_rcv_polarity : 1;
00484 unsigned uart2_xmit_polarity : 1;
00485 unsigned uart2_duplex : 1;
00486 unsigned uart2_mode : 3;
00487 unsigned uart1_speed : 1;
00488 unsigned uart2_speed : 1;
00489 } by_field;
00490 } SMC37c669_CR0C;
00491
00492
00493
00494
00495
00496
00497 typedef union _SMC37c669_CR0D {
00498 unsigned char as_uchar;
00499 struct {
00500 unsigned device_id : 8;
00501 } by_field;
00502 } SMC37c669_CR0D;
00503
00504
00505
00506
00507
00508
00509 typedef union _SMC37c669_CR0E {
00510 unsigned char as_uchar;
00511 struct {
00512 unsigned device_rev : 8;
00513 } by_field;
00514 } SMC37c669_CR0E;
00515
00516
00517
00518
00519 typedef union _SMC37c669_CR0F {
00520 unsigned char as_uchar;
00521 struct {
00522 unsigned test0 : 1;
00523 unsigned test1 : 1;
00524 unsigned test2 : 1;
00525 unsigned test3 : 1;
00526 unsigned test4 : 1;
00527 unsigned test5 : 1;
00528 unsigned test6 : 1;
00529 unsigned test7 : 1;
00530 } by_field;
00531 } SMC37c669_CR0F;
00532
00533
00534
00535
00536 typedef union _SMC37c669_CR10 {
00537 unsigned char as_uchar;
00538 struct {
00539 unsigned reserved1 : 3;
00540 unsigned pll_gain : 1;
00541 unsigned pll_stop : 1;
00542 unsigned ace_stop : 1;
00543 unsigned pll_clock_ctrl : 1;
00544 unsigned ir_test : 1;
00545 } by_field;
00546 } SMC37c669_CR10;
00547
00548
00549
00550
00551 typedef union _SMC37c669_CR11 {
00552 unsigned char as_uchar;
00553 struct {
00554 unsigned ir_loopback : 1;
00555 unsigned test_10ms : 1;
00556 unsigned reserved1 : 6;
00557 } by_field;
00558 } SMC37c669_CR11;
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574 typedef union _SMC37c66_CR1E {
00575 unsigned char as_uchar;
00576 struct {
00577 unsigned gamecs_config: 2;
00578 unsigned gamecs_addr9_4 : 6;
00579 } by_field;
00580 } SMC37c669_CR1E;
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598 typedef union _SMC37c669_CR1F {
00599 unsigned char as_uchar;
00600 struct {
00601 unsigned fdd0_drive_type : 2;
00602 unsigned fdd1_drive_type : 2;
00603 unsigned fdd2_drive_type : 2;
00604 unsigned fdd3_drive_type : 2;
00605 } by_field;
00606 } SMC37c669_CR1F;
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616 typedef union _SMC37c669_CR20 {
00617 unsigned char as_uchar;
00618 struct {
00619 unsigned zero : 2;
00620 unsigned addr9_4 : 6;
00621 } by_field;
00622 } SMC37c669_CR20;
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632 typedef union _SMC37c669_CR21 {
00633 unsigned char as_uchar;
00634 struct {
00635 unsigned zero : 2;
00636 unsigned addr9_4 : 6;
00637 } by_field;
00638 } SMC37c669_CR21;
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648 typedef union _SMC37c669_CR22 {
00649 unsigned char as_uchar;
00650 struct {
00651 unsigned zero : 2;
00652 unsigned addr9_4 : 6;
00653 } by_field;
00654 } SMC37c669_CR22;
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666 typedef union _SMC37c669_CR23 {
00667 unsigned char as_uchar;
00668 struct {
00669 unsigned addr9_2 : 8;
00670 } by_field;
00671 } SMC37c669_CR23;
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681 typedef union _SMC37c669_CR24 {
00682 unsigned char as_uchar;
00683 struct {
00684 unsigned zero : 1;
00685 unsigned addr9_3 : 7;
00686 } by_field;
00687 } SMC37c669_CR24;
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697 typedef union _SMC37c669_CR25 {
00698 unsigned char as_uchar;
00699 struct {
00700 unsigned zero : 1;
00701 unsigned addr9_3 : 7;
00702 } by_field;
00703 } SMC37c669_CR25;
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719 typedef union _SMC37c669_CR26 {
00720 unsigned char as_uchar;
00721 struct {
00722 unsigned ppt_drq : 4;
00723 unsigned fdc_drq : 4;
00724 } by_field;
00725 } SMC37c669_CR26;
00726
00727
00728
00729
00730
00731
00732
00733
00734
00735
00736
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748 typedef union _SMC37c669_CR27 {
00749 unsigned char as_uchar;
00750 struct {
00751 unsigned ppt_irq : 4;
00752 unsigned fdc_irq : 4;
00753 } by_field;
00754 } SMC37c669_CR27;
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782 typedef union _SMC37c669_CR28 {
00783 unsigned char as_uchar;
00784 struct {
00785 unsigned uart2_irq : 4;
00786 unsigned uart1_irq : 4;
00787 } by_field;
00788 } SMC37c669_CR28;
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811 typedef union _SMC37c669_CR29 {
00812 unsigned char as_uchar;
00813 struct {
00814 unsigned irqin_irq : 4;
00815 unsigned reserved1 : 4;
00816 } by_field;
00817 } SMC37c669_CR29;
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834 typedef SMC37c669_CR0D SMC37c669_DEVICE_ID_REGISTER;
00835 typedef SMC37c669_CR0E SMC37c669_DEVICE_REVISION_REGISTER;
00836 typedef SMC37c669_CR20 SMC37c669_FDC_BASE_ADDRESS_REGISTER;
00837 typedef SMC37c669_CR21 SMC37c669_IDE_ADDRESS_REGISTER;
00838 typedef SMC37c669_CR23 SMC37c669_PARALLEL_BASE_ADDRESS_REGISTER;
00839 typedef SMC37c669_CR24 SMC37c669_SERIAL_BASE_ADDRESS_REGISTER;
00840 typedef SMC37c669_CR26 SMC37c669_PARALLEL_FDC_DRQ_REGISTER;
00841 typedef SMC37c669_CR27 SMC37c669_PARALLEL_FDC_IRQ_REGISTER;
00842 typedef SMC37c669_CR28 SMC37c669_SERIAL_IRQ_REGISTER;
00843
00844
00845
00846
00847 typedef struct _SMC37c669_IRQ_TRANSLATION_ENTRY {
00848 int device_irq;
00849 int isa_irq;
00850 } SMC37c669_IRQ_TRANSLATION_ENTRY;
00851
00852
00853
00854
00855 typedef struct _SMC37c669_DRQ_TRANSLATION_ENTRY {
00856 int device_drq;
00857 int isa_drq;
00858 } SMC37c669_DRQ_TRANSLATION_ENTRY;
00859
00860
00861
00862
00863
00864 SMC37c669_CONFIG_REGS *SMC37c669_detect(
00865 int
00866 );
00867
00868 unsigned int SMC37c669_enable_device(
00869 unsigned int func
00870 );
00871
00872 unsigned int SMC37c669_disable_device(
00873 unsigned int func
00874 );
00875
00876 unsigned int SMC37c669_configure_device(
00877 unsigned int func,
00878 int port,
00879 int irq,
00880 int drq
00881 );
00882
00883 void SMC37c669_display_device_info(
00884 void
00885 );
00886
00887 #endif
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936 #if 0
00937
00938 #include "cp$inc:platform_io.h"
00939
00940 #include "cp$src:common.h"
00941 #include "cp$inc:prototypes.h"
00942 #include "cp$src:kernel_def.h"
00943 #include "cp$src:msg_def.h"
00944 #include "cp$src:smcc669_def.h"
00945
00946 #include "cp$src:platform.h"
00947 #endif
00948
00949 #ifndef TRUE
00950 #define TRUE 1
00951 #endif
00952 #ifndef FALSE
00953 #define FALSE 0
00954 #endif
00955
00956 #define wb( _x_, _y_ ) outb( _y_, (unsigned int)((unsigned long)_x_) )
00957 #define rb( _x_ ) inb( (unsigned int)((unsigned long)_x_) )
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
00969 static struct DEVICE_CONFIG {
00970 unsigned int port1;
00971 unsigned int port2;
00972 unsigned int irq;
00973 unsigned int drq;
00974 } local_config [NUM_FUNCS];
00975
00976
00977
00978
00979 static unsigned long SMC37c669_Addresses[] __initdata =
00980 {
00981 0x3F0UL,
00982 0x370UL,
00983 0UL
00984 };
00985
00986
00987
00988
00989 static SMC37c669_CONFIG_REGS *SMC37c669 __initdata = NULL;
00990
00991
00992
00993
00994
00995
00996
00997
00998 static SMC37c669_IRQ_TRANSLATION_ENTRY *SMC37c669_irq_table __initdata = 0;
00999
01000
01001
01002
01003
01004 static SMC37c669_IRQ_TRANSLATION_ENTRY SMC37c669_default_irq_table[]
01005 __initdata =
01006 {
01007 { SMC37c669_DEVICE_IRQ_A, -1 },
01008 { SMC37c669_DEVICE_IRQ_B, -1 },
01009 { SMC37c669_DEVICE_IRQ_C, 7 },
01010 { SMC37c669_DEVICE_IRQ_D, 6 },
01011 { SMC37c669_DEVICE_IRQ_E, 4 },
01012 { SMC37c669_DEVICE_IRQ_F, 3 },
01013 { SMC37c669_DEVICE_IRQ_H, -1 },
01014 { -1, -1 }
01015 };
01016
01017
01018
01019
01020
01021 static SMC37c669_IRQ_TRANSLATION_ENTRY SMC37c669_monet_irq_table[]
01022 __initdata =
01023 {
01024 { SMC37c669_DEVICE_IRQ_A, -1 },
01025 { SMC37c669_DEVICE_IRQ_B, -1 },
01026 { SMC37c669_DEVICE_IRQ_C, 6 },
01027 { SMC37c669_DEVICE_IRQ_D, 7 },
01028 { SMC37c669_DEVICE_IRQ_E, 4 },
01029 { SMC37c669_DEVICE_IRQ_F, 3 },
01030 { SMC37c669_DEVICE_IRQ_H, -1 },
01031 { -1, -1 }
01032 };
01033
01034 static SMC37c669_IRQ_TRANSLATION_ENTRY *SMC37c669_irq_tables[] __initdata =
01035 {
01036 SMC37c669_default_irq_table,
01037 SMC37c669_monet_irq_table
01038 };
01039
01040
01041
01042
01043
01044
01045
01046
01047 static SMC37c669_DRQ_TRANSLATION_ENTRY *SMC37c669_drq_table __initdata = 0;
01048
01049
01050
01051
01052
01053 static SMC37c669_DRQ_TRANSLATION_ENTRY SMC37c669_default_drq_table[]
01054 __initdata =
01055 {
01056 { SMC37c669_DEVICE_DRQ_A, 2 },
01057 { SMC37c669_DEVICE_DRQ_B, 3 },
01058 { SMC37c669_DEVICE_DRQ_C, -1 },
01059 { -1, -1 }
01060 };
01061
01062
01063
01064
01065
01066 static unsigned int SMC37c669_is_device_enabled(
01067 unsigned int func
01068 );
01069
01070 #if 0
01071 static unsigned int SMC37c669_get_device_config(
01072 unsigned int func,
01073 int *port,
01074 int *irq,
01075 int *drq
01076 );
01077 #endif
01078
01079 static void SMC37c669_config_mode(
01080 unsigned int enable
01081 );
01082
01083 static unsigned char SMC37c669_read_config(
01084 unsigned char index
01085 );
01086
01087 static void SMC37c669_write_config(
01088 unsigned char index,
01089 unsigned char data
01090 );
01091
01092 static void SMC37c669_init_local_config( void );
01093
01094 static struct DEVICE_CONFIG *SMC37c669_get_config(
01095 unsigned int func
01096 );
01097
01098 static int SMC37c669_xlate_irq(
01099 unsigned int irq
01100 );
01101
01102 static int SMC37c669_xlate_drq(
01103 unsigned int drq
01104 );
01105
01106 #if 0
01107
01108
01109
01110
01111 extern struct LOCK spl_atomic;
01112
01113
01114
01115
01116
01117
01118 extern spinlock(
01119 struct LOCK *spl
01120 );
01121
01122 extern spinunlock(
01123 struct LOCK *spl
01124 );
01125
01126
01127 int allocinode(
01128 char *name,
01129 int can_create,
01130 struct INODE **ipp
01131 );
01132
01133 extern int null_procedure( void );
01134
01135 int smcc669_init( void );
01136 int smcc669_open( struct FILE *fp, char *info, char *next, char *mode );
01137 int smcc669_read( struct FILE *fp, int size, int number, unsigned char *buf );
01138 int smcc669_write( struct FILE *fp, int size, int number, unsigned char *buf );
01139 int smcc669_close( struct FILE *fp );
01140
01141 struct DDB smc_ddb = {
01142 "smc",
01143 smcc669_read,
01144 smcc669_write,
01145 smcc669_open,
01146 smcc669_close,
01147 null_procedure,
01148 null_procedure,
01149 null_procedure,
01150 null_procedure,
01151 null_procedure,
01152 0,
01153 1,
01154 0,
01155 0,
01156 0,
01157 0,
01158 0,
01159 0,
01160 };
01161 #endif
01162
01163 #define spinlock(x)
01164 #define spinunlock(x)
01165
01166
01167