|
Using idetool
"idetool" is a program provided with AmigaOS 4.0 to manage the PCI buses, and is normally run from a Shell.
Please note though, that any changes you make using idetool will be lost at the next re-boot. If you want to make
permanent changes you must set the U-Boot environment variables, as detailed in Configuration.
Understanding Transfer Modes
While the "sii0680ide_xfer" U-Boot environment variable uses letters (shown in the left-most column), idetool
reports/uses the numeric "modeid" (shown in the right-most column) as per the following table :
0 = Automatic
a = PIO 0
b = PIO 1
c = PIO 2
d = PIO 3
e = PIO 4
A = UDMA 0
B = UDMA 1
C = UDMA 2
D = UDMA 3
E = UDMA 4
F = UDMA 5
G = UDMA 6
|
(let sii0680ide.device choose best mode)
(3 MB/s, modeid 8)
(5 MB/s, modeid 9)
(8 MB/s, modeid 10)
(11 MB/s, modeid 11)
(16 MB/s, modeid 12)
(16 MB/s, modeid 64)
(25 MB/s, modeid 65)
(33 MB/s, modeid 66)
(44 MB/s, modeid 67)
(66 MB/s, modeid 68)
(100 MB/s, modeid 69)
(133 MB/s, modeid 70)
|
For example, if you specified "C" for UDMA 2 at 33MB/s in the U-Boot sii0680ide_xfer environment variable,
that would be equivalent to using "modeid 66" in idetools. Similarly if you specified "c" for PIO 2
at 8MB/s in the U-Boot sii0680ide_xfer environment variable, that would be equivalent to using "modeid 10" in
idetools.
Getting Help
If you simply enter the program name "idetool", the following help information is displayed:
3.OS4:> idetool
c:idetool - usage :
c:idetool -<cmd1> [cmd arg1] ... [cmd arg n] -<cmd1> [cmd arg1] ... [cmd arg n] ...
Where <cmd> is a command, and [cmd arg1] ... [cmd arg n] are the command args
General commands :
-v (no args) : tell c:idetool version
-c (no args) : tell CPU configuration
PCI chip config dump commands :
-w (no args) : tell VIA686b PCI IDE configuration
-s (no args) : tell SiI0680 PCI IDE configuration
-a (no args) : tell SiI3112 PCI IDE configuration
-b (no args) : tell SiI3114 PCI IDE configuration
-e (no args) : tell SiI3512 PCI IDE configuration
-t vendor device : tell PCI IDE device 'vendor/device' configuration
OS4 device unit commands :
-l devname : tell unit info for all device units
-u devname unit : tell unit info for unit 'unit'
-d devname unit : tell drive info for unit 'unit'
-r devname unit : tell raw drive info for unit 'unit'
-x devname unit mode : put drive 'unit' into transfer mode 'mode'
-p devname unit mode : put drive 'unit' into power mode 'mode' (2: spin up, 3: spin down, 5: sleep forever)
-i devname unit mode : put drive 'unit' into interrupt mode 'mode' (0: don't use IRQ's, 1: use IRQ's)
-o devname unit : just open & close devname/unit
CD/DVD-specific device unit commands :
-j devname unit 'e'/'l' : eject/load disk in drive 'unit'
-m devname unit rspeed wspeed : set 'unit' medium read / write speed (1 .. n for x1 ... xn, or 0xFFFF for max.)
PCI chip config patch commands :
-0 reg val : patch VIA function 0 (ISA) configspace register 'reg' with value 'val'
-1 reg val : patch VIA function 0 (IDE) configspace register 'reg' with value 'val'
-2 reg val : patch SiI0680 configspace register 'reg' with value 'val'
-3 reg val : patch SiI3112 configspace register 'reg' with value 'val'
-4 reg val : patch SiI3114 configspace register 'reg' with value 'val'
-5 reg val : patch SiI3512 configspace register 'reg' with value 'val'
-9 vendor device reg val : patch PCI device 'vendor/device' configspace register 'reg' with value 'val'
Beware : do not use this tool except if you really know what you are doing.
Note on inputting numeric values : if the first character is 0 and the second character is not 'x' or 'X', the string is
interpreted as an octal integer; otherwise, it is interpreted as a decimal number. If the first character is '0' and the
second character is 'x' or 'X'', the string is interpreted as a hexadecimal integer.
|
Examples of using idetool
- to display the idetool version information, with the '-v' option:
idetool -v
3.OS4:> idetool -v
idetool 51.43 (07.06.2005)
(made to work only with same version devices)
3.OS4:>
|
- to display the idetool CPU configuration information, with the '-c' option:
idetool -c
3.OS4:> idetool -c
-----------------AmigaOne CPU Configuration-----------------
CPU Type IBM PowerPC 750 FX
Version 2.2
Extensions performancemonitor
Freq 800 MHz
FSB 133 MHz
L1 Cache 32768 bytes
L2 Cache 524288 bytes
L3 Cache 0 bytes
3.OS4:>
|
- to see what modes devices connected to the on-board IDE ports support and currently use, with the '-l' (that's 'ell') option:
idetool -l a1ide.device
The following information was captured prior to the installation of the SiI0680 card:
3.OS4:> idetool -l a1ide.device
-------------------Unit 0 information------------------------
  Flags : $00000185 - present, supports DMA, ATA, supports cache flush, interrupts used,
  Xfer mode : best pio / best dma / current : 12 / 69 / 12
  Total blocks : 156301488
  Blocksize : 512
  Power mode : 2 / idle (ready for operation)
  IO1 / IO2 / BMCR @ : $802400 / $80240A / $802420
*** Error opening device a1ide.device / unit 1
-------------------Unit 2 information------------------------
  Flags : $0000011D - present, supports DMA, removable media, ATAPI, interrupts used,
  Xfer mode : best pio / best dma / current : 12 / 66 / 12
  Total blocks : 310872
  Blocksize : 2048
  Packet spec : 5
  Packet size : 12
  Current medium read speed : x 65535 ('65535' stands for max.)
  Current medium write speed : x 65535 (idem)
  Power mode : 2 / idle (ready for operation)
  IO1 / IO2 / BMCR @ : $802410 / $80241A / $802428
*** Error opening device a1ide.device / unit 3
3.OS4:>
|
The lines shown in red above display the best PIO mode that the devices can use, then the
best DMA mode the devices can use, and the current mode specified for the devices, separated by /'s. Both devices are
running the best PIO mode the on-board IDE bus can deliver.
The lines shown in green above display the block size used for each device. For FFS devices
the blocksize needs to be >= 2048 to get decent performance, while for SFS devices you get best performance with 512.
- to see what modes devices connected to the SiI0680 card support and currently use, with the '-l' (that's 'ell') option:
idetool -l sii0680ide.device
The following information was captured after the installation of the SiI0680 card:
3.OS4:> idetool -l sii0680ide.device
-------------------Unit 0 information------------------------
  Flags : $00000185 - present, supports DMA, ATA, supports cache flush, interrupts used,
  Xfer mode : best pio / best dma / current : 12 / 69 / 69
  Total blocks : 156301488
  Blocksize : 512
  Power mode : 2 / idle (ready for operation)
  IO1 / IO2 / BMCR @ : $802400 / $80240A / $802420
*** Error opening device sii0680ide.device / unit 1
-------------------Unit 2 information------------------------
  Flags : $0000011D - present, supports DMA, removable media, ATAPI, interrupts used,
  Xfer mode : best pio / best dma / current : 12 / 66 / 66
  Total blocks : 310872
  Blocksize : 2048
  Packet spec : 5
  Packet size : 12
  Current medium read speed : x 65535 ('65535' stands for max.)
  Current medium write speed : x 65535 (idem)
  Power mode : 2 / idle (ready for operation)
  IO1 / IO2 / BMCR @ : $802410 / $80241A / $802428
*** Error opening device sii0680ide.device / unit 3
3.OS4:>
|
The lines shown in red above display the best PIO mode that the devices can use, then the
best DMA mode the devices can use, and the current mode specified for the devices, separated by /'s. Both devices are
running the best DMA mode the SiI0680 card can deliver.
The lines shown in green above display the block size used for each device. For FFS devices
the blocksize needs to be >= 2048 to get decent performance, while for SFS devices you get best performance with 512.
- to switch SiI0680 primary master harddisk to UDMA100 (alias mode 69 or 'F'), with the '-x' option:
idetool -x sii0680ide.device 0 69
3.OS4:> idetool -x sii0680ide.device 0 69
Unit 0 : transfer mode 69 returned 0
3.OS4:>
|
- You can try some of the other commands, like putting your harddrive to sleep with
idetool -p sii0680ide.device 0 2
(don't worry it wakes up automatically at next access)
- As long as you don't mess with -0, -1, -2 and -9 commands you can't do much harm
Idetool can do many other things (including examining any PCI device, and patching its configuration in real time)
but don't try that unless you fully understand what you are doing, and can deal with the consequences.
Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences
and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held
accountable for any issues that may result from using it.
|