? .tmscsim.o.flags ? scsiiom.c.flc ? Rules.make ? tmscsim.c.flc Index: README.tmscsim =================================================================== RCS file: /home/cvsroot/dc390/README.tmscsim,v retrieving revision 2.25.2.5 retrieving revision 2.25.2.6 diff -u -r2.25.2.5 -r2.25.2.6 --- README.tmscsim 2000/09/29 17:32:35 2.25.2.5 +++ README.tmscsim 2000/11/28 22:34:39 2.25.2.6 @@ -131,8 +131,8 @@ * Uniform source code for Linux-2.x.y * Support for dyn. addition/removal of devices via add/remove-single-device (Try: echo "scsi add-single-device C B T U" >/proc/scsi/scsi - C = Controller, B = Bus, T = Target SCSI ID, U = Unit SCSI LUN.) Use - with care! + C = Controller, B = Bus, T = Target SCSI ID, U = Unit SCSI LUN.) + Use with care! * Try to use the partition table for the determination of the mapping @@ -147,7 +147,7 @@ Here's an example: garloff@kurt:/home/garloff > cat /proc/scsi/tmscsim/0 -Tekram DC390/AM53C974 PCI SCSI Host Adapter, Driver Version 2.0e 1999/08/30 +Tekram DC390/AM53C974 PCI SCSI Host Adapter, Driver Version 2.0e7 2000-11-28 SCSI Host Nr 1, AM53C974 Adapter Nr 0 IOPortBase 0xb000, IRQ 10 MaxID 8, MaxLUN 8, AdapterID 6, SelTimeout 250 ms, DelayReset 1 s @@ -258,18 +258,20 @@ 5. Configuration via boot/module parameters ------------------------------------------- -With the DC390, the driver reads its EEPROM settings and IGNORES boot / -module parameters. If you want to override the EEPROM settings of a DC390, -you have to use the /proc/scsi/tmscsim/? interface described in the above -chapter. - -However, if you do have another AM53C974 based adapter you might want to -adjust some settings before you are able to write to the /proc/scsi/tmscsim/? -pseudo-file, e.g. if you want to use another adapter ID than 7. (Note that -the log message "DC390: No EEPROM found!" is normal without a DC390.) +With the DC390, the driver reads its EEPROM settings and tries to use them. +But you may want to override the settings prior to being able to change the +driver cofniguration via /proc/scso/tmscsim/?. +If you do have another AM53C974 based adapter, that's even the only +possibility to adjust settings before you are able to write to the +/proc/scsi/tmscsim/? pseudo-file, e.g. if you want to use another +adapter ID than 7. +(BTW, the log message "DC390: No EEPROM found!" is normal without a DC390.) For this purpose, you can pass options to the driver before it is initialised by using kernel or module parameters. See lilo(8) or modprobe(1) manual pages on how to pass params to the kernel or a module. +[NOTE: Formerly, it was not possible to override the EEPROM supplied + settings of the DC390 with cmd line parameters. This has changed since + 2.0e7] The syntax of the params is much shorter than the syntax of the /proc/... interface. This makes it a little bit more difficult to use. However, long @@ -289,7 +291,7 @@ * SpdIdx: The index of the maximum speed as in the DC390 BIOS. The values 0..7 mean 10, 8.0, 6.7, 5.7, 5.0, 4.0, 3.1 and 2 MHz resp. Default is - 1 (8.0 MHz). + 0 (10.0 MHz). * DevMode is a bit mapped value describing the per-device features. It applies to all devices. (Sync, Disc and TagQ will only apply, if the @@ -336,10 +338,12 @@ and the Delay after a reset to the defaults. As you can see, you don't need to specify all of the six params. +If you want values to be ignore (i.e. the EEprom settings or the defaults +will be used), you may pass -2 (not 0!) at the corresponding position. -The defaults (7,1,31,15,3,1) are aggressive to allow good performance. You can -use tmscsim=7,0,31,63,4,0 for maximum performance, if your SCSI chain is -perfect. If you meet problems, you can use tmscsim=-1 which is a shortcut +The defaults (7,0,31,15,3,1) are aggressive to allow good performance. You +can use tmscsim=7,0,31,63,4,0 for maximum performance, if your SCSI chain +allows it. If you meet problems, you can use tmscsim=-1 which is a shortcut for tmscsim=7,4,9,15,2,10. @@ -384,10 +388,10 @@ partition table and used a H/S = 64/32 or 255/63 translation. So if you want to be compatible to those, use this old mapping when creating partition tables. Even worse, on bootup the DC390 might complain if other - mappings are found, so auto rebooting will fail. + mappings are found, so auto rebooting may fail. * In some situations, the driver will get stuck in an abort loop. This is a bad interaction between the Mid-Layer of Linux' SCSI code and the driver. - Try to disable DsCn, if you meet this problem. Please contact me for + Try to disable DsCn, if you meet this problem. Please contact me for further debugging. @@ -418,11 +422,11 @@ 8. Acknowledgements ------------------- -Thanks to Linus Torvalds, Alan Cox, David Miller, the FSF people, the -XFree86 team and all the others for the wonderful OS and software. +Thanks to Linus Torvalds, Alan Cox, the FSF people, the XFree86 team and +all the others for the wonderful OS and software. Thanks to C.L. Huang and Philip Giang (Tekram) for the initial driver release and support. -Thanks to Doug Ledford, Gerard Roudier for support with SCSI coding. +Thanks to Doug Ledford, Gérard Roudier for support with SCSI coding. Thanks to a lot of people (espec. Chiaki Ishikawa, Andreas Haumer, Hubert Tonneau) for intensively testing the driver (and even risking data loss doing this during early revisions). @@ -441,5 +445,5 @@ ------------------------------------------------------------------------- Written by Kurt Garloff 1998/06/11 -Last updated 2000/01/17, driver revision 2.0d25 -$Id: README.tmscsim,v 2.25.2.5 2000/09/29 17:32:35 garloff Exp $ +Last updated 2000/11/28, driver revision 2.0e7 +$Id: README.tmscsim,v 2.25.2.6 2000/11/28 22:34:39 garloff Exp $ Index: dc390.h =================================================================== RCS file: /home/cvsroot/dc390/dc390.h,v retrieving revision 2.43.2.20 retrieving revision 2.43.2.21 diff -u -r2.43.2.20 -r2.43.2.21 --- dc390.h 2000/11/22 22:39:47 2.43.2.20 +++ dc390.h 2000/11/28 22:23:35 2.43.2.21 @@ -4,7 +4,7 @@ * Description: Device Driver for Tekram DC-390(T) PCI SCSI * * Bus Master Host Adapter * ***********************************************************************/ -/* $Id: dc390.h,v 2.43.2.20 2000/11/22 22:39:47 garloff Exp $ */ +/* $Id: dc390.h,v 2.43.2.21 2000/11/28 22:23:35 garloff Exp $ */ /* * DC390/AMD 53C974 driver, header file @@ -19,7 +19,7 @@ #endif #define DC390_BANNER "Tekram DC390/AM53C974" -#define DC390_VERSION "2.0e6 2000-11-22" +#define DC390_VERSION "2.0e7 2000-11-28" /* We don't have eh_abort_handler, eh_device_reset_handler, * eh_bus_reset_handler, eh_host_reset_handler yet! Index: tmscsim.c =================================================================== RCS file: /home/cvsroot/dc390/tmscsim.c,v retrieving revision 2.60.2.27 retrieving revision 2.60.2.28 diff -u -r2.60.2.27 -r2.60.2.28 --- tmscsim.c 2000/11/22 22:39:47 2.60.2.27 +++ tmscsim.c 2000/11/28 22:23:35 2.60.2.28 @@ -7,7 +7,7 @@ ***********************************************************************/ /* (C) Copyright: put under GNU GPL in 10/96 (see README.tmscsim) * *************************************************************************/ -/* $Id: tmscsim.c,v 2.60.2.27 2000/11/22 22:39:47 garloff Exp $ */ +/* $Id: tmscsim.c,v 2.60.2.28 2000/11/28 22:23:35 garloff Exp $ */ /* Enhancements and bugfixes by * * Kurt Garloff * ***********************************************************************/ @@ -162,6 +162,7 @@ * 2.0e5 00/11/17 KG Store Inq.flags in DCB * * 2.0e6 00/11/22 KG 2.4 init function (Thx to O.Schumann) * * 2.4 PCI device table (Thx to A.Richter) * + * 2.0e7 00/11/28 KG Allow overriding of BIOS settings * ***********************************************************************/ /* Uncomment SA_INTERRUPT, if the driver refuses to share its IRQ with other devices */ @@ -482,25 +483,14 @@ static UINT dc390_laststatus = 0; static UCHAR dc390_adapterCnt = 0; -#ifndef CONFIG_SCSI_DC390T_NOGENSUPP /* Startup values, to be overriden on the commandline */ -int tmscsim[] = {7, 1 /* 8MHz */, - PARITY_CHK_ | SEND_START_ | EN_DISCONNECT_ - | SYNC_NEGO_ | TAG_QUEUEING_, - MORE2_DRV | GREATER_1G | RST_SCSI_BUS | ACTIVE_NEGATION - /* | NO_SEEK */ -# ifdef CONFIG_SCSI_MULTI_LUN - | LUN_CHECK -# endif - , 3 /* 16 Tags per LUN */, 1 /* s delay after Reset */ }; +int tmscsim[] = {-2, -2, -2, -2, -2, -2}; # if defined(MODULE) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,30) MODULE_PARM(tmscsim, "1-6i"); MODULE_PARM_DESC(tmscsim, "Host SCSI ID, Speed (0=10MHz), Device Flags, Adapter Flags, Max Tags (log2(tags)-1), DelayReset (s)"); # endif -#endif /* CONFIG_SCSI_DC390T_NOGENSUPP */ - #if defined(MODULE) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,30) MODULE_AUTHOR("C.L. Huang / Kurt Garloff"); MODULE_DESCRIPTION("SCSI host adapter driver for Tekram DC390 and other AMD53C974A based PCI SCSI adapters"); @@ -566,6 +556,7 @@ static char* dc390_adapname = "DC390"; UCHAR dc390_eepromBuf[MAX_ADAPTER_NUM][EE_LEN]; UCHAR dc390_clock_period1[] = {4, 5, 6, 7, 8, 10, 13, 20}; +UCHAR dc390_clock_speed[] = {100,80,67,57,50, 40, 31, 20}; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,30) struct proc_dir_entry DC390_proc_scsi_tmscsim ={ @@ -596,47 +587,77 @@ udelay(160); } -#ifndef CONFIG_SCSI_DC390T_NOGENSUPP -static void __init dc390_EEpromDefaults (UCHAR index) + +/* Override EEprom values with explicitly set values */ +static void __init dc390_EEprom_Override (UCHAR index) { PUCHAR ptr; UCHAR id; ptr = (PUCHAR) dc390_eepromBuf[index]; /* Adapter Settings */ - ptr[EE_ADAPT_SCSI_ID] = (UCHAR)tmscsim[0]; /* Adapter ID */ - ptr[EE_MODE2] = (UCHAR)tmscsim[3]; - ptr[EE_DELAY] = tmscsim[5]; /* Reset delay */ - ptr[EE_TAG_CMD_NUM] = (UCHAR)tmscsim[4]; /* Tagged Cmds */ + if (tmscsim[0] != -2) + ptr[EE_ADAPT_SCSI_ID] = (UCHAR)tmscsim[0]; /* Adapter ID */ + if (tmscsim[3] != -2) + ptr[EE_MODE2] = (UCHAR)tmscsim[3]; + if (tmscsim[5] != -2) + ptr[EE_DELAY] = tmscsim[5]; /* Reset delay */ + if (tmscsim[4] != -2) + ptr[EE_TAG_CMD_NUM] = (UCHAR)tmscsim[4]; /* Tagged Cmds */ /* Device Settings */ for (id = 0; id < MAX_SCSI_ID; id++) { - ptr[id<<2] = (UCHAR)tmscsim[2]; /* EE_MODE1 */ - ptr[(id<<2) + 1] = (UCHAR)tmscsim[1]; /* EE_Speed */ + if (tmscsim[2] != -2) + ptr[id<<2] = (UCHAR)tmscsim[2]; /* EE_MODE1 */ + if (tmscsim[1] != -2) + ptr[(id<<2) + 1] = (UCHAR)tmscsim[1]; /* EE_Speed */ }; - dc390_adapname = "AM53C974"; } -static void __init dc390_checkparams (void) +/* Handle "-1" case */ +static void __init dc390_check_for_safe_settings (void) { - PARSEDEBUG(printk(KERN_INFO "DC390: setup %08x %08x %08x %08x %08x %08x\n", tmscsim[0],\ - tmscsim[1], tmscsim[2], tmscsim[3], tmscsim[4], tmscsim[5]);) - if (tmscsim[0] < 0 || tmscsim[0] > 7) /* modules-2.0.0 passes -1 as string */ + if (tmscsim[0] == -1 || tmscsim[0] > 15) /* modules-2.0.0 passes -1 as string */ { - tmscsim[0] = 7; tmscsim[1] = 4; - tmscsim[2] = 9; tmscsim[3] = 15; + tmscsim[0] = 7; tmscsim[1] = 4; + tmscsim[2] = 0x09; tmscsim[3] = 0x0f; tmscsim[4] = 2; tmscsim[5] = 10; printk (KERN_INFO "DC390: Using safe settings.\n"); } - else +} + + +#ifndef CONFIG_SCSI_DC390T_NOGENSUPP +int __initdata tmscsim_def[] = {7, 1 /* 8MHz */, + PARITY_CHK_ | SEND_START_ | EN_DISCONNECT_ + | SYNC_NEGO_ | TAG_QUEUEING_, + MORE2_DRV | GREATER_1G | RST_SCSI_BUS | ACTIVE_NEGATION + /* | NO_SEEK */ +# ifdef CONFIG_SCSI_MULTI_LUN + | LUN_CHECK +# endif + , 3 /* 16 Tags per LUN */, 1 /* s delay after Reset */ }; + +/* Copy defaults over set values where missing */ +static void __init dc390_fill_with_defaults (void) +{ + int i; + PARSEDEBUG(printk(KERN_INFO "DC390: setup %08x %08x %08x %08x %08x %08x\n", tmscsim[0],\ + tmscsim[1], tmscsim[2], tmscsim[3], tmscsim[4], tmscsim[5]);) + for (i = 0; i < 6; i++) { - /* if (tmscsim[0] < 0 || tmscsim[0] > 7) tmscsim[0] = 7; */ - if (tmscsim[1] < 0 || tmscsim[1] > 7) tmscsim[1] = 4; - if (tmscsim[4] < 0 || tmscsim[4] > 5) tmscsim[4] = 4; - if (tmscsim[5] > 180) tmscsim[5] = 180; - }; + if (tmscsim[i] < 0 || tmscsim[i] > 255) + tmscsim[i] = tmscsim_def[i]; + } + /* Sanity checks */ + if (tmscsim[0] > 7) tmscsim[0] = 7; + if (tmscsim[1] > 7) tmscsim[1] = 4; + if (tmscsim[4] > 5) tmscsim[4] = 4; + if (tmscsim[5] > 180) tmscsim[5] = 180; }; +#endif + /* Override defaults on cmdline: * tmscsim: AdaptID, MaxSpeed (Index), DevMode (Bitmapped), AdaptMode (Bitmapped) */ @@ -646,12 +667,12 @@ int ints[8]; int i, im; (void)get_options (str, ARRAY_SIZE(ints), ints); - im = ints[0]; #else void __init dc390_setup (char *str, int *ints) { - int i, im = ints[0]; + int i, im; #endif + im = ints[0]; if (im > 6) { printk (KERN_NOTICE "DC390: ignore extra params!\n"); @@ -661,7 +682,6 @@ tmscsim[i] = ints[i+1]; /* dc390_checkparams (); */ }; -#endif /* CONFIG_SCSI_DC390T_NOGENSUPP */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,13) #ifndef MODULE @@ -2155,18 +2175,24 @@ printk (KERN_ERR "DC390_init: No EEPROM found!\n"); return( -1 ); #else - int period; - printk (KERN_INFO "DC390_init: No EEPROM found!\n"); - printk (KERN_INFO "DC390_init: Trying default EEPROM settings:\n"); - dc390_checkparams (); - period = dc390_clock_period1[tmscsim[1]]; + int speed; + dc390_adapname = "AM53C974"; + printk (KERN_INFO "DC390_init: No EEPROM found! Trying default settings ...\n"); + dc390_check_for_safe_settings (); + dc390_fill_with_defaults (); + dc390_EEprom_Override (index); + speed = dc390_clock_speed[tmscsim[1]]; printk (KERN_INFO "DC390: Used defaults: AdaptID=%i, SpeedIdx=%i (%i.%i MHz)," " DevMode=0x%02x, AdaptMode=0x%02x, TaggedCmnds=%i (%i), DelayReset=%is\n", - tmscsim[0], tmscsim[1], 40 / period, ((40%period)*10 + period/2) / period, + tmscsim[0], tmscsim[1], speed/10, speed%10, (UCHAR)tmscsim[2], (UCHAR)tmscsim[3], tmscsim[4], 2 << (tmscsim[4]), tmscsim[5]); - dc390_EEpromDefaults (index); #endif - }; + } + else + { + dc390_check_for_safe_settings (); + dc390_EEprom_Override (index); + } psh = scsi_register( psht, sizeof(DC390_ACB) ); if( !psh ) return( -1 );