I - si680ide.device release history ================================ --- OS4 beta 1 released --- si680ide.device 51.27 (23.09.2004) - First beta release This code is at the same feature level as a1ide 51.27. si680ide.device 51.28 (07.10.2004) - quick&dirty fixed expunge code for prerelease update ISO si680ide.device 51.29 (07.10.2004) - switched the max single dma transfer back to 128K (lba28 max) - now taskfile register timing is set to PIO4 when doing udma - removed rwretry code from ata_utils.c II - Configuring si680ide through UBOOT envvars ============================================ Currently si680ide is configurable through the following UBOOT envvars : - sil_maxbus Legal values are : 0 (no IDE interface at all), 1 (only primary IDE interface), and 2 (both IDE interfaces) Default : if you don't set this envvar, si680ide will use both IDE interfaces. - sil_timeout Legal values are between 1 and 30 (seconds). The latter is the recommended value from the ATA(PI) spec. Default : if you don't set this envvar, si680ide will use a 20 second timeout. - sil_conf Compose 4 chars (prim master, prim slave, sec master, sec slave) using : 0 : nothing 1 : harddisk 2 : dvd/cdrom reader or burner Default : if you don't set this envvar, si680ide will scan the IDE buses and try to determine the configuration by itself. - sil_xfer Allows to define the xfer mode which will be used for each drive. Compose 4 chars (prim master, prim slave, sec master, sec slave) using : 0 - Automatic (si680ide will use the best mode that the drive claims to support) a - PIO 0 ( 3 MB/s, modeid 8) b - PIO 1 ( 5 MB/s, modeid 9) c - PIO 2 ( 8 MB/s, modeid 10) d - PIO 3 ( 11 MB/s, modeid 11) e - PIO 4 ( 16 MB/s, modeid 12) A - UDMA 0 ( 16 MB/s, modeid 64) B - UDMA 1 ( 25 MB/s, modeid 65) C - UDMA 2 ( 33 MB/s, modeid 66) D - UDMA 3 ( 44 MB/s, modeid 67) E - UDMA 4 ( 66 MB/s, modeid 68) F - UDMA 5 (100 MB/s, modeid 69) G - UDMA 6 (133 MB/s, modeid 70) NB : si680ide will fall back to the best mode that the drive claims to support in case you ask for an unsupported mode. Default : if you don't set this envvar, si680ide will use the best PIO mode supported by the drive. - sil_irq Compose 4 chars (prim master, prim slave, sec master, sec slave) using : 1 : use IRQs any other char : don't use IRQs Default : if you don't set this envvar, si680ide >=51.19 WILL use interrupts. Using interrupts relieve the CPU in all cases (PIO : approx 20%, and UDMA approx 95%), but it also has an incidence on xfer speed : 10 to 20% lower for PIO, 10 to 20% faster for UDMA. This is normal (in PIO, it involves 2 exec reschedulings, and in UDMA, it releases the VIA bus). EXAMPLE : to use only the primary interface, set ide timeout to 5 seconds, force prim master as harddisk, sec master as cd, nothing for other drives, force prim master to udma33 and let si680ide select the xfer mode for other drives, enter the following commands at the UBOOT prompt : setenv sil_maxbus 1 setenv sil_timeout 5 setenv sil_conf 1020 setenv sil_xfer C000 saveenv Then reboot. Don't forget the 'saveenv', as si680ide uses nonvolatile.library, which only accesses the envvars stored in nvram. III - Notes =========== - This configurability feature relies on two kickstart modules from Ross Vumbaca that MUST be listed in your kicklayout : nonvolatile.library.kmod 50.2+ and nvram.resource.kmod. If those modules are not present, si680ide will revert to default values. - These envvars HAVE to be saved ('saveenv' after modifying them), because they are read directly from the nvram. - To delete an envvar, just define a blank content & then saveenv (ie 'setenv sil_conf' and then 'saveenv' will delete this envvar). - Using sil_conf (properly set !) saves need for timeouts for drive detection at boot time. - It looks like each CD/CDR/DVD/DVDR drive reports its own status codes when a blank media is inserted. Thus, OS4 will report different info on different systems when a blank CDR is inserted. - Colin Wenzel reports that the IDE ZIP works. - When you grab a boot log & send it to me, please use a nondebug kernel. - If you experience VERY SLOW harddisk writes with FFS, then you probably have a drive that does not execute properly a FLUSH_CACHE command (si680ide checks that at init time). Thus, si680ide disables the drive's write cache. Thus, your drive really crawls in writing. This does not show for the same drive with other drivers under other os'es, because they don't check if the drive can execute a FLUSH_CACHE, and just leave the write cache ON. Under Linux or AOS3.x, this can *look* fast & reliable, but this *is* fast and not reliable. Some filesystems depend on proper execution of FLUSH_CACHE, when *they* decide it, not when the drive decides. Thus, those fs'es can appear to be working, but they are not really reliable. SFS is one of those. Thus, it was decided (long ago) by the os4 dev team (mainly js & myself ;), to disable the write cache if the drive cannot properly execute a FLUSH_CACHE. The consequence is that under those circumstances, FFS really crawls at write, but you can move to the latest SFS + its diskcache.library, which works around this problem while (mostly) staying on the safe side. Make sure to create your SFS partition this way : - 500 buffers - blocksize set to 512 - maxtransfer set to 7FFFFFFF - mask set to FFFFFFFE IV - Art of adequate IDE cabling ================================ - Only use 80 wire cables with 40 pin connectors (UDMA) on a1. - Put them the proper way around : the mobo HAS to be on the end of the longest segment with the MASTER at the OTHER END of the cable, and the slave in the middle, if any. For 40 wire cables (non UDMA), the layout is : MOBO <=======> MASTER <=== wire 28 cut ===> SLAVE For 80 wire cables (UDMA), the layout is : MOBO <===+===> MASTER | wire 56 cut | v SLAVE - JUMP your drives explicitly as MASTER or SLAVE : no cable select. I've seen that concept fail already (certainly due to faulty drive firmware), so I just dont trust it. si680ide knows nothing about cable select, it's a purely hardware concept. It is a way of letting each drive know if it's master or slave by having its CSEL signal grounded (by MOBO) or not. The drives pull the CSEL signal up, and the MOBO grounds the CSEL signal, thus the SLAVE will see a +5V on the CSEL signal while the MASTER will see a GND. That's how the slave knows he's a slave & the master knows it's a master. That also applies to PC's. For a complete reference, refer to ATA specs, www.t13.org, d1532v2r3e.pdf. - About ROUND CABLES : they are a cosmetic nonsense. The ATA spec states that the move from 40 to 80 wires intends to reduce diaphony between data lines, and you more or less kill that with a round cable. V - Fine Art of drive partitioning ================================== A few things you must know : - You'll get decent performance from any FS only with buffers >= 500 - You'll get decent performance from FFS only with blocksize >= 2048 - You'll get the best performance from SFS only with blocksize = 512 - SFS is way faster than FFS in its default (non-caching) behaviour, but FFS is said to be safer. - SFS + its diskcache.library is even faster. - There is a cache plugin for FFS, and you can also set FFS in writeback cache mode. Using both things make it waaaaay faster (almost comparable to SFS). The FFS cache plugin is 'fs_cache_plugin', you will find it somewhere on your OS4 CD, just 'run fs_cache_plugin DH0:' for each FFS partition you wish to run with cache. - The command I use to bench r/w perf is scsispeed, found in the latest diskspeed archive from Aminet, and also in an OS4 native form on the OS4 beta server (quick port by myself, dropped the m68k CPU usage measurement code).