/ Forside / Teknologi / Operativsystemer / Linux / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
Linux
#NavnPoint
o.v.n. 11177
peque 7911
dk 4814
e.c 2359
Uranus 1334
emesen 1334
stone47 1307
linuxrules 1214
Octon 1100
10  BjarneD 875
FreeBSD og Sandberg Ultra DMA ATA 133 Raid
Fra : Barnabas


Dato : 24-08-02 14:51

Hejsa,

Jeg sidder og prøver at få min nye ata disk til at virke under FreeBSD, men
har problemer i den retning. Min conf er:

IBM Netfinity 5000
Sandberg Ultra DMA ata 133 raid.
Western Digital 120 gb hd også ata 133 naturligvis.

Jeg skal ikke rodes ud i at køre hw raid eller sådan noget (endnu da..) og
vil egentlig bare have hul igennem til disken. Jeg kan sagtens få adgang til
disken ved opstart i dos, så hw er OK. Her er hvad jeg har prøvet at gøre:

# dd if=/dev/zero of=/dev/rad1 bs=1k count=1
# fdisk -BI ad1
# disklabel -B -w -r ad1s1 auto
# disklabel -e ad1s1
# mkdir -p /dsk04
# newfs /dev/ad1s1e
# mount -t ufs /dev/ad1s1e /dsk04

Altså lige efter bogen . Efter linje 2 får jeg: Device not configured.

Skal der en driver til som jeg skal compile med i kernen eller sådan noget?
Jeg har minus erfaringer med IDE diske under *nix, har kun arbejdet med scsi
og sca førhen, og de fungerer da heldivis som jeg forventer i maskinen
Jeg havde bare ikke lige 13K til at købe en 120 giga scsi eller sca disk ..

Håber at du har nogle forslag.

- Nico






 
 
Jesper Skriver (24-08-2002)
Kommentar
Fra : Jesper Skriver


Dato : 24-08-02 15:05

On Sat, 24 Aug 2002 15:50:46 +0200, Barnabas wrote:
> Hejsa,
>
> Jeg sidder og prøver at få min nye ata disk til at virke under FreeBSD, men
> har problemer i den retning. Min conf er:
>
> IBM Netfinity 5000
> Sandberg Ultra DMA ata 133 raid.
> Western Digital 120 gb hd også ata 133 naturligvis.
>
> Jeg skal ikke rodes ud i at køre hw raid eller sådan noget (endnu da..) og
> vil egentlig bare have hul igennem til disken. Jeg kan sagtens få adgang til
> disken ved opstart i dos, så hw er OK. Her er hvad jeg har prøvet at gøre:
>
> # dd if=/dev/zero of=/dev/rad1 bs=1k count=1
> # fdisk -BI ad1
> # disklabel -B -w -r ad1s1 auto
> # disklabel -e ad1s1
> # mkdir -p /dsk04
> # newfs /dev/ad1s1e
> # mount -t ufs /dev/ad1s1e /dsk04
>
> Altså lige efter bogen . Efter linje 2 får jeg: Device not configured.

prøv lige at poste output af

disklabel ad1
disklabel ad1s0
disklabel ad1s1

Det kan være du ikke har fået lavet den slice du troede.

--
Jesper Skriver, CCIE #5456
FreeBSD committer

Barnabas (24-08-2002)
Kommentar
Fra : Barnabas


Dato : 24-08-02 15:33

[1628][anh@sauron:/dev]$ sudo -u root fdisk ad0
fdisk: cannot open disk /dev/ad0: Device not configured
[1628][anh@sauron:/dev]$ sudo -u root fdisk ad1
fdisk: cannot open disk /dev/ad1: Device not configured
[1628][anh@sauron:/dev]$ sudo -u root fdisk ad2
fdisk: cannot open disk /dev/ad2: Device not configured
[1628][anh@sauron:/dev]$ sudo -u root disklabel ad1
disklabel: /dev/ad1c: Device not configured
[1629][anh@sauron:/dev]$ sudo -u root disklabel ad1s0
disklabel: /dev/ad1s0: No such file or directory
[1629][anh@sauron:/dev]$ sudo -u root disklabel ad1s01
disklabel: /dev/ad1s01: No such file or directory
[1629][anh@sauron:/dev]$ sudo -u root disklabel ad0
disklabel: /dev/ad0c: Device not configured
[1629][anh@sauron:/dev]$ sudo -u root disklabel ad0s0
disklabel: /dev/ad0s0: No such file or directory
[1630][anh@sauron:/dev]$ sudo -u root disklabel ad0s1
disklabel: /dev/ad0s1c: Device not configured

Men den skal vel også kunne ses ift. fdisk før vi begynder at tale slices?
Som sagt kan jeg sagtens teste drevet fra IBM's diagnostics tool.



Jesper Skriver (24-08-2002)
Kommentar
Fra : Jesper Skriver


Dato : 24-08-02 17:17

On Sat, 24 Aug 2002 16:32:42 +0200, Barnabas wrote:
> [1628][anh@sauron:/dev]$ sudo -u root fdisk ad0
> fdisk: cannot open disk /dev/ad0: Device not configured
> [1628][anh@sauron:/dev]$ sudo -u root fdisk ad1
> fdisk: cannot open disk /dev/ad1: Device not configured
> [1628][anh@sauron:/dev]$ sudo -u root fdisk ad2
> fdisk: cannot open disk /dev/ad2: Device not configured
> [1628][anh@sauron:/dev]$ sudo -u root disklabel ad1
> disklabel: /dev/ad1c: Device not configured
> [1629][anh@sauron:/dev]$ sudo -u root disklabel ad1s0
> disklabel: /dev/ad1s0: No such file or directory
> [1629][anh@sauron:/dev]$ sudo -u root disklabel ad1s01
> disklabel: /dev/ad1s01: No such file or directory
> [1629][anh@sauron:/dev]$ sudo -u root disklabel ad0
> disklabel: /dev/ad0c: Device not configured
> [1629][anh@sauron:/dev]$ sudo -u root disklabel ad0s0
> disklabel: /dev/ad0s0: No such file or directory
> [1630][anh@sauron:/dev]$ sudo -u root disklabel ad0s1
> disklabel: /dev/ad0s1c: Device not configured
>
> Men den skal vel også kunne ses ift. fdisk før vi begynder at tale slices?

Ja

Findes den i det hele taget under boot ?

Det kan ses med dmesg, prøv evt. en verbose boot

boot -v

> Som sagt kan jeg sagtens teste drevet fra IBM's diagnostics tool.

Er det ikke et helt almindeligt ATA drev koblet til en en alm. ATA
controller ?

--
Jesper Skriver, CCIE #5456
FreeBSD committer

Barnabas (24-08-2002)
Kommentar
Fra : Barnabas


Dato : 24-08-02 20:15

Hej igen,

Ja det er en standard ata disk:
http://www.edbpriser.dk/hardware/hardware-top10.asp?ID=1374647961
og controller:
http://www.edbpriser.dk/hardware/hardware-top10.asp?ID=1314757893

Jeg kan se at maskinen diskuterer med sig selv hvilket id den skal give
diskene på ata, jeg mangler måske at nævne at der sidder en gammel
controller på bundkortet (ATA) men iflg IBM er dette kun kompatibelt med
CD_rom'en i maskinen. Det ved jeg ikke om jeg lige tror på, men under alle
omstændigheder kan den gamle controller nok ikke fatte en disk på 120 giga,
da SENSE BIG failede på den controller. Den fejl er forsvundet med den nye.
Mit cd rom drev sidder stadig på det gamle og begge devices er dermed sat op
som master på deres device. Hard disken er sat op som master på channel 0 på
raid controlleren, og det er det eneste device på kortet lige nu.

Her kommer hele smøren:

Aug 24 20:57:38 sauron reboot: rebooted by anh
Aug 24 20:57:38 sauron syslogd: exiting on signal 15
Aug 24 21:00:16 sauron /kernel: Copyright (c) 1992-2002 The FreeBSD Project.
Aug 24 21:00:16 sauron /kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988,
1989, 1991, 1992, 1993, 1994
Aug 24 21:00:16 sauron /kernel: The Regents of the University of California.
All rights reserved.
Aug 24 21:00:16 sauron /kernel: FreeBSD 4.6-RELEASE #0: Fri Jul 12 18:21:55
CEST 2002
Aug 24 21:00:16 sauron /kernel:
root@sauron.progressit.dk:/usr/src/sys/compile/MYKERNEL
Aug 24 21:00:16 sauron /kernel: Calibrating clock(s) ... TSC clock:
498560175 Hz, i8254 clock: 1192924 Hz
Aug 24 21:00:16 sauron /kernel: CLK_USE_I8254_CALIBRATION not specified -
using default frequency
Aug 24 21:00:16 sauron /kernel: Timecounter "i8254" frequency 1193182 Hz
Aug 24 21:00:16 sauron /kernel: CLK_USE_TSC_CALIBRATION not specified -
using old calibration method
Aug 24 21:00:16 sauron /kernel: CPU: Pentium III/Pentium III Xeon/Celeron
(498.67-MHz 686-class CPU)
Aug 24 21:00:16 sauron /kernel: Origin = "GenuineIntel" Id = 0x673
Stepping = 3
Aug 24 21:00:16 sauron /kernel:
Features=0x383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,
CMOV,PAT,PSE36,MMX,FXSR,SSE>
Aug 24 21:00:16 sauron /kernel: real memory = 268419072 (262128K bytes)
Aug 24 21:00:16 sauron /kernel: Physical memory chunk(s):
Aug 24 21:00:16 sauron /kernel: 0x00001000 - 0x0009cfff, 638976 bytes (156
pages)
Aug 24 21:00:16 sauron /kernel: 0x004de000 - 0x0fff3fff, 263282688 bytes
(64278 pages)
Aug 24 21:00:16 sauron /kernel: avail memory = 256356352 (250348K bytes)
Aug 24 21:00:16 sauron /kernel: Programming 24 pins in IOAPIC #0
Aug 24 21:00:16 sauron /kernel: IOAPIC #0 intpin 2 -> irq 0
Aug 24 21:00:16 sauron /kernel: SMP: CPU0 apic_initialize():
Aug 24 21:00:16 sauron /kernel: lint0: 0x00000700 lint1: 0x00010400 TPR:
0x00000010 SVR: 0x000001ff
Aug 24 21:00:16 sauron /kernel: FreeBSD/SMP: Multiprocessor motherboard
Aug 24 21:00:16 sauron /kernel: cpu0 (BSP): apic id: 1, version:
0x00040011, at 0xfee00000
Aug 24 21:00:16 sauron /kernel: cpu1 (AP): apic id: 0, version:
0x00040011, at 0xfee00000
Aug 24 21:00:16 sauron /kernel: io0 (APIC): apic id: 14, version:
0x00170011, at 0xfec00000
Aug 24 21:00:16 sauron /kernel: bios32: Found BIOS32 Service Directory
header at 0xc00fd5d0
Aug 24 21:00:16 sauron /kernel: bios32: Entry = 0xfd5e1 (c00fd5e1) Rev = 0
Len = 1
Aug 24 21:00:16 sauron /kernel: pcibios: PCI BIOS entry at 0xd61c
Aug 24 21:00:16 sauron /kernel: pnpbios: Found PnP BIOS data at 0xc00fdd90
Aug 24 21:00:16 sauron /kernel: pnpbios: Entry = f0000:28a8 Rev = 1.0
Aug 24 21:00:16 sauron /kernel: Other BIOS signatures found:
Aug 24 21:00:16 sauron /kernel: ACPI: 000fdec0
Aug 24 21:00:16 sauron /kernel: Preloaded elf kernel "kernel" at 0xc04b4000.
Aug 24 21:00:16 sauron /kernel: Pentium Pro MTRR support enabled
Aug 24 21:00:16 sauron /kernel: md0: Malloc disk
Aug 24 21:00:16 sauron /kernel: Creating DISK md0
Aug 24 21:00:16 sauron /kernel: Math emulator present
Aug 24 21:00:16 sauron /kernel: SMP: CPU0 bsp_apic_configure():
Aug 24 21:00:16 sauron /kernel: lint0: 0x00010700 lint1: 0x00000400 TPR:
0x00000010 SVR: 0x000001ff
Aug 24 21:00:16 sauron /kernel: pci_open(1): mode 1 addr port (0x0cf8) is
0x00000070
Aug 24 21:00:16 sauron /kernel: pci_open(1a): mode1res=0x80000000
(0x80000000)
Aug 24 21:00:16 sauron /kernel: pci_cfgcheck: device 0 [class=060000]
[hdr=80] is there (id=00071166)
Aug 24 21:00:16 sauron /kernel: npx0: <math processor> on motherboard
Aug 24 21:00:16 sauron /kernel: npx0: INT 16 interface
Aug 24 21:00:16 sauron /kernel: pcib0: <Host to PCI bridge> on motherboard
Aug 24 21:00:16 sauron /kernel: found-> vendor=0x1166, dev=0x0007,
revid=0x04
Aug 24 21:00:16 sauron /kernel: class=06-00-00, hdrtype=0x00, mfdev=1
Aug 24 21:00:16 sauron /kernel: subordinatebus=0 secondarybus=0
Aug 24 21:00:16 sauron /kernel: map[10]: type 1, range 32, base 00000000,
size 0
Aug 24 21:00:16 sauron /kernel: found-> vendor=0x1166, dev=0x0005,
revid=0x02
Aug 24 21:00:16 sauron /kernel: class=06-00-00, hdrtype=0x00, mfdev=1
Aug 24 21:00:16 sauron /kernel: subordinatebus=0 secondarybus=0
Aug 24 21:00:16 sauron /kernel: IOAPIC #0 intpin 11 -> irq 2
Aug 24 21:00:16 sauron /kernel: Freeing (NOT implemented) redirected PCI irq
11.
Aug 24 21:00:16 sauron /kernel: found-> vendor=0x1095, dev=0x0680,
revid=0x01
Aug 24 21:00:16 sauron /kernel: class=01-04-00, hdrtype=0x00, mfdev=0
Aug 24 21:00:16 sauron /kernel: subordinatebus=0 secondarybus=0
Aug 24 21:00:16 sauron /kernel: intpin=a, irq=2
Aug 24 21:00:16 sauron /kernel: map[10]: type 1, range 32, base 00002000,
size 3
Aug 24 21:00:16 sauron /kernel: map[14]: type 3, range 32, base 00002008,
size 2
Aug 24 21:00:16 sauron /kernel: map[18]: type 1, range 32, base 00002010,
size 3
Aug 24 21:00:17 sauron /kernel: map[1c]: type 3, range 32, base 0000200c,
size 2
Aug 24 21:00:17 sauron /kernel: map[20]: type 1, range 32, base 00002020,
size 4
Aug 24 21:00:17 sauron /kernel: map[24]: type 1, range 32, base febffc00,
size 8
Aug 24 21:00:17 sauron /kernel: IOAPIC #0 intpin 15 -> irq 10
Aug 24 21:00:17 sauron /kernel: Freeing (NOT implemented) redirected PCI irq
15.
Aug 24 21:00:17 sauron /kernel: found-> vendor=0x9004, dev=0x7895,
revid=0x04
Aug 24 21:00:17 sauron /kernel: class=01-00-00, hdrtype=0x00, mfdev=1
Aug 24 21:00:17 sauron /kernel: subordinatebus=0 secondarybus=0
Aug 24 21:00:17 sauron /kernel: intpin=a, irq=10
Aug 24 21:00:17 sauron /kernel: map[10]: type 1, range 32, base 00002200,
size 8
Aug 24 21:00:17 sauron /kernel: map[14]: type 1, range 32, base febfe000,
size 12
Aug 24 21:00:17 sauron /kernel: IOAPIC #0 intpin 10 -> irq 11
Aug 24 21:00:17 sauron /kernel: Freeing (NOT implemented) redirected PCI irq
10.
Aug 24 21:00:17 sauron /kernel: found-> vendor=0x9004, dev=0x7895,
revid=0x04
Aug 24 21:00:17 sauron /kernel: class=01-00-00, hdrtype=0x00, mfdev=1
Aug 24 21:00:17 sauron /kernel: subordinatebus=0 secondarybus=0
Aug 24 21:00:17 sauron /kernel: intpin=b, irq=11
Aug 24 21:00:17 sauron /kernel: map[10]: type 1, range 32, base 00002300,
size 8
Aug 24 21:00:17 sauron /kernel: map[14]: type 1, range 32, base febfd000,
size 12
Aug 24 21:00:17 sauron /kernel: Freeing (NOT implemented) redirected PCI irq
11.
Aug 24 21:00:17 sauron /kernel: found-> vendor=0x1022, dev=0x2000,
revid=0x36
Aug 24 21:00:17 sauron /kernel: class=02-00-00, hdrtype=0x00, mfdev=0
Aug 24 21:00:17 sauron /kernel: subordinatebus=0 secondarybus=0
Aug 24 21:00:17 sauron /kernel: intpin=a, irq=2
Aug 24 21:00:17 sauron /kernel: map[10]: type 1, range 32, base 00002040,
size 5
Aug 24 21:00:17 sauron /kernel: map[14]: type 1, range 32, base febff800,
size 5
Aug 24 21:00:17 sauron /kernel: found-> vendor=0x5333, dev=0x8901,
revid=0x16
Aug 24 21:00:17 sauron /kernel: class=03-00-00, hdrtype=0x00, mfdev=0
Aug 24 21:00:17 sauron /kernel: subordinatebus=0 secondarybus=0
Aug 24 21:00:17 sauron /kernel: intpin=a, irq=9
Aug 24 21:00:17 sauron /kernel: map[10]: type 1, range 32, base f8000000,
size 26
Aug 24 21:00:17 sauron /kernel: found-> vendor=0x1166, dev=0x0200,
revid=0x4d
Aug 24 21:00:17 sauron /kernel: class=06-01-00, hdrtype=0x00, mfdev=1
Aug 24 21:00:17 sauron /kernel: subordinatebus=0 secondarybus=0
Aug 24 21:00:17 sauron /kernel: Freeing (NOT implemented) redirected PCI irq
14.
Aug 24 21:00:17 sauron /kernel: found-> vendor=0x1166, dev=0x0210,
revid=0x4a
Aug 24 21:00:17 sauron /kernel: class=01-01-ea, hdrtype=0x00, mfdev=1
Aug 24 21:00:17 sauron /kernel: subordinatebus=0 secondarybus=0
Aug 24 21:00:17 sauron /kernel: intpin=a, irq=11
Aug 24 21:00:17 sauron /kernel: map[10]: type 1, range 32, base 000001f0,
size 3
Aug 24 21:00:17 sauron /kernel: map[14]: type 1, range 32, base 000003f4,
size 2
Aug 24 21:00:17 sauron /kernel: map[18]: type 1, range 32, base 00000000,
size 3
Aug 24 21:00:17 sauron /kernel: map[1c]: type 1, range 32, base 00000000,
size 2
Aug 24 21:00:17 sauron /kernel: map[20]: type 1, range 32, base 0000ffa0,
size 4
Aug 24 21:00:17 sauron /kernel: Freeing (NOT implemented) redirected PCI irq
10.
Aug 24 21:00:17 sauron /kernel: found-> vendor=0x1166, dev=0x0220,
revid=0x04
Aug 24 21:00:17 sauron /kernel: class=0c-03-10, hdrtype=0x00, mfdev=0
Aug 24 21:00:17 sauron /kernel: subordinatebus=0 secondarybus=0
Aug 24 21:00:17 sauron /kernel: intpin=a, irq=11
Aug 24 21:00:17 sauron /kernel: map[10]: type 1, range 32, base ff700000,
size 12
Aug 24 21:00:17 sauron /kernel: pci0: <PCI bus> on pcib0
Aug 24 21:00:17 sauron /kernel: pci0: <unknown card> (vendor=0x1095,
dev=0x0680) at 1.0 irq 2
Aug 24 21:00:17 sauron /kernel: ahc0: <Adaptec aic7895 Ultra SCSI adapter>
port 0x2200-0x22ff mem 0xfebfe000-0xfebfefff irq 10 at device 6.0 on pci0
Aug 24 21:00:17 sauron /kernel: ahc0: Reading SEEPROM...done.
Aug 24 21:00:17 sauron /kernel: ahc0: Low byte termination Enabled
Aug 24 21:00:17 sauron /kernel: ahc0: High byte termination Enabled
Aug 24 21:00:17 sauron /kernel: ahc0: Downloading Sequencer Program... 403
instructions downloaded
Aug 24 21:00:17 sauron /kernel: aic7895C: Ultra Wide Channel A, SCSI Id=7,
32/253 SCBs
Aug 24 21:00:17 sauron /kernel: ahc1: <Adaptec aic7895 Ultra SCSI adapter>
port 0x2300-0x23ff mem 0xfebfd000-0xfebfdfff irq 11 at device 6.1 on pci0
Aug 24 21:00:17 sauron /kernel: ahc1: Reading SEEPROM...done.
Aug 24 21:00:17 sauron /kernel: ahc1: Low byte termination Enabled
Aug 24 21:00:17 sauron /kernel: ahc1: High byte termination Enabled
Aug 24 21:00:17 sauron /kernel: ahc1: Downloading Sequencer Program... 403
instructions downloaded
Aug 24 21:00:17 sauron /kernel: aic7895C: Ultra Wide Channel B, SCSI Id=15,
32/253 SCBs
Aug 24 21:00:17 sauron /kernel: lnc0: <PCNet/PCI Ethernet adapter> port
0x2040-0x205f mem 0xfebff800-0xfebff81f irq 2 at device 9.0 on pci0
Aug 24 21:00:17 sauron /kernel: bpf: lnc0 attached
Aug 24 21:00:17 sauron /kernel: lnc0: PCnet-FAST+ address 00:06:29:39:61:39
Aug 24 21:00:17 sauron /kernel: lnc0: driver is using old-style
compatibility shims
Aug 24 21:00:17 sauron /kernel: pci0: <S3 Trio 64V2/DX/GX graphics
accelerator> (vendor=0x5333, dev=0x8901) at 10.0 irq 9
Aug 24 21:00:17 sauron /kernel: isab0: <ServerWorks IB6566 PCI to ISA
bridge> at device 15.0 on pci0
Aug 24 21:00:17 sauron /kernel: isa0: <ISA bus> on isab0
Aug 24 21:00:17 sauron /kernel: atapci0: <Generic PCI ATA controller> port
0xffa0-0xffaf,0-0x3,0-0x7,0x3f4-0x3f7,0x1f0-0x1f7 irq 11 at device 15.1 on
pci0
Aug 24 21:00:17 sauron /kernel: ata0: iobase=0x01f0 altiobase=0x03f6
bmaddr=0xffa0
Aug 24 21:00:17 sauron /kernel: ata0: mask=03 ostat0=50 ostat2=00
Aug 24 21:00:17 sauron /kernel: ata0-master: ATAPI 14 eb
Aug 24 21:00:17 sauron /kernel: ata0-slave: ATAPI 00 00
Aug 24 21:00:17 sauron /kernel: ata0: mask=03 stat0=00 stat1=00
Aug 24 21:00:17 sauron /kernel: ata0: devices=04
Aug 24 21:00:17 sauron /kernel: ata0: at 0x1f0 irq 14 on atapci0
Aug 24 21:00:17 sauron /kernel: ata1: iobase=0x0170 altiobase=0x0376
bmaddr=0xffa8
Aug 24 21:00:17 sauron /kernel: ata1: at 0x170 irq 15 on atapci0
Aug 24 21:00:17 sauron /kernel: ohci0: <OHCI (generic) USB controller> mem
0xff700000-0xff700fff irq 11 at device 15.2 on pci0
Aug 24 21:00:17 sauron /kernel: ohci0: (New OHCI DeviceId=0x02201166)
Aug 24 21:00:18 sauron /kernel: using shared irq11.
Aug 24 21:00:18 sauron /kernel: usb0: OHCI version 1.0, legacy support
Aug 24 21:00:18 sauron /kernel: usb0: <OHCI (generic) USB controller> on
ohci0
Aug 24 21:00:18 sauron /kernel: usb0: USB revision 1.0
Aug 24 21:00:18 sauron /kernel: uhub0: (unknown) OHCI root hub, class 9/0,
rev 1.00/1.00, addr 1
Aug 24 21:00:18 sauron /kernel: uhub0: 2 ports with 2 removable, self
powered
Aug 24 21:00:18 sauron /kernel: pcib1: <ServerWorks NB6536 2.0HE host to PCI
bridge> on motherboard
Aug 24 21:00:18 sauron /kernel: Freeing (NOT implemented) redirected PCI irq
15.
Aug 24 21:00:18 sauron /kernel: found-> vendor=0x12eb, dev=0x0002,
revid=0xfe
Aug 24 21:00:18 sauron /kernel: class=04-01-00, hdrtype=0x00, mfdev=0
Aug 24 21:00:18 sauron /kernel: subordinatebus=0 secondarybus=0
Aug 24 21:00:18 sauron /kernel: intpin=a, irq=10
Aug 24 21:00:18 sauron /kernel: map[10]: type 1, range 32, base c0f80000,
size 18
Aug 24 21:00:18 sauron /kernel: map[14]: type 1, range 32, base 00004af0,
size 3
Aug 24 21:00:18 sauron /kernel: map[18]: type 3, range 32, base 00004af8,
size 3
Aug 24 21:00:18 sauron /kernel: pci1: <PCI bus> on pcib1
Aug 24 21:00:18 sauron /kernel: pci1: <unknown card> (vendor=0x12eb,
dev=0x0002) at 4.0 irq 10
Aug 24 21:00:18 sauron /kernel: ex_isa_identify()
Aug 24 21:00:18 sauron /kernel: ata-: ata0 exists, using next available unit
number
Aug 24 21:00:18 sauron /kernel: ata-: ata1 exists, using next available unit
number
Aug 24 21:00:18 sauron /kernel: lnc-: lnc0 exists, using next available unit
number
Aug 24 21:00:18 sauron /kernel: Trying Read_Port at 203
Aug 24 21:00:18 sauron /kernel: Trying Read_Port at 243
Aug 24 21:00:18 sauron /kernel: Trying Read_Port at 283
Aug 24 21:00:18 sauron /kernel: Trying Read_Port at 2c3
Aug 24 21:00:18 sauron /kernel: Trying Read_Port at 303
Aug 24 21:00:18 sauron /kernel: Trying Read_Port at 343
Aug 24 21:00:18 sauron /kernel: Trying Read_Port at 383
Aug 24 21:00:18 sauron /kernel: Trying Read_Port at 3c3
Aug 24 21:00:18 sauron /kernel: isa_probe_children: disabling PnP devices
Aug 24 21:00:18 sauron /kernel: isa_probe_children: probing non-PnP devices
Aug 24 21:00:18 sauron /kernel: orm0: <Option ROMs> at iomem
0xc0000-0xc7fff,0xc8000-0xccfff on isa0
Aug 24 21:00:18 sauron /kernel: fdc0: ready for input in output
Aug 24 21:00:18 sauron /kernel: fdc0: cmd 3 failed at out byte 1 of 3
Aug 24 21:00:18 sauron /kernel: fdc0 failed to probe at port
0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
Aug 24 21:00:18 sauron /kernel: ata2 failed to probe at port 0x1f0 irq 14 on
isa0
Aug 24 21:00:18 sauron /kernel: ata3 failed to probe at port 0x170 irq 15 on
isa0
Aug 24 21:00:18 sauron /kernel: adv0 failed to probe on isa0
Aug 24 21:00:18 sauron /kernel: bt0: Failed Status Reg Test - ff
Aug 24 21:00:18 sauron /kernel: bt_isa_probe: Probe failed at 0x330
Aug 24 21:00:18 sauron /kernel: bt0: Failed Status Reg Test - ff
Aug 24 21:00:18 sauron /kernel: bt_isa_probe: Probe failed at 0x334
Aug 24 21:00:18 sauron /kernel: bt0: Failed Status Reg Test - ff
Aug 24 21:00:18 sauron /kernel: bt_isa_probe: Probe failed at 0x230
Aug 24 21:00:18 sauron /kernel: bt0: Failed Status Reg Test - ff
Aug 24 21:00:18 sauron /kernel: bt_isa_probe: Probe failed at 0x234
Aug 24 21:00:18 sauron /kernel: bt0: Failed Status Reg Test - ff
Aug 24 21:00:18 sauron /kernel: bt_isa_probe: Probe failed at 0x130
Aug 24 21:00:18 sauron /kernel: bt0: Failed Status Reg Test - ff
Aug 24 21:00:18 sauron /kernel: bt_isa_probe: Probe failed at 0x134
Aug 24 21:00:18 sauron /kernel: bt0 failed to probe at port 0x134-0x137 on
isa0
Aug 24 21:00:18 sauron /kernel: aha0: status reg test failed ff
Aug 24 21:00:18 sauron last message repeated 5 times
Aug 24 21:00:18 sauron /kernel: aha0 failed to probe at port 0x134-0x137 on
isa0
Aug 24 21:00:18 sauron /kernel: aic0 failed to probe at port 0x140-0x15f on
isa0
Aug 24 21:00:18 sauron /kernel: atkbdc0: <Keyboard controller (i8042)> at
port 0x60,0x64 on isa0
Aug 24 21:00:18 sauron /kernel: atkbd0: <AT Keyboard> flags 0x1 irq 1 on
atkbdc0
Aug 24 21:00:18 sauron /kernel: atkbd: the current kbd controller command
byte 0065
Aug 24 21:00:18 sauron /kernel: atkbd: keyboard ID 0x41ab (2)
Aug 24 21:00:18 sauron /kernel: kbd0 at atkbd0
Aug 24 21:00:18 sauron /kernel: kbd0: atkbd0, AT 101/102 (2), config:0x1,
flags:0x3d0000
Aug 24 21:00:18 sauron /kernel: psm0: current command byte:0065
Aug 24 21:00:18 sauron /kernel: psm0: failed to reset the aux device.
Aug 24 21:00:18 sauron /kernel: vga0: <Generic ISA VGA> at port 0x3c0-0x3df
iomem 0xa0000-0xbffff on isa0
Aug 24 21:00:18 sauron /kernel: fb0: vga0, vga, type:VGA (5), flags:0x7007f
Aug 24 21:00:18 sauron /kernel: fb0: port:0x3c0-0x3df, crtc:0x3d4,
mem:0xa0000 0x20000
Aug 24 21:00:18 sauron /kernel: fb0: init mode:24, bios mode:3, current
mode:24
Aug 24 21:00:18 sauron /kernel: fb0: window:0xc00b8000 size:32k gran:32k,
buf:0 size:32k
Aug 24 21:00:18 sauron /kernel: VGA parameters upon power-up
Aug 24 21:00:18 sauron /kernel: 50 18 10 00 00 00 03 00 02 67 5f 4f 50 82 55
81
Aug 24 21:00:18 sauron /kernel: bf 1f 00 4f 0d 0e 00 00 05 f0 9c 8e 8f 28 1f
96
Aug 24 21:00:18 sauron /kernel: b9 a3 ff 00 01 02 03 04 05 14 07 38 39 3a 3b
3c
Aug 24 21:00:18 sauron /kernel: 3d 3e 3f 0c 00 0f 08 00 00 00 00 00 10 0e 00
ff
Aug 24 21:00:18 sauron /kernel: VGA parameters in BIOS for mode 24
Aug 24 21:00:18 sauron /kernel: 50 18 10 00 10 00 03 00 02 67 5f 4f 50 82 55
81
Aug 24 21:00:18 sauron /kernel: bf 1f 00 4f 0d 0e 00 00 00 00 9c 8e 8f 28 1f
96
Aug 24 21:00:18 sauron /kernel: b9 a3 ff 00 01 02 03 04 05 14 07 38 39 3a 3b
3c
Aug 24 21:00:18 sauron /kernel: 3d 3e 3f 0c 00 0f 08 00 00 00 00 00 10 0e 00
ff
Aug 24 21:00:18 sauron /kernel: EGA/VGA parameters to be used for mode 24
Aug 24 21:00:18 sauron /kernel: 50 18 10 00 10 00 03 00 02 67 5f 4f 50 82 55
81
Aug 24 21:00:18 sauron /kernel: bf 1f 00 4f 0d 0e 00 00 00 00 9c 8e 8f 28 1f
96
Aug 24 21:00:18 sauron /kernel: b9 a3 ff 00 01 02 03 04 05 14 07 38 39 3a 3b
3c
Aug 24 21:00:18 sauron /kernel: 3d 3e 3f 0c 00 0f 08 00 00 00 00 00 10 0e 00
ff
Aug 24 21:00:18 sauron /kernel: sc0: <System console> at flags 0x100 on isa0
Aug 24 21:00:18 sauron /kernel: sc0: VGA <16 virtual consoles, flags=0x300>
Aug 24 21:00:18 sauron /kernel: sc0: fb0, kbd0, terminal emulator: sc
(syscons terminal)
Aug 24 21:00:18 sauron /kernel: pcic0 failed to probe at port 0x3e0 iomem
0xd0000 on isa0
Aug 24 21:00:18 sauron /kernel: pcic1: not probed (disabled)
Aug 24 21:00:18 sauron /kernel: sio0: irq maps: 0x1 0x11 0x1 0x1
Aug 24 21:00:18 sauron /kernel: sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on
isa0
Aug 24 21:00:18 sauron /kernel: sio0: type 16550A
Aug 24 21:00:18 sauron /kernel: sio1: irq maps: 0x1 0x9 0x1 0x1
Aug 24 21:00:18 sauron /kernel: sio1 at port 0x2f8-0x2ff irq 3 on isa0
Aug 24 21:00:18 sauron /kernel: sio1: type 16550A
Aug 24 21:00:18 sauron /kernel: sio2: not probed (disabled)
Aug 24 21:00:18 sauron /kernel: sio3: not probed (disabled)
Aug 24 21:00:18 sauron /kernel: ppc0: parallel port found at 0x378
Aug 24 21:00:19 sauron /kernel: ppc0: using extended I/O port range
Aug 24 21:00:19 sauron /kernel: ppc0: SPP
Aug 24 21:00:19 sauron /kernel: ppc0: <Parallel port> at port 0x378-0x37f
irq 7 on isa0
Aug 24 21:00:19 sauron /kernel: ppc0: Generic chipset (NIBBLE-only) in
COMPATIBLE mode
Aug 24 21:00:19 sauron /kernel: plip0: <PLIP network interface> on ppbus0
Aug 24 21:00:19 sauron /kernel: bpf: lp0 attached
Aug 24 21:00:19 sauron /kernel: lpt0: <Printer> on ppbus0
Aug 24 21:00:19 sauron /kernel: lpt0: Interrupt-driven port
Aug 24 21:00:19 sauron /kernel: ppi0: <Parallel I/O> on ppbus0
Aug 24 21:00:19 sauron /kernel: ed0 failed to probe at port 0x280-0x29f
iomem 0xd8000 irq 10 on isa0
Aug 24 21:00:19 sauron /kernel: fe0 failed to probe at port 0x300-0x31f on
isa0
Aug 24 21:00:19 sauron /kernel: ie0 failed to probe at port 0x300 iomem
0xd0000 irq 10 on isa0
Aug 24 21:00:19 sauron /kernel: lnc1 failed to probe at port 0x280 irq 10
drq 0 on isa0
Aug 24 21:00:19 sauron /kernel: cs0 failed to probe at port 0x300-0x31f on i
sa0
Aug 24 21:00:19 sauron /kernel: sn0 failed to probe at port 0x300-0x30f irq
10 on isa0
Aug 24 21:00:19 sauron /kernel: isa_probe_children: probing PnP devices
Aug 24 21:00:19 sauron /kernel: SMP: enabled INTs: 1, 2, 3, 4, 7, 10, 11,
14, 15, apic_imen: 0x00ff3361
Aug 24 21:00:19 sauron /kernel: BIOS Geometries:
Aug 24 21:00:19 sauron /kernel: 0:03fefe3f 0..1022=1023 cylinders,
0..254=255 heads, 1..63=63 sectors
Aug 24 21:00:19 sauron /kernel: 1:03fefe3f 0..1022=1023 cylinders,
0..254=255 heads, 1..63=63 sectors
Aug 24 21:00:19 sauron /kernel: 2:03fefe3f 0..1022=1023 cylinders,
0..254=255 heads, 1..63=63 sectors
Aug 24 21:00:19 sauron /kernel: 3:03fefe3f 0..1022=1023 cylinders,
0..254=255 heads, 1..63=63 sectors
Aug 24 21:00:19 sauron /kernel: 0 accounted for
Aug 24 21:00:19 sauron /kernel: Device configuration finished.
Aug 24 21:00:19 sauron /kernel: APIC_IO: Testing 8254 interrupt delivery
Aug 24 21:00:19 sauron /kernel: APIC_IO: routing 8254 via IOAPIC #0 intpin 2
Aug 24 21:00:19 sauron /kernel: bpf: lo0 attached
Aug 24 21:00:19 sauron /kernel: bpf: ppp0 attached
Aug 24 21:00:19 sauron /kernel: new masks: bio 6800c800, tty 6300009a, net
6700009e
Aug 24 21:00:19 sauron /kernel: bpf: sl0 attached
Aug 24 21:00:19 sauron /kernel: bpf: faith0 attached
Aug 24 21:00:19 sauron /kernel: ata0-master: piomode=4 dmamode=2 udmamode=-1
dmaflag=1
Aug 24 21:00:19 sauron /kernel: ata0-master: success setting PIO4 on generic
chip
Aug 24 21:00:19 sauron /kernel: SMP: AP CPU #1 Launched!
Aug 24 21:00:19 sauron /kernel: SMP: CPU1 apic_initialize():
Aug 24 21:00:19 sauron /kernel: lint0: 0x00010700 lint1: 0x00010400 TPR:
0x00000010 SVR: 0x000001ff
Aug 24 21:00:19 sauron /kernel: acd0: MODE_SENSE_BIG command timeout -
resetting
Aug 24 21:00:19 sauron /kernel: ata0: resetting devices .. ata0: mask=03
ostat0=51 ostat2=00
Aug 24 21:00:19 sauron /kernel: acd0: ATAPI 14 eb
Aug 24 21:00:19 sauron /kernel: ata0-slave: ATAPI 00 00
Aug 24 21:00:19 sauron /kernel: ata0: mask=03 stat0=00 stat1=00
Aug 24 21:00:19 sauron /kernel: ata0: devices=04
Aug 24 21:00:19 sauron /kernel: done
Aug 24 21:00:19 sauron /kernel: acd0: MODE_SENSE_BIG command timeout -
resetting
Aug 24 21:00:19 sauron /kernel: ata0: resetting devices .. ata0: mask=03
ostat0=08 ostat2=00
Aug 24 21:00:19 sauron /kernel: acd0: ATAPI 14 eb
Aug 24 21:00:19 sauron /kernel: ata0-slave: ATAPI 00 00
Aug 24 21:00:19 sauron /kernel: ata0: mask=03 stat0=00 stat1=00
Aug 24 21:00:19 sauron /kernel: ata0: devices=04
Aug 24 21:00:19 sauron /kernel: done
Aug 24 21:00:19 sauron /kernel: acd0: read data overrun 28/6
Aug 24 21:00:19 sauron /kernel: acd0: <CRD-8322B/1.07> CDROM drive at ata0
as master
Aug 24 21:00:19 sauron /kernel: acd0: read 500KB/s (4541KB/s), 1792KB
buffer, PIO4
Aug 24 21:00:19 sauron /kernel: acd0: Reads: CD-RW
Aug 24 21:00:19 sauron /kernel: acd0: Writes:
Aug 24 21:00:19 sauron /kernel: acd0: Mechanism: caddy
Aug 24 21:00:19 sauron /kernel: acd0: Medium: CD-ROM 120mm audio disc
Aug 24 21:00:19 sauron /kernel: Waiting 15 seconds for SCSI devices to
settle
Aug 24 21:00:19 sauron /kernel: (noperiph:ahc0:0:-1:-1): SCSI bus reset
delivered. 0 SCBs aborted.
Aug 24 21:00:19 sauron /kernel: (noperiph:ahc1:0:-1:-1): SCSI bus reset
delivered. 0 SCBs aborted.
Aug 24 21:00:19 sauron /kernel: (ahc1:A:0:0): Received WDTR 1 filtered to 0
Aug 24 21:00:19 sauron /kernel: (ahc1:A:0:0): Target Initiated WDTR
Aug 24 21:00:19 sauron /kernel: (ahc1:A:0:0): Sending WDTR 0
Aug 24 21:00:19 sauron /kernel: (ahc1:A:0:0): Received SDTR period c, offset
3e
Aug 24 21:00:19 sauron /kernel: Filtered to period 0, offset 0
Aug 24 21:00:19 sauron /kernel: (ahc1:A:0:0): Target Initiated SDTR
Aug 24 21:00:19 sauron /kernel: (ahc1:A:0:0): Sending SDTR period 0, offset
0
Aug 24 21:00:19 sauron /kernel: (ahc1:A:1:0): Received WDTR 1 filtered to 0
Aug 24 21:00:19 sauron /kernel: (ahc1:A:1:0): Target Initiated WDTR
Aug 24 21:00:19 sauron /kernel: (ahc1:A:1:0): Sending WDTR 0
Aug 24 21:00:19 sauron /kernel: (ahc1:A:1:0): Received SDTR period c, offset
f
Aug 24 21:00:19 sauron /kernel: Filtered to period 0, offset 0
Aug 24 21:00:19 sauron /kernel: (ahc1:A:1:0): Target Initiated SDTR
Aug 24 21:00:19 sauron /kernel: (ahc1:A:1:0): Sending SDTR period 0, offset
0
Aug 24 21:00:19 sauron /kernel: (ahc1:A:2:0): Received WDTR 1 filtered to 0
Aug 24 21:00:19 sauron /kernel: (ahc1:A:2:0): Target Initiated WDTR
Aug 24 21:00:19 sauron /kernel: (ahc1:A:2:0): Sending WDTR 0
Aug 24 21:00:19 sauron /kernel: (ahc1:A:2:0): Received SDTR period c, offset
3e
Aug 24 21:00:19 sauron /kernel: Filtered to period 0, offset 0
Aug 24 21:00:19 sauron /kernel: (ahc1:A:2:0): Target Initiated SDTR
Aug 24 21:00:19 sauron /kernel: (ahc1:A:2:0): Sending SDTR period 0, offset
0
Aug 24 21:00:19 sauron /kernel: (ahc1:A:0:0): Sending WDTR 1
Aug 24 21:00:19 sauron /kernel: (ahc1:A:0:0): Received WDTR 1 filtered to 1
Aug 24 21:00:20 sauron /kernel: ahc1: target 0 using 16bit transfers
Aug 24 21:00:20 sauron /kernel: (ahc1:A:0:0): Sending SDTR period c, offset
8
Aug 24 21:00:20 sauron /kernel: (ahc1:A:0:0): Received SDTR period c, offset
8
Aug 24 21:00:20 sauron /kernel: Filtered to period c, offset 8
Aug 24 21:00:20 sauron /kernel: ahc1: target 0 synchronous at 20.0MHz,
offset = 0x8
Aug 24 21:00:20 sauron /kernel: (ahc1:A:1:0): Sending WDTR 1
Aug 24 21:00:20 sauron /kernel: (ahc1:A:1:0): Received WDTR 1 filtered to 1
Aug 24 21:00:20 sauron /kernel: ahc1: target 1 using 16bit transfers
Aug 24 21:00:20 sauron /kernel: (ahc1:A:1:0): Sending SDTR period c, offset
8
Aug 24 21:00:20 sauron /kernel: (ahc1:A:1:0): Received SDTR period c, offset
8
Aug 24 21:00:20 sauron /kernel: Filtered to period c, offset 8
Aug 24 21:00:20 sauron /kernel: ahc1: target 1 synchronous at 20.0MHz,
offset = 0x8
Aug 24 21:00:20 sauron /kernel: (ahc1:A:2:0): Sending WDTR 1
Aug 24 21:00:20 sauron /kernel: (ahc1:A:2:0): Received WDTR 1 filtered to 1
Aug 24 21:00:20 sauron /kernel: ahc1: target 2 using 16bit transfers
Aug 24 21:00:20 sauron /kernel: (ahc1:A:2:0): Sending SDTR period c, offset
8
Aug 24 21:00:20 sauron /kernel: (ahc1:A:2:0): Received SDTR period c, offset
8
Aug 24 21:00:20 sauron /kernel: Filtered to period c, offset 8
Aug 24 21:00:20 sauron /kernel: ahc1: target 2 synchronous at 20.0MHz,
offset = 0x8
Aug 24 21:00:20 sauron /kernel: Creating DISK da0
Aug 24 21:00:20 sauron /kernel: Creating DISK da1
Aug 24 21:00:20 sauron /kernel: Creating DISK da2
Aug 24 21:00:20 sauron /kernel: pass0 at ahc1 bus 0 target 0 lun 0
Aug 24 21:00:20 sauron /kernel: pass0: <IBM-PSG DMVS09D !# 01B0> Fixed
Direct Access SCSI-3 device
Aug 24 21:00:20 sauron /kernel: pass0: Serial Number F804F4DC75
Aug 24 21:00:20 sauron /kernel: pass0: 40.000MB/s transfers (20.000MHz,
offset 8, 16bit), Tagged Queueing Enabled
Aug 24 21:00:20 sauron /kernel: pass1 at ahc1 bus 0 target 1 lun 0
Aug 24 21:00:20 sauron /kernel: pass1: <IBM-PSG ST39103LC !# B227> Fixed
Direct Access SCSI-2 device
Aug 24 21:00:20 sauron /kernel: pass1: Serial Number LS466998000010142VE8
Aug 24 21:00:20 sauron /kernel: pass1: 40.000MB/s transfers (20.000MHz,
offset 8, 16bit), Tagged Queueing Enabled
Aug 24 21:00:20 sauron /kernel: pass2 at ahc1 bus 0 target 2 lun 0
Aug 24 21:00:20 sauron /kernel: pass2: <IBM-PSG DMVS09D !# 01B0> Fixed
Direct Access SCSI-3 device
Aug 24 21:00:20 sauron /kernel: pass2: Serial Number F804FAC075
Aug 24 21:00:20 sauron /kernel: pass2: 40.000MB/s transfers (20.000MHz,
offset 8, 16bit), Tagged Queueing Enabled
Aug 24 21:00:20 sauron /kernel: pass3 at ahc1 bus 0 target 14 lun 0
Aug 24 21:00:20 sauron /kernel: pass3: <SDR GEM200 2> Fixed Processor SCSI-2
device
Aug 24 21:00:20 sauron /kernel: pass3: Serial Number 1
Aug 24 21:00:20 sauron /kernel: pass3: 3.300MB/s transfers
Aug 24 21:00:20 sauron /kernel: pass3 at ahc1 bus 0 target 14 lun 0
Aug 24 21:00:20 sauron /kernel: pass3: <SDR GEM200 2> Fixed Processor SCSI-2
device
Aug 24 21:00:20 sauron /kernel: pass3: Serial Number 1
Aug 24 21:00:20 sauron /kernel: pass3: 3.300MB/s transfers
Aug 24 21:00:20 sauron /kernel: da0 at ahc1 bus 0 target 0 lun 0
Aug 24 21:00:20 sauron /kernel: da0: <IBM-PSG DMVS09D !# 01B0> Fixed
Direct Access SCSI-3 device
Aug 24 21:00:20 sauron /kernel: da0: Serial Number F804F4DC75
Aug 24 21:00:20 sauron /kernel: da0: 40.000MB/s transfers (20.000MHz, offset
8, 16bit), Tagged Queueing Enabled
Aug 24 21:00:20 sauron /kernel: da0: 8678MB (17774160 512 byte sectors: 255H
63S/T 1106C)
Aug 24 21:00:20 sauron /kernel: da1 at ahc1 bus 0 target 1 lun 0
Aug 24 21:00:20 sauron /kernel: da1: <IBM-PSG ST39103LC !# B227> Fixed
Direct Access SCSI-2 device
Aug 24 21:00:20 sauron /kernel: da1: Serial Number LS466998000010142VE8
Aug 24 21:00:20 sauron /kernel: da1: 40.000MB/s transfers (20.000MHz, offset
8, 16bit), Tagged Queueing Enabled
Aug 24 21:00:20 sauron /kernel: da1: 8678MB (17774160 512 byte sectors: 255H
63S/T 1106C)
Aug 24 21:00:20 sauron /kernel: da2 at ahc1 bus 0 target 2 lun 0
Aug 24 21:00:20 sauron /kernel: da2: <IBM-PSG DMVS09D !# 01B0> Fixed
Direct Access SCSI-3 device
Aug 24 21:00:20 sauron /kernel: da2: Serial Number F804FAC075
Aug 24 21:00:20 sauron /kernel: da2: 40.000MB/s transfers (20.000MHz, offset
8, 16bit), Tagged Queueing Enabled
Aug 24 21:00:20 sauron /kernel: da2: 8678MB (17774160 512 byte sectors: 255H
63S/T 1106C)
Aug 24 21:00:20 sauron /kernel: Mounting root from ufs:/dev/da0s1a
Aug 24 21:00:20 sauron /kernel: da0s1: type 0xa5, start 63, end = 17767889,
size 17767827 : OK
Aug 24 21:00:20 sauron /kernel: start_init: trying /sbin/init
Aug 24 21:00:20 sauron /kernel: da1s1: type 0xa5, start 63, end = 17767889,
size 17767827 : OK
Aug 24 21:00:20 sauron /kernel: da2s1: type 0xa5, start 63, end = 17767889,
size 17767827 : OK



Jesper Skriver (25-08-2002)
Kommentar
Fra : Jesper Skriver


Dato : 25-08-02 13:27

On Sat, 24 Aug 2002 21:14:54 +0200, Barnabas wrote:

> Hej igen,
>
> Ja det er en standard ata disk:
> http://www.edbpriser.dk/hardware/hardware-top10.asp?ID=1374647961
> og controller:
> http://www.edbpriser.dk/hardware/hardware-top10.asp?ID=1314757893
>
> Jeg kan se at maskinen diskuterer med sig selv hvilket id den skal
> give diskene på ata, jeg mangler måske at nævne at der sidder en
> gammel controller på bundkortet (ATA) men iflg IBM er dette kun
> kompatibelt med CD_rom'en i maskinen. Det ved jeg ikke om jeg lige
> tror på, men under alle omstændigheder kan den gamle controller
> nok ikke fatte en disk på 120 giga, da SENSE BIG failede på den
> controller. Den fejl er forsvundet med den nye. Mit cd rom drev
> sidder stadig på det gamle og begge devices er dermed sat op som
> master på deres device. Hard disken er sat op som master på channel 0
> på raid controlleren, og det er det eneste device på kortet lige nu.
>
> Her kommer hele smøren:
>
> Aug 24 21:00:17 sauron /kernel: pci0: <PCI bus> on pcib0 unknown card>
> Aug 24 21:00:17 sauron /kernel: pci0: <(vendor=0x1095, dev=0x0680) at
> Aug 24 21:00:17 sauron /kernel: pci0: <1.0 irq 2

Her har du dit problem

Vendor 0x1095 = CMD Technology Inc.
device 0x0680 = PCI-0680 Ultra ATA133 EIDE Controller

ATA driveren kender ikke den controller

Prøv evt at tilføje følgende til /usr/src/sys/dev/ata/ata-pci.c
omkring linie 212 efter de andre CMD controllere

case 0x06801095:
   return "CMD 680 ATA133 controller";

Det skulle få den til at genkende controllere - men måske ikke
enable ATA133 osv.

--
Jesper Skriver, CCIE #5456
FreeBSD committer

Finn Lavlund (25-08-2002)
Kommentar
Fra : Finn Lavlund


Dato : 25-08-02 14:18


Jeg mangler hjælp til at finde løsning til en error message jeg får hver
gang jeg starter min linux rh7.3... computeren er single boot

Error while initializing the sound driver.
device /dev/dsp can´t be opened (no such device)
The sound server will continue, using the null output device.

jeg kan selvfølgelig ignorere beskeden.. men den irriterer mig når jeg
ved den stadig prøver at initialisere et lydkort jeg aldrig har haft i
maskinen..

håber der er hjælp at hente


Barnabas (25-08-2002)
Kommentar
Fra : Barnabas


Dato : 25-08-02 20:12

Og det virker!

Tusind tak for hjælpen, det virker faktisk at narre systemet til at tro at
ata133 er ata100. Så kan man så bare håbe på at der er en ata133 driver med
i freebsd5.0.

Freebsd styrer!

- Nico



Jesper Skriver (25-08-2002)
Kommentar
Fra : Jesper Skriver


Dato : 25-08-02 20:20

On Sun, 25 Aug 2002 21:11:57 +0200, Barnabas wrote:

> Og det virker!
>
> Tusind tak for hjælpen, det virker faktisk at narre systemet til at
> tro at ata133 er ata100.

ATA133 er det samme som ATA100 blot med en højere frekvens.

> Så kan man så bare håbe på at der er en ata133 driver med i
> freebsd5.0.

Det er der såfremt nogen tilføjer support for det, jeg ser på det.

--
Jesper Skriver, CCIE #5456
FreeBSD committer

Jesper Skriver (25-08-2002)
Kommentar
Fra : Jesper Skriver


Dato : 25-08-02 21:19

On 25 Aug 2002 19:19:46 GMT, Jesper Skriver wrote:
> On Sun, 25 Aug 2002 21:11:57 +0200, Barnabas wrote:
>
>> Og det virker!
>>
>> Tusind tak for hjælpen, det virker faktisk at narre systemet til at
>> tro at ata133 er ata100.
>
> ATA133 er det samme som ATA100 blot med en højere frekvens.
>
>> Så kan man så bare håbe på at der er en ata133 driver med i
>> freebsd5.0.
>
> Det er der såfremt nogen tilføjer support for det, jeg ser på det.

Prøv lige dette diff, det skull få den til at køre ATA133, hvis
der er nogen med HW dokumentation, så kan vi også få den til at
køre ATA133

Index: ata-dma.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-dma.c,v
retrieving revision 1.100
diff -u -r1.100 ata-dma.c
--- ata-dma.c   19 Jul 2002 22:14:54 -0000   1.100
+++ ata-dma.c   25 Aug 2002 20:12:48 -0000
@@ -738,6 +738,7 @@
   /* we could set PIO mode timings, but we assume the BIOS did that */
   break;

+ case 0x06801095:   /* CMD 680 ATA133 controller */
case 0x06491095:   /* CMD 649 ATA100 controller */
   if (udmamode >= 5) {
    u_int8_t umode;
Index: ata-pci.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-pci.c,v
retrieving revision 1.43
diff -u -r1.43 ata-pci.c
--- ata-pci.c   19 Jul 2002 22:14:54 -0000   1.43
+++ ata-pci.c   25 Aug 2002 20:12:48 -0000
@@ -205,6 +205,9 @@
   else
    return "SiS 5591 ATA33 controller";

+ case 0x06801095:
+   return "CMD 680 ATA133 controller";
+
case 0x06491095:
   return "CMD 649 ATA100 controller";


--
Jesper Skriver, CCIE #5456
FreeBSD committer

Jesper Skriver (26-08-2002)
Kommentar
Fra : Jesper Skriver


Dato : 26-08-02 08:36

On 25 Aug 2002 20:18:57 GMT, Jesper Skriver wrote:
> On 25 Aug 2002 19:19:46 GMT, Jesper Skriver wrote:
>> On Sun, 25 Aug 2002 21:11:57 +0200, Barnabas wrote:
>>
>>> Og det virker!
>>>
>>> Tusind tak for hjælpen, det virker faktisk at narre systemet til at
>>> tro at ata133 er ata100.
>>
>> ATA133 er det samme som ATA100 blot med en højere frekvens.
>>
>>> Så kan man så bare håbe på at der er en ata133 driver med i
>>> freebsd5.0.
>>
>> Det er der såfremt nogen tilføjer support for det, jeg ser på det.
>
> Prøv lige dette diff, det skull få den til at køre ATA133, hvis
> der er nogen med HW dokumentation, så kan vi også få den til at
> køre ATA133

Endnu bedre, prøv denne fra ATA maintaineren Søren Schmidt

Index: ata-dma.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-dma.c,v
retrieving revision 1.100
diff -u -r1.100 ata-dma.c
--- ata-dma.c   19 Jul 2002 22:14:54 -0000   1.100
+++ ata-dma.c   20 Aug 2002 18:29:14 -0000
@@ -738,6 +738,88 @@
   /* we could set PIO mode timings, but we assume the BIOS did that */
   break;

+ case 0x06801095:   /* Sil 0680 ATA133 controller */
+   {
+    u_int8_t ureg = 0xac + (device * 0x02) + (channel * 0x10);
+    u_int8_t uval = pci_read_config(parent, ureg, 1);
+    u_int8_t mreg = channel ? 0x84 : 0x80;
+    u_int8_t mask = device ? 0x30 : 0x03;
+    u_int8_t mode = pci_read_config(parent, mreg, 1);
+
+    /* enable UDMA mode */
+    pci_write_config(parent, mreg,
+          (mode & ~mask) | (device ? 0x30 : 0x03), 1);
+     if (udmamode >= 6) {
+      error = ata_command(atadev, ATA_C_SETFEATURES, 0,
+             ATA_UDMA6, ATA_C_F_SETXFER, ATA_WAIT_READY);
+      if (bootverbose)
+       ata_prtdev(atadev, "%s setting UDMA6 on Sil chip\n",
+          (error) ? "failed" : "success");
+      if (!error) {
+       pci_write_config(parent, ureg, (uval & 0x3f) | 0x01, 1);
+       ata_dmacreate(atadev, apiomode, ATA_UDMA6);
+       return;
+      }
+    }
+     if (udmamode >= 5) {
+      error = ata_command(atadev, ATA_C_SETFEATURES, 0,
+             ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
+      if (bootverbose)
+       ata_prtdev(atadev, "%s setting UDMA5 on Sil chip\n",
+          (error) ? "failed" : "success");
+      if (!error) {
+       pci_write_config(parent, ureg, (uval & 0x3f) | 0x02, 1);
+       ata_dmacreate(atadev, apiomode, ATA_UDMA5);
+       return;
+      }
+    }
+     if (udmamode >= 4) {
+      error = ata_command(atadev, ATA_C_SETFEATURES, 0,
+             ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
+      if (bootverbose)
+       ata_prtdev(atadev, "%s setting UDMA4 on Sil chip\n",
+          (error) ? "failed" : "success");
+      if (!error) {
+       pci_write_config(parent, ureg, (uval & 0x3f) | 0x03, 1);
+       ata_dmacreate(atadev, apiomode, ATA_UDMA4);
+       return;
+      }
+    }
+     if (udmamode >= 2) {
+      error = ata_command(atadev, ATA_C_SETFEATURES, 0,
+             ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
+      if (bootverbose)
+       ata_prtdev(atadev, "%s setting UDMA2 on Sil chip\n",
+          (error) ? "failed" : "success");
+      if (!error) {
+       pci_write_config(parent, ureg, (uval & 0x3f) | 0x07, 1);
+       ata_dmacreate(atadev, apiomode, ATA_UDMA2);
+       return;
+      }
+    }
+
+    /* disable UDMA mode and enable WDMA mode */
+    pci_write_config(parent, mreg,
+          (mode & ~mask) | (device ? 0x20 : 0x02), 1);
+    if (wdmamode >= 2 && apiomode >= 4) {
+      error = ata_command(atadev, ATA_C_SETFEATURES, 0,
+             ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
+      if (bootverbose)
+       ata_prtdev(atadev, "%s setting WDMA2 on Sil chip\n",
+          (error) ? "failed" : "success");
+      if (!error) {
+       pci_write_config(parent, ureg - 0x4, 0x10c1, 2);
+       ata_dmacreate(atadev, apiomode, ATA_WDMA2);
+       return;
+      }
+    }
+
+    /* restore PIO mode */
+    pci_write_config(parent, mreg, mode, 1);
+   }
+   /* we could set PIO mode timings, but we assume the BIOS did that */
+   break;
+
case 0x06491095:   /* CMD 649 ATA100 controller */
   if (udmamode >= 5) {
    u_int8_t umode;
Index: ata-pci.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-pci.c,v
retrieving revision 1.43
diff -u -r1.43 ata-pci.c
--- ata-pci.c   19 Jul 2002 22:14:54 -0000   1.43
+++ ata-pci.c   20 Aug 2002 18:28:05 -0000
@@ -205,6 +205,9 @@
   else
    return "SiS 5591 ATA33 controller";

+ case 0x06801095:
+   return "Sil 0680 ATA133 controller";
+
case 0x06491095:
   return "CMD 649 ATA100 controller";

@@ -503,6 +506,14 @@
   pci_write_config(dev, 0x5a,
          (pci_read_config(dev, 0x5a, 1) & ~0x40) |
          (pci_get_revid(dev) >= 0x92) ? 0x03 : 0x02, 1);
+   break;
+
+ case 0x06801095: /* Sil 0680 set ATA reference clock speed */
+   if (pci_read_config(dev, 0x8a, 1) != 0x10)
+    pci_write_config(dev, 0x8a,
+          (pci_read_config(dev, 0x8a, 1) & 0x30) | 0x10, 1);
+   if (pci_read_config(dev, 0x8a, 1) != 0x10)
+ device_printf(dev, "Sil 0680 could not set ATA clock\n");
   break;

case 0x06461095: /* CMD 646 enable interrupts, set DMA read mode */


--
Jesper Skriver, CCIE #5456
FreeBSD committer

Barnabas (26-08-2002)
Kommentar
Fra : Barnabas


Dato : 26-08-02 13:01

Jeg skal prøve det snarest muligt og poste svaret her. Var det ikke en
god ide, at lave dette forløb til en howto eller en FAQ på
freebsd.org?

Jeg kan da umuligt være den eneste der roder med dette, da ata 133
controllere vel næsten er standard nu.

Barnabas (26-08-2002)
Kommentar
Fra : Barnabas


Dato : 26-08-02 19:34

Giver flg:

[2030][anh@sauron:/usr/src/sys/compile/Kernel25082002]$ sudo make
cc -c -O -pipe -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extens
ions -ansi -nostdinc -I- -I. -I../.. -I/usr/include -I../../contrib/ipfilte
r -D_KERNEL -include opt_global.h -elf -mpreferred-stack-boundary=2
.../../dev/ata/ata-dma.c
.../../dev/ata/ata-dma.c: In function `ata_dmainit':
.../../dev/ata/ata-dma.c:613: `channel' undeclared (first use in this
function)
.../../dev/ata/ata-dma.c:613: (Each undeclared identifier is reported only
once
.../../dev/ata/ata-dma.c:613: for each function it appears in.)
.../../dev/ata/ata-dma.c:630: warning: implicit declaration of function
`ata_dmacreate'
*** Error code 1

Stop in /usr/src/sys/compile/Kernel25082002.





Barnabas (26-08-2002)
Kommentar
Fra : Barnabas


Dato : 26-08-02 21:30

/*-
* Copyright (c) 1998,1999,2000,2001,2002 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer,
* without modification, immediately at the beginning of the file.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD: src/sys/dev/ata/ata-dma.c,v 1.35.2.25 2002/04/18 19:14:04 sos
Exp $
*/

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/ata.h>
#include <sys/buf.h>
#include <sys/malloc.h>
#include <sys/bus.h>
#include <sys/disk.h>
#include <sys/devicestat.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <pci/pcivar.h>
#include <machine/bus.h>
#include <sys/rman.h>
#include <dev/ata/ata-all.h>

/* prototypes */
static void cyrix_timing(struct ata_channel *, int, int);
static void promise_timing(struct ata_channel *, int, int);
static void hpt_timing(struct ata_channel *, int, int);
static int hpt_cable80(struct ata_channel *);

/* misc defines */
#ifdef __alpha__
#undef vtophys
#define vtophys(va) alpha_XXX_dmamap((vm_offset_t)va)
#endif
#define ATAPI_DEVICE(ch, device) \
((device == ATA_MASTER && ch->devices & ATA_ATAPI_MASTER) || \
(device == ATA_SLAVE && ch->devices & ATA_ATAPI_SLAVE))

void *
ata_dmaalloc(struct ata_channel *ch, int device)
{
void *dmatab;

if ((dmatab = malloc(PAGE_SIZE, M_DEVBUF, M_NOWAIT))) {
if (((uintptr_t)dmatab >> PAGE_SHIFT) ^
(((uintptr_t)dmatab + PAGE_SIZE - 1) >> PAGE_SHIFT)) {
ata_printf(ch, device, "dmatab crosses page boundary, no DMA\n");
free(dmatab, M_DEVBUF);
dmatab = NULL;
}
}
return dmatab;
}

void
ata_dmainit(struct ata_channel *ch, int device,
int apiomode, int wdmamode, int udmamode)
{
struct ata_device *atadev = &ch->device[ATA_DEV(device)];
device_t parent = device_get_parent(ch->dev);
int devno = (ch->unit << 1) + ATA_DEV(device);
int error;

/* set our most pessimistic default mode */
atadev->mode = ATA_PIO;

if (!ch->r_bmio)
return;

/* if simplex controller, only allow DMA on primary channel */
if (ch->unit == 1) {
ATA_OUTB(ch->r_bmio, ATA_BMSTAT_PORT,
ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT) &
(ATA_BMSTAT_DMA_MASTER | ATA_BMSTAT_DMA_SLAVE));
if (ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT) & ATA_BMSTAT_DMA_SIMPLEX) {
ata_prtdev(atadev, "simplex device, DMA on primary only\n");
return;
}
}

/* DMA engine address alignment is usually 1 word (2 bytes) */
ch->alignment = 0x1;

#if 1
if (udmamode > 2 && !ch->device[ATA_DEV(device)].param->hwres_cblid) {
ata_prtdev(atadev,"DMA limited to UDMA33, non-ATA66 cable or device\n");
udmamode = 2;
}
#endif
switch (ch->chiptype) {

case 0x248a8086: /* Intel ICH3 mobile */
case 0x248b8086: /* Intel ICH3 */
case 0x244a8086: /* Intel ICH2 mobile */
case 0x244b8086: /* Intel ICH2 */
if (udmamode >= 5) {
int32_t mask48, new48;
int16_t word54;

word54 = pci_read_config(parent, 0x54, 2);
if (word54 & (0x10 << devno)) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA5, ATA_C_F_SETXFER,ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA5 on Intel chip\n",
(error) ? "failed" : "success");
if (!error) {
mask48 = (1 << devno) + (3 << (16 + (devno << 2)));
new48 = (1 << devno) + (1 << (16 + (devno << 2)));
pci_write_config(parent, 0x48,
(pci_read_config(parent, 0x48, 4) &
~mask48) | new48, 4);
pci_write_config(parent, 0x54, word54 | (0x1000<<devno), 2);
atadev->mode = ATA_UDMA5;
return;
}
}
}
/* make sure eventual ATA100 mode from the BIOS is disabled */
pci_write_config(parent, 0x54,
pci_read_config(parent, 0x54, 2) & ~(0x1000<<devno),2);
/* FALLTHROUGH */

case 0x24118086: /* Intel ICH */
case 0x76018086: /* Intel ICH */
if (udmamode >= 4) {
int32_t mask48, new48;
int16_t word54;

word54 = pci_read_config(parent, 0x54, 2);
if (word54 & (0x10 << devno)) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA4 on Intel chip\n",
(error) ? "failed" : "success");
if (!error) {
mask48 = (1 << devno) + (3 << (16 + (devno << 2)));
new48 = (1 << devno) + (2 << (16 + (devno << 2)));
pci_write_config(parent, 0x48,
(pci_read_config(parent, 0x48, 4) &
~mask48) | new48, 4);
pci_write_config(parent, 0x54, word54 | (1 << devno), 2);
atadev->mode = ATA_UDMA4;
return;
}
}
}
/* make sure eventual ATA66 mode from the BIOS is disabled */
pci_write_config(parent, 0x54,
pci_read_config(parent, 0x54, 2) & ~(1 << devno), 2);
/* FALLTHROUGH */

case 0x71118086: /* Intel PIIX4 */
case 0x84CA8086: /* Intel PIIX4 */
case 0x71998086: /* Intel PIIX4e */
case 0x24218086: /* Intel ICH0 */
if (udmamode >= 2) {
int32_t mask48, new48;

error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA2 on Intel chip\n",
(error) ? "failed" : "success");
if (!error) {
mask48 = (1 << devno) + (3 << (16 + (devno << 2)));
new48 = (1 << devno) + (2 << (16 + (devno << 2)));
pci_write_config(parent, 0x48,
(pci_read_config(parent, 0x48, 4) &
~mask48) | new48, 4);
atadev->mode = ATA_UDMA2;
return;
}
}
/* make sure eventual ATA33 mode from the BIOS is disabled */
pci_write_config(parent, 0x48,
pci_read_config(parent, 0x48, 4) & ~(1 << devno), 4);
/* FALLTHROUGH */

case 0x70108086: /* Intel PIIX3 */
if (wdmamode >= 2 && apiomode >= 4) {
int32_t mask40, new40, mask44, new44;

/* if SITRE not set doit for both channels */
if (!((pci_read_config(parent,0x40,4)>>(ch->unit<<8))&0x4000)) {
new40 = pci_read_config(parent, 0x40, 4);
new44 = pci_read_config(parent, 0x44, 4);
if (!(new40 & 0x00004000)) {
new44 &= ~0x0000000f;
new44 |= ((new40&0x00003000)>>10)|((new40&0x00000300)>>8);
}
if (!(new40 & 0x40000000)) {
new44 &= ~0x000000f0;
new44 |= ((new40&0x30000000)>>22)|((new40&0x03000000)>>20);
}
new40 |= 0x40004000;
pci_write_config(parent, 0x40, new40, 4);
pci_write_config(parent, 0x44, new44, 4);
}
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting WDMA2 on Intel chip\n",
(error) ? "failed" : "success");
if (!error) {
if (device == ATA_MASTER) {
mask40 = 0x0000330f;
new40 = 0x00002307;
mask44 = 0;
new44 = 0;
}
else {
mask40 = 0x000000f0;
new40 = 0x00000070;
mask44 = 0x0000000f;
new44 = 0x0000000b;
}
if (ch->unit) {
mask40 <<= 16;
new40 <<= 16;
mask44 <<= 4;
new44 <<= 4;
}
pci_write_config(parent, 0x40,
(pci_read_config(parent, 0x40, 4) & ~mask40)|
new40, 4);
pci_write_config(parent, 0x44,
(pci_read_config(parent, 0x44, 4) & ~mask44)|
new44, 4);
atadev->mode = ATA_WDMA2;
return;
}
}
/* we could set PIO mode timings, but we assume the BIOS did that */
break;

case 0x12308086: /* Intel PIIX */
if (wdmamode >= 2 && apiomode >= 4) {
int32_t word40;

word40 = pci_read_config(parent, 0x40, 4);
word40 >>= ch->unit * 16;

/* Check for timing config usable for DMA on controller */
if (!((word40 & 0x3300) == 0x2300 &&
((word40 >> (device == ATA_MASTER ? 0 : 4)) & 1) == 1))
break;

error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting WDMA2 on Intel chip\n",
(error) ? "failed" : "success");
if (!error) {
atadev->mode = ATA_WDMA2;
return;
}
}
break;

case 0x522910b9: /* AcerLabs Aladdin IV/V */
/* the older Aladdin doesn't support ATAPI DMA on both master & slave */
if (pci_get_revid(parent) < 0xc2 &&
ch->devices & ATA_ATAPI_MASTER && ch->devices & ATA_ATAPI_SLAVE) {
ata_prtdev(atadev, "two atapi devices on this channel, no DMA\n");
break;
}
if (udmamode >= 5 && pci_get_revid(parent) >= 0xc4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA5 on Acer chip\n",
(error) ? "failed" : "success");
if (!error) {
int32_t word54 = pci_read_config(parent, 0x54, 4);

pci_write_config(parent, 0x4b,
pci_read_config(parent, 0x4b, 1) | 0x01, 1);
word54 &= ~(0x000f000f << (devno << 2));
word54 |= (0x000f0005 << (devno << 2));
pci_write_config(parent, 0x54, word54, 4);
pci_write_config(parent, 0x53,
pci_read_config(parent, 0x53, 1) | 0x03, 1);
atadev->mode = ATA_UDMA5;
return;
}
}
if (udmamode >= 4 && pci_get_revid(parent) >= 0xc2) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA4 on Acer chip\n",
(error) ? "failed" : "success");
if (!error) {
int32_t word54 = pci_read_config(parent, 0x54, 4);

pci_write_config(parent, 0x4b,
pci_read_config(parent, 0x4b, 1) | 0x01, 1);
word54 &= ~(0x000f000f << (devno << 2));
word54 |= (0x00080005 << (devno << 2));
pci_write_config(parent, 0x54, word54, 4);
pci_write_config(parent, 0x53,
pci_read_config(parent, 0x53, 1) | 0x03, 1);
atadev->mode = ATA_UDMA4;
return;
}
}
if (udmamode >= 2 && pci_get_revid(parent) >= 0x20) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA2 on Acer chip\n",
(error) ? "failed" : "success");
if (!error) {
int32_t word54 = pci_read_config(parent, 0x54, 4);

word54 &= ~(0x000f000f << (devno << 2));
word54 |= (0x000a0005 << (devno << 2));
pci_write_config(parent, 0x54, word54, 4);
pci_write_config(parent, 0x53,
pci_read_config(parent, 0x53, 1) | 0x03, 1);
ch->flags |= ATA_ATAPI_DMA_RO;
atadev->mode = ATA_UDMA2;
return;
}
}

/* make sure eventual UDMA mode from the BIOS is disabled */
pci_write_config(parent, 0x56, pci_read_config(parent, 0x56, 2) &
~(0x0008 << (devno << 2)), 2);

if (wdmamode >= 2 && apiomode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting WDMA2 on Acer chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, 0x53,
pci_read_config(parent, 0x53, 1) | 0x03, 1);
ch->flags |= ATA_ATAPI_DMA_RO;
atadev->mode = ATA_WDMA2;
return;
}
}
pci_write_config(parent, 0x53,
(pci_read_config(parent, 0x53, 1) & ~0x01) | 0x02, 1);
/* we could set PIO mode timings, but we assume the BIOS did that */
break;

case 0x01bc10de: /* nVIDIA nForce */
case 0x74411022: /* AMD 768 */
case 0x74111022: /* AMD 766 */
case 0x74091022: /* AMD 756 */
case 0x05711106: /* VIA 82C571, 82C586, 82C596, 82C686 , 8231, 8233 */
{
int via_modes[5][7] = {
{ 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00 }, /* ATA33 */
{ 0x00, 0x00, 0xea, 0x00, 0xe8, 0x00, 0x00 }, /* ATA66 */
{ 0x00, 0x00, 0xf4, 0x00, 0xf1, 0xf0, 0x00 }, /* ATA100 */
{ 0x00, 0x00, 0xf6, 0x00, 0xf2, 0xf1, 0xf0 }, /* VIA ATA133 */
{ 0x00, 0x00, 0xc0, 0x00, 0xc5, 0xc6, 0x00 }}; /* AMD/nVIDIA */
int *reg_val = NULL;
char *chip = "VIA";

if (ata_find_dev(parent, 0x31471106, 0)) { /* 8233a */
udmamode = imin(udmamode, 6);
reg_val = via_modes[3];
}
else if (ata_find_dev(parent, 0x06861106, 0x40) || /* 82C686b */
ata_find_dev(parent, 0x82311106, 0) || /* 8231 */
ata_find_dev(parent, 0x30741106, 0) || /* 8233 */
ata_find_dev(parent, 0x31091106, 0)) { /* 8233c */
udmamode = imin(udmamode, 5);
reg_val = via_modes[2];
}
else if (ata_find_dev(parent, 0x06861106, 0x10) || /* 82C686a */
ata_find_dev(parent, 0x05961106, 0x12)) { /* 82C596b */
udmamode = imin(udmamode, 4);
reg_val = via_modes[1];
}
else if (ata_find_dev(parent, 0x06861106, 0)) { /* 82C686 */
udmamode = imin(udmamode, 2);
reg_val = via_modes[1];
}
else if (ata_find_dev(parent, 0x05961106, 0) || /* 82C596a */
ata_find_dev(parent, 0x05861106, 0x03)) { /* 82C586b */
udmamode = imin(udmamode, 2);
reg_val = via_modes[0];
}
else if (ch->chiptype == 0x74411022 || /* AMD 768 */
ch->chiptype == 0x74111022) { /* AMD 766 */
udmamode = imin(udmamode, 5);
reg_val = via_modes[4];
chip = "AMD";
}
else if (ch->chiptype == 0x74091022) { /* AMD 756 */
udmamode = imin(udmamode, 4);
reg_val = via_modes[4];
chip = "AMD";
}
else if (ch->chiptype == 0x01bc10de) { /* nVIDIA */
udmamode = imin(udmamode, 5);
reg_val = via_modes[4];
chip = "nVIDIA";
}
else
udmamode = 0;

if (udmamode >= 6) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA6, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA6 on %s chip\n",
(error) ? "failed" : "success", chip);
if (!error) {
pci_write_config(parent, 0x53 - devno, reg_val[6], 1);
atadev->mode = ATA_UDMA6;
return;
}
}
if (udmamode >= 5) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA5 on %s chip\n",
(error) ? "failed" : "success", chip);
if (!error) {
pci_write_config(parent, 0x53 - devno, reg_val[5], 1);
atadev->mode = ATA_UDMA5;
return;
}
}
if (udmamode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA4 on %s chip\n",
(error) ? "failed" : "success", chip);
if (!error) {
pci_write_config(parent, 0x53 - devno, reg_val[4], 1);
atadev->mode = ATA_UDMA4;
return;
}
}
if (udmamode >= 2) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA2 on %s chip\n",
(error) ? "failed" : "success", chip);
if (!error) {
pci_write_config(parent, 0x53 - devno, reg_val[2], 1);
atadev->mode = ATA_UDMA2;
return;
}
}
if (wdmamode >= 2 && apiomode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting WDMA2 on %s chip\n",
(error) ? "failed" : "success", chip);
if (!error) {
pci_write_config(parent, 0x53 - devno, 0x0b, 1);
pci_write_config(parent, 0x4b - devno, 0x31, 1);
atadev->mode = ATA_WDMA2;
return;
}
}
}
/* we could set PIO mode timings, but we assume the BIOS did that */
break;

case 0x55131039: /* SiS 5591 */
if (ata_find_dev(parent, 0x06301039, 0x30) || /* SiS 630 */
ata_find_dev(parent, 0x06331039, 0) || /* SiS 633 */
ata_find_dev(parent, 0x06351039, 0) || /* SiS 635 */
ata_find_dev(parent, 0x06401039, 0) || /* SiS 640 */
ata_find_dev(parent, 0x06451039, 0) || /* SiS 645 */
ata_find_dev(parent, 0x06501039, 0) || /* SiS 650 */
ata_find_dev(parent, 0x07301039, 0) || /* SiS 730 */
ata_find_dev(parent, 0x07331039, 0) || /* SiS 733 */
ata_find_dev(parent, 0x07351039, 0) || /* SiS 735 */
ata_find_dev(parent, 0x07401039, 0) || /* SiS 740 */
ata_find_dev(parent, 0x07451039, 0) || /* SiS 745 */
ata_find_dev(parent, 0x07501039, 0)) { /* SiS 750 */
int8_t reg = 0x40 + (devno << 1);
int16_t val = pci_read_config(parent, reg, 2) & 0x0fff;

if (udmamode >= 5) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA5 on SiS chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, reg, val | 0x8000, 2);
atadev->mode = ATA_UDMA5;
return;
}
}
if (udmamode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA4 on SiS chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, reg, val | 0x9000, 2);
atadev->mode = ATA_UDMA4;
return;
}
}
if (udmamode >= 2) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA2 on SiS chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, reg, val | 0xb000, 2);
atadev->mode = ATA_UDMA2;
return;
}
}
} else if (ata_find_dev(parent, 0x05301039, 0) || /* SiS 530 */
ata_find_dev(parent, 0x05401039, 0) || /* SiS 540 */
ata_find_dev(parent, 0x06201039, 0) || /* SiS 620 */
ata_find_dev(parent, 0x06301039, 0)) { /* SiS 630 */
int8_t reg = 0x40 + (devno << 1);
int16_t val = pci_read_config(parent, reg, 2) & 0x0fff;

if (udmamode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA4 on SiS chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, reg, val | 0x9000, 2);
atadev->mode = ATA_UDMA4;
return;
}
}
if (udmamode >= 2) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA2 on SiS chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, reg, val | 0xa000, 2);
atadev->mode = ATA_UDMA2;
return;
}
}
} else if (udmamode >= 2 && pci_get_revid(parent) > 0xc1) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA2 on SiS chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, 0x40 + (devno << 1), 0xa301, 2);
atadev->mode = ATA_UDMA2;
return;
}
}
if (wdmamode >=2 && apiomode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting WDMA2 on SiS chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, 0x40 + (devno << 1), 0x0301, 2);
atadev->mode = ATA_WDMA2;
return;
}
}
/* we could set PIO mode timings, but we assume the BIOS did that */
break;

// nico add start


case 0x06801095: /* Sil 0680 ATA133 controller */
{
u_int8_t ureg = 0xac + (device * 0x02) + (channel * 0x10);
u_int8_t uval = pci_read_config(parent, ureg, 1);
u_int8_t mreg = channel ? 0x84 : 0x80;
u_int8_t mask = device ? 0x30 : 0x03;
u_int8_t mode = pci_read_config(parent, mreg, 1);

/* enable UDMA mode */
pci_write_config(parent, mreg,
(mode & ~mask) | (device ? 0x30 : 0x03), 1);
if (udmamode >= 6) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA6, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA6 on Sil chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, ureg, (uval & 0x3f) | 0x01, 1);
ata_dmacreate(atadev, apiomode, ATA_UDMA6);
return;
}
}
if (udmamode >= 5) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA5 on Sil chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, ureg, (uval & 0x3f) | 0x02, 1);
ata_dmacreate(atadev, apiomode, ATA_UDMA5);
return;
}
}
if (udmamode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA4 on Sil chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, ureg, (uval & 0x3f) | 0x03, 1);
ata_dmacreate(atadev, apiomode, ATA_UDMA4);
return;
}
}
if (udmamode >= 2) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA2 on Sil chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, ureg, (uval & 0x3f) | 0x07, 1);
ata_dmacreate(atadev, apiomode, ATA_UDMA2);
return;
}
}

/* disable UDMA mode and enable WDMA mode */
pci_write_config(parent, mreg,
(mode & ~mask) | (device ? 0x20 : 0x02), 1);
if (wdmamode >= 2 && apiomode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting WDMA2 on Sil chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, ureg - 0x4, 0x10c1, 2);
ata_dmacreate(atadev, apiomode, ATA_WDMA2);
return;
}
}

/* restore PIO mode */
pci_write_config(parent, mreg, mode, 1);
}
/* we could set PIO mode timings, but we assume the BIOS did that */
break;


// nico add slut

case 0x06491095: /* CMD 649 ATA100 controller */
if (udmamode >= 5) {
u_int8_t umode;

error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA5 on CMD chip\n",
(error) ? "failed" : "success");
if (!error) {
umode = pci_read_config(parent, ch->unit ? 0x7b : 0x73, 1);
umode &= ~(device == ATA_MASTER ? 0x35 : 0xca);
umode |= (device == ATA_MASTER ? 0x05 : 0x0a);
pci_write_config(parent, ch->unit ? 0x7b : 0x73, umode, 1);
atadev->mode = ATA_UDMA5;
return;
}
}
/* FALLTHROUGH */

case 0x06481095: /* CMD 648 ATA66 controller */
if (udmamode >= 4) {
u_int8_t umode;

error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA4 on CMD chip\n",
(error) ? "failed" : "success");
if (!error) {
umode = pci_read_config(parent, ch->unit ? 0x7b : 0x73, 1);
umode &= ~(device == ATA_MASTER ? 0x35 : 0xca);
umode |= (device == ATA_MASTER ? 0x15 : 0x4a);
pci_write_config(parent, ch->unit ? 0x7b : 0x73, umode, 1);
atadev->mode = ATA_UDMA4;
return;
}
}
if (udmamode >= 2) {
u_int8_t umode;

error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA2 on CMD chip\n",
(error) ? "failed" : "success");
if (!error) {
umode = pci_read_config(parent, ch->unit ? 0x7b : 0x73, 1);
umode &= ~(device == ATA_MASTER ? 0x35 : 0xca);
umode |= (device == ATA_MASTER ? 0x11 : 0x42);
pci_write_config(parent, ch->unit ? 0x7b : 0x73, umode, 1);
atadev->mode = ATA_UDMA2;
return;
}
}
/* make sure eventual UDMA mode from the BIOS is disabled */
pci_write_config(parent, ch->unit ? 0x7b : 0x73,
pci_read_config(parent, ch->unit ? 0x7b : 0x73, 1)&
~(device == ATA_MASTER ? 0x35 : 0xca), 1);
/* FALLTHROUGH */

case 0x06461095: /* CMD 646 ATA controller */
if (wdmamode >= 2 && apiomode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting WDMA2 on CMD chip\n",
error ? "failed" : "success");
if (!error) {
int32_t offset = (devno < 3) ? (devno << 1) : 7;

pci_write_config(parent, 0x54 + offset, 0x3f, 1);
atadev->mode = ATA_WDMA2;
return;
}
}
/* we could set PIO mode timings, but we assume the BIOS did that */
break;

case 0xc6931080: /* Cypress 82c693 ATA controller */
if (wdmamode >= 2 && apiomode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting WDMA2 on Cypress chip\n",
error ? "failed" : "success");
if (!error) {
pci_write_config(ch->dev, ch->unit ? 0x4e:0x4c, 0x2020, 2);
atadev->mode = ATA_WDMA2;
return;
}
}
/* we could set PIO mode timings, but we assume the BIOS did that */
break;

case 0x01021078: /* Cyrix 5530 ATA33 controller */
ch->alignment = 0xf; /* DMA engine requires 16 byte alignment */
if (udmamode >= 2) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA2 on Cyrix chip\n",
(error) ? "failed" : "success");
if (!error) {
cyrix_timing(ch, devno, ATA_UDMA2);
atadev->mode = ATA_UDMA2;
return;
}
}
if (wdmamode >= 2 && apiomode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting WDMA2 on Cyrix chip\n",
(error) ? "failed" : "success");
if (!error) {
cyrix_timing(ch, devno, ATA_WDMA2);
atadev->mode = ATA_WDMA2;
return;
}
}
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_PIO0 + apiomode, ATA_C_F_SETXFER,
ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting %s on Cyrix chip\n",
(error) ? "failed" : "success",
ata_mode2str(ATA_PIO0 + apiomode));
cyrix_timing(ch, devno, ATA_PIO0 + apiomode);
atadev->mode = ATA_PIO0 + apiomode;
return;

case 0x02121166: /* ServerWorks CSB5 ATA66/100 controller */
if (udmamode >= 5 && pci_get_revid(parent) >= 0x92) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA5 on ServerWorks chip\n",
(error) ? "failed" : "success");
if (!error) {
u_int16_t reg56;

pci_write_config(parent, 0x54,
pci_read_config(parent, 0x54, 1) |
(0x01 << devno), 1);
reg56 = pci_read_config(parent, 0x56, 2);
reg56 &= ~(0xf << (devno * 4));
reg56 |= (0x5 << (devno * 4));
pci_write_config(parent, 0x56, reg56, 2);
atadev->mode = ATA_UDMA5;
return;
}
}
if (udmamode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA4 on ServerWorks chip\n",
(error) ? "failed" : "success");
if (!error) {
u_int16_t reg56;

pci_write_config(parent, 0x54,
pci_read_config(parent, 0x54, 1) |
(0x01 << devno), 1);
reg56 = pci_read_config(parent, 0x56, 2);
reg56 &= ~(0xf << (devno * 4));
reg56 |= (0x4 << (devno * 4));
pci_write_config(parent, 0x56, reg56, 2);
atadev->mode = ATA_UDMA4;
return;
}
}
/* FALLTHROUGH */

case 0x02111166: /* ServerWorks ROSB4 ATA33 controller */
if (udmamode >= 2) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA2 on ServerWorks chip\n",
(error) ? "failed" : "success");
if (!error) {
u_int16_t reg56;

pci_write_config(parent, 0x54,
pci_read_config(parent, 0x54, 1) |
(0x01 << devno), 1);
reg56 = pci_read_config(parent, 0x56, 2);
reg56 &= ~(0xf << (devno * 4));
reg56 |= (0x2 << (devno * 4));
pci_write_config(parent, 0x56, reg56, 2);
atadev->mode = ATA_UDMA2;
return;
}
}
if (wdmamode >= 2 && apiomode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting WDMA2 on ServerWorks chip\n",
(error) ? "failed" : "success");
if (!error) {
int offset = (ch->unit * 2) + (device == ATA_MASTER);
int word44 = pci_read_config(parent, 0x44, 4);

pci_write_config(parent, 0x54,
pci_read_config(parent, 0x54, 1) &
~(0x01 << devno), 1);
word44 &= ~(0xff << (offset << 8));
word44 |= (0x20 << (offset << 8));
pci_write_config(parent, 0x44, 0x20, 4);
atadev->mode = ATA_WDMA2;
return;
}
}
/* we could set PIO mode timings, but we assume the BIOS did that */
break;

case 0x4d69105a: /* Promise TX2 ATA133 controllers */
case 0x5275105a: /* Promise TX2 ATA133 controllers */
case 0x6269105a: /* Promise TX2 ATA133 controllers */
ATA_OUTB(ch->r_bmio, ATA_BMDEVSPEC_0, 0x0b);
if (udmamode >= 6 && !(ATA_INB(ch->r_bmio, ATA_BMDEVSPEC_1) & 0x04)) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA6, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA6 on Promise chip\n",
(error) ? "failed" : "success");
if (!error) {
atadev->mode = ATA_UDMA6;
return;
}
}
/* FALLTHROUGH */

case 0x4d68105a: /* Promise TX2 ATA100 controllers */
case 0x6268105a: /* Promise TX2 ATA100 controllers */
ATA_OUTB(ch->r_bmio, ATA_BMDEVSPEC_0, 0x0b);
if (udmamode >= 5 && !(ATA_INB(ch->r_bmio, ATA_BMDEVSPEC_1) & 0x04)) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA5 on Promise chip\n",
(error) ? "failed" : "success");
if (!error) {
atadev->mode = ATA_UDMA5;
return;
}
}
ATA_OUTB(ch->r_bmio, ATA_BMDEVSPEC_0, 0x0b);
if (udmamode >= 4 && !(ATA_INB(ch->r_bmio, ATA_BMDEVSPEC_1) & 0x04)) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA4 on Promise chip\n",
(error) ? "failed" : "success");
if (!error) {
atadev->mode = ATA_UDMA4;
return;
}
}
if (udmamode >= 2) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA on Promise chip\n",
(error) ? "failed" : "success");
if (!error) {
atadev->mode = ATA_UDMA2;
return;
}
}
if (wdmamode >= 2 && apiomode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting WDMA2 on Promise chip\n",
(error) ? "failed" : "success");
if (!error) {
atadev->mode = ATA_WDMA2;
return;
}
}
break;

case 0x4d30105a: /* Promise Ultra/FastTrak 100 controllers */
case 0x0d30105a: /* Promise OEM ATA100 controllers */
if (!ATAPI_DEVICE(ch, device) && udmamode >= 5 &&
!(pci_read_config(parent, 0x50, 2)&(ch->unit ? 1<<11 : 1<<10))){
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA5 on Promise chip\n",
(error) ? "failed" : "success");
if (!error) {
promise_timing(ch, devno, ATA_UDMA5);
atadev->mode = ATA_UDMA5;
return;
}
}
/* FALLTHROUGH */

case 0x4d38105a: /* Promise Ultra/FastTrak 66 controllers */
if (!ATAPI_DEVICE(ch, device) && udmamode >= 4 &&
!(pci_read_config(parent, 0x50, 2)&(ch->unit ? 1<<11 : 1<<10))){
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA4 on Promise chip\n",
(error) ? "failed" : "success");
if (!error) {
promise_timing(ch, devno, ATA_UDMA4);
atadev->mode = ATA_UDMA4;
return;
}
}
/* FALLTHROUGH */

case 0x4d33105a: /* Promise Ultra/FastTrak 33 controllers */
if (!ATAPI_DEVICE(ch, device) && udmamode >= 2) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA2 on Promise chip\n",
(error) ? "failed" : "success");
if (!error) {
promise_timing(ch, devno, ATA_UDMA2);
atadev->mode = ATA_UDMA2;
return;
}
}
if (!ATAPI_DEVICE(ch, device) && wdmamode >= 2 && apiomode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting WDMA2 on Promise chip\n",
(error) ? "failed" : "success");
if (!error) {
promise_timing(ch, devno, ATA_WDMA2);
atadev->mode = ATA_WDMA2;
return;
}
}
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_PIO0 + apiomode,
ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting PIO%d on Promise chip\n",
(error) ? "failed" : "success",
(apiomode >= 0) ? apiomode : 0);
promise_timing(ch, devno, ATA_PIO0 + apiomode);
atadev->mode = ATA_PIO0 + apiomode;
return;

case 0x00041103: /* HighPoint HPT366/368/370/372 controllers */
case 0x00051103: /* HighPoint HPT372 controllers */
case 0x00081103: /* HighPoint HPT374 controllers */
if (!ATAPI_DEVICE(ch, device) && udmamode >= 6 && hpt_cable80(ch) &&
((ch->chiptype == 0x00041103 && pci_get_revid(parent) >= 0x05) ||
(ch->chiptype == 0x00051103 && pci_get_revid(parent) >= 0x01) ||
(ch->chiptype == 0x00081103 && pci_get_revid(parent) >= 0x07))) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA6, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA6 on HighPoint chip\n",
(error) ? "failed" : "success");
if (!error) {
hpt_timing(ch, devno, ATA_UDMA6);
atadev->mode = ATA_UDMA6;
return;
}
}
if (!ATAPI_DEVICE(ch, device) && udmamode >= 5 && hpt_cable80(ch) &&
((ch->chiptype == 0x00041103 && pci_get_revid(parent) >= 0x03) ||
(ch->chiptype == 0x00051103 && pci_get_revid(parent) >= 0x01) ||
(ch->chiptype == 0x00081103 && pci_get_revid(parent) >= 0x07))) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA5 on HighPoint chip\n",
(error) ? "failed" : "success");
if (!error) {
hpt_timing(ch, devno, ATA_UDMA5);
atadev->mode = ATA_UDMA5;
return;
}
}
if (!ATAPI_DEVICE(ch, device) && udmamode >= 4 && hpt_cable80(ch)) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA4 on HighPoint chip\n",
(error) ? "failed" : "success");
if (!error) {
hpt_timing(ch, devno, ATA_UDMA4);
atadev->mode = ATA_UDMA4;
return;
}
}
if (!ATAPI_DEVICE(ch, device) && udmamode >= 2) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting UDMA2 on HighPoint chip\n",
(error) ? "failed" : "success");
if (!error) {
hpt_timing(ch, devno, ATA_UDMA2);
atadev->mode = ATA_UDMA2;
return;
}
}
if (!ATAPI_DEVICE(ch, device) && wdmamode >= 2 && apiomode >= 4) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting WDMA2 on HighPoint chip\n",
(error) ? "failed" : "success");
if (!error) {
hpt_timing(ch, devno, ATA_WDMA2);
atadev->mode = ATA_WDMA2;
return;
}
}
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_PIO0 + apiomode,
ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting PIO%d on HighPoint chip\n",
(error) ? "failed" : "success",
(apiomode >= 0) ? apiomode : 0);
hpt_timing(ch, devno, ATA_PIO0 + apiomode);
atadev->mode = ATA_PIO0 + apiomode;
return;

case 0x000116ca: /* Cenatek Rocket Drive controller */
if (wdmamode >= 0 &&
(ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT) &
((device==ATA_MASTER)?ATA_BMSTAT_DMA_MASTER:ATA_BMSTAT_DMA_SLAVE)))
atadev->mode = ATA_DMA;
else
atadev->mode = ATA_PIO;
return;

default: /* unknown controller chip */
/* better not try generic DMA on ATAPI devices it almost never works */
if ((device == ATA_MASTER && ch->devices & ATA_ATAPI_MASTER) ||
(device == ATA_SLAVE && ch->devices & ATA_ATAPI_SLAVE))
break;

/* if controller says its setup for DMA take the easy way out */
/* the downside is we dont know what DMA mode we are in */
if ((udmamode >= 0 || wdmamode >= 2) &&
(ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT) &
((device==ATA_MASTER) ?
ATA_BMSTAT_DMA_MASTER : ATA_BMSTAT_DMA_SLAVE))) {
atadev->mode = ATA_DMA;
return;
}

/* well, we have no support for this, but try anyways */
if ((wdmamode >= 2 && apiomode >= 4) && ch->r_bmio) {
error = ata_command(atadev, ATA_C_SETFEATURES, 0,
ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting WDMA2 on generic chip\n",
(error) ? "failed" : "success");
if (!error) {
atadev->mode = ATA_WDMA2;
return;
}
}
}
error = ata_command(atadev, ATA_C_SETFEATURES, 0, ATA_PIO0 + apiomode,
ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
ata_prtdev(atadev, "%s setting PIO%d on generic chip\n",
(error) ? "failed" : "success", apiomode < 0 ? 0 : apiomode);
if (!error)
atadev->mode = ATA_PIO0 + apiomode;
else {
if (bootverbose)
ata_prtdev(atadev, "using PIO mode set by BIOS\n");
atadev->mode = ATA_PIO;
}
}

int
ata_dmasetup(struct ata_channel *ch, int device, struct ata_dmaentry
*dmatab,
caddr_t data, int32_t count)
{
u_int32_t dma_count, dma_base;
int i = 0;

if (((uintptr_t)data & ch->alignment) || (count & ch->alignment)) {
ata_printf(ch, device, "non aligned DMA transfer attempted\n");
return -1;
}

if (!count) {
ata_printf(ch, device, "zero length DMA transfer attempted\n");
return -1;
}

dma_base = vtophys(data);
dma_count = imin(count, (PAGE_SIZE - ((uintptr_t)data & PAGE_MASK)));
data += dma_count;
count -= dma_count;

while (count) {
dmatab[i].base = dma_base;
dmatab[i].count = (dma_count & 0xffff);
i++;
if (i >= ATA_DMA_ENTRIES) {
ata_printf(ch, device, "too many segments in DMA table\n");
return -1;
}
dma_base = vtophys(data);
dma_count = imin(count, PAGE_SIZE);
data += imin(count, PAGE_SIZE);
count -= imin(count, PAGE_SIZE);
}
dmatab[i].base = dma_base;
dmatab[i].count = (dma_count & 0xffff) | ATA_DMA_EOT;
return 0;
}

void
ata_dmastart(struct ata_channel *ch, int device,
struct ata_dmaentry *dmatab, int dir)
{
ch->flags |= ATA_DMA_ACTIVE;
ATA_OUTL(ch->r_bmio, ATA_BMDTP_PORT, vtophys(dmatab));
ATA_OUTB(ch->r_bmio, ATA_BMCMD_PORT, dir ? ATA_BMCMD_WRITE_READ : 0);
ATA_OUTB(ch->r_bmio, ATA_BMSTAT_PORT,
(ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT) |
(ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR)));
ATA_OUTB(ch->r_bmio, ATA_BMCMD_PORT,
ATA_INB(ch->r_bmio, ATA_BMCMD_PORT) | ATA_BMCMD_START_STOP);
}

int
ata_dmadone(struct ata_channel *ch)
{
int error;

ATA_OUTB(ch->r_bmio, ATA_BMCMD_PORT,
ATA_INB(ch->r_bmio, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP);
ch->flags &= ~ATA_DMA_ACTIVE;
error = ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT);
ATA_OUTB(ch->r_bmio, ATA_BMSTAT_PORT,
error | ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR);
return error & ATA_BMSTAT_MASK;
}

int
ata_dmastatus(struct ata_channel *ch)
{
return ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK;
}

static void
cyrix_timing(struct ata_channel *ch, int devno, int mode)
{
u_int32_t reg20 = 0x0000e132;
u_int32_t reg24 = 0x00017771;

switch (mode) {
case ATA_PIO0: reg20 = 0x0000e132; break;
case ATA_PIO1: reg20 = 0x00018121; break;
case ATA_PIO2: reg20 = 0x00024020; break;
case ATA_PIO3: reg20 = 0x00032010; break;
case ATA_PIO4: reg20 = 0x00040010; break;
case ATA_WDMA2: reg24 = 0x00002020; break;
case ATA_UDMA2: reg24 = 0x00911030; break;
}
ATA_OUTL(ch->r_bmio, (devno << 3) + 0x20, reg20);
ATA_OUTL(ch->r_bmio, (devno << 3) + 0x24, reg24);
}

static void
promise_timing(struct ata_channel *ch, int devno, int mode)
{
u_int32_t timing = 0;
struct promise_timing {
u_int8_t pa:4;
u_int8_t prefetch:1;
u_int8_t iordy:1;
u_int8_t errdy:1;
u_int8_t syncin:1;
u_int8_t pb:5;
u_int8_t mb:3;
u_int8_t mc:4;
u_int8_t dmaw:1;
u_int8_t dmar:1;
u_int8_t iordyp:1;
u_int8_t dmarqp:1;
u_int8_t reserved:8;
} *t = (struct promise_timing*)&timing;

t->iordy = 1; t->iordyp = 1;
if (mode >= ATA_DMA) {
t->prefetch = 1; t->errdy = 1; t->syncin = 1;
}

switch (ch->chiptype) {
case 0x4d33105a: /* Promise Ultra/Fasttrak 33 */
switch (mode) {
default:
case ATA_PIO0: t->pa = 9; t->pb = 19; t->mb = 7; t->mc = 15; break;
case ATA_PIO1: t->pa = 5; t->pb = 12; t->mb = 7; t->mc = 15; break;
case ATA_PIO2: t->pa = 3; t->pb = 8; t->mb = 7; t->mc = 15; break;
case ATA_PIO3: t->pa = 2; t->pb = 6; t->mb = 7; t->mc = 15; break;
case ATA_PIO4: t->pa = 1; t->pb = 4; t->mb = 7; t->mc = 15; break;
case ATA_WDMA2: t->pa = 3; t->pb = 7; t->mb = 3; t->mc = 3; break;
case ATA_UDMA2: t->pa = 3; t->pb = 7; t->mb = 1; t->mc = 1; break;
}
break;

case 0x4d38105a: /* Promise Ultra/Fasttrak 66 */
case 0x4d30105a: /* Promise Ultra/Fasttrak 100 */
case 0x0d30105a: /* Promise OEM ATA 100 */
switch (mode) {
default:
case ATA_PIO0: t->pa = 15; t->pb = 31; t->mb = 7; t->mc = 15; break;
case ATA_PIO1: t->pa = 10; t->pb = 24; t->mb = 7; t->mc = 15; break;
case ATA_PIO2: t->pa = 6; t->pb = 16; t->mb = 7; t->mc = 15; break;
case ATA_PIO3: t->pa = 4; t->pb = 12; t->mb = 7; t->mc = 15; break;
case ATA_PIO4: t->pa = 2; t->pb = 8; t->mb = 7; t->mc = 15; break;
case ATA_WDMA2: t->pa = 6; t->pb = 14; t->mb = 6; t->mc = 6; break;
case ATA_UDMA2: t->pa = 6; t->pb = 14; t->mb = 2; t->mc = 2; break;
case ATA_UDMA4: t->pa = 3; t->pb = 7; t->mb = 1; t->mc = 1; break;
case ATA_UDMA5: t->pa = 3; t->pb = 7; t->mb = 1; t->mc = 1; break;
}
break;
}
pci_write_config(device_get_parent(ch->dev), 0x60 + (devno<<2), timing,
4);
}

static void
hpt_timing(struct ata_channel *ch, int devno, int mode)
{
device_t parent = device_get_parent(ch->dev);
u_int32_t timing;

if (ch->chiptype == 0x00081103 && pci_get_revid(parent) >= 0x07) {
switch (mode) { /* HPT374 */
case ATA_PIO0: timing = 0x0ac1f48a; break;
case ATA_PIO1: timing = 0x0ac1f465; break;
case ATA_PIO2: timing = 0x0a81f454; break;
case ATA_PIO3: timing = 0x0a81f443; break;
case ATA_PIO4: timing = 0x0a81f442; break;
case ATA_WDMA2: timing = 0x22808242; break;
case ATA_UDMA2: timing = 0x120c8242; break;
case ATA_UDMA4: timing = 0x12ac8242; break;
case ATA_UDMA5: timing = 0x12848242; break;
case ATA_UDMA6: timing = 0x12808242; break;
default: timing = 0x0d029d5e;
}
}
else if ((ch->chiptype == 0x00041103 && pci_get_revid(parent) >= 0x05)
||
(ch->chiptype == 0x00051103 && pci_get_revid(parent) >= 0x01)) {
switch (mode) { /* HPT372 */
case ATA_PIO0: timing = 0x0d029d5e; break;
case ATA_PIO1: timing = 0x0d029d26; break;
case ATA_PIO2: timing = 0x0c829ca6; break;
case ATA_PIO3: timing = 0x0c829c84; break;
case ATA_PIO4: timing = 0x0c829c62; break;
case ATA_WDMA2: timing = 0x2c829262; break;
case ATA_UDMA2: timing = 0x1c91dc62; break;
case ATA_UDMA4: timing = 0x1c8ddc62; break;
case ATA_UDMA5: timing = 0x1c6ddc62; break;
case ATA_UDMA6: timing = 0x1c81dc62; break;
default: timing = 0x0d029d5e;
}
}
else if (ch->chiptype == 0x00041103 && pci_get_revid(parent) >= 0x03) {
switch (mode) { /* HPT370 */
case ATA_PIO0: timing = 0x06914e57; break;
case ATA_PIO1: timing = 0x06914e43; break;
case ATA_PIO2: timing = 0x06514e33; break;
case ATA_PIO3: timing = 0x06514e22; break;
case ATA_PIO4: timing = 0x06514e21; break;
case ATA_WDMA2: timing = 0x26514e21; break;
case ATA_UDMA2: timing = 0x16494e31; break;
case ATA_UDMA4: timing = 0x16454e31; break;
case ATA_UDMA5: timing = 0x16454e31; break;
default: timing = 0x06514e57;
}
pci_write_config(parent, 0x40 + (devno << 2) , timing, 4);
}
else { /* HPT36[68] */
switch (pci_read_config(parent, 0x41 + (devno << 2), 1)) {
case 0x85: /* 25Mhz */
switch (mode) {
case ATA_PIO0: timing = 0x40d08585; break;
case ATA_PIO1: timing = 0x40d08572; break;
case ATA_PIO2: timing = 0x40ca8542; break;
case ATA_PIO3: timing = 0x40ca8532; break;
case ATA_PIO4: timing = 0x40ca8521; break;
case ATA_WDMA2: timing = 0x20ca8521; break;
case ATA_UDMA2: timing = 0x10cf8521; break;
case ATA_UDMA4: timing = 0x10c98521; break;
default: timing = 0x01208585;
}
break;
default:
case 0xa7: /* 33MHz */
switch (mode) {
case ATA_PIO0: timing = 0x40d0a7aa; break;
case ATA_PIO1: timing = 0x40d0a7a3; break;
case ATA_PIO2: timing = 0x40d0a753; break;
case ATA_PIO3: timing = 0x40c8a742; break;
case ATA_PIO4: timing = 0x40c8a731; break;
case ATA_WDMA2: timing = 0x20c8a731; break;
case ATA_UDMA2: timing = 0x10caa731; break;
case ATA_UDMA4: timing = 0x10c9a731; break;
default: timing = 0x0120a7a7;
}
break;
case 0xd9: /* 40Mhz */
switch (mode) {
case ATA_PIO0: timing = 0x4018d9d9; break;
case ATA_PIO1: timing = 0x4010d9c7; break;
case ATA_PIO2: timing = 0x4010d997; break;
case ATA_PIO3: timing = 0x4010d974; break;
case ATA_PIO4: timing = 0x4008d963; break;
case ATA_WDMA2: timing = 0x2008d943; break;
case ATA_UDMA2: timing = 0x100bd943; break;
case ATA_UDMA4: timing = 0x100fd943; break;
default: timing = 0x0120d9d9;
}
}
}
pci_write_config(parent, 0x40 + (devno << 2) , timing, 4);
}

static int
hpt_cable80(struct ata_channel *ch)
{
device_t parent = device_get_parent(ch->dev);
u_int8_t reg, val, res;

if (ch->chiptype == 0x00081103 && pci_get_function(parent) == 1) {
reg = ch->unit ? 0x57 : 0x53;
val = pci_read_config(parent, reg, 1);
pci_write_config(parent, reg, val | 0x80, 1);
}
else {
reg = 0x5b;
val = pci_read_config(parent, reg, 1);
pci_write_config(parent, reg, val & 0xfe, 1);
}
res = pci_read_config(parent, 0x5a, 1) & (ch->unit ? 0x01 : 0x02);
pci_write_config(parent, reg, val, 1);
return !res;
}



Adam Sjøgren (26-08-2002)
Kommentar
Fra : Adam Sjøgren


Dato : 26-08-02 14:04

On Mon, 26 Aug 2002 12:01:19 GMT, barnabasdk wrote:

> Jeg skal prøve det snarest muligt og poste svaret her. Var det ikke
> en god ide, at lave dette forløb til en howto eller en FAQ på
> freebsd.org?

Mon ikke at det kommer med i næste udgave, når det er vedligeholderen
der har lavet den seneste patch?


Mvh.

--
"It's only work if somebody makes you do it." Adam Sjøgren
asjo@koldfront.dk

Jesper Skriver (26-08-2002)
Kommentar
Fra : Jesper Skriver


Dato : 26-08-02 18:46

On Mon, 26 Aug 2002 15:04:17 +0200, Adam Sjøgren wrote:

> On Mon, 26 Aug 2002 12:01:19 GMT, barnabasdk wrote:
>
>> Jeg skal prøve det snarest muligt og poste svaret her. Var det
>> ikke en god ide, at lave dette forløb til en howto eller en FAQ på
>> freebsd.org?
>
> Mon ikke at det kommer med i næste udgave, når det er vedligeholderen
> der har lavet den seneste patch?

Det kan vi vist roligt regne med.

--
Jesper Skriver, CCIE #5456
FreeBSD committer

Peter Makholm (26-08-2002)
Kommentar
Fra : Peter Makholm


Dato : 26-08-02 21:45

"Barnabas" <SPAMbarnabasdk@yahoo.com> writes:

> /*-
> * Copyright (c) 1998,1999,2000,2001,2002 Søren Schmidt <sos@FreeBSD.org>
> * All rights reserved.

[...]

> * $FreeBSD: src/sys/dev/ata/ata-dma.c,v 1.35.2.25 2002/04/18 19:14:04 sos
> Exp $
> */

Kan du ikke en anden gang nøjes med en URL. Du kunne for eksempel have
brugt:

<http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/sys/dev/ata/ata-dma.c?rev=1.35.2.25>
eller
<http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/ata/ata-dma.c?rev=1.35.2.25&content-type=text/x-cvsweb-markup>

Ved den sidste URL ville folk endda let kun finde en nyere udgave af filen.

--
Peter Makholm | We constantly have to keep in mind why natural
peter@makholm.net | languages are good at what they're good at. And to
http://hacking.dk | never forget that Perl is a human language first,
| and a computer language second

Barnabas (27-08-2002)
Kommentar
Fra : Barnabas


Dato : 27-08-02 10:15

Du skal vel hente filen et eller andet sted fra? Den fylder det samme.

Desuden taler vi ikke om sidste nye version men den jeg postede.

- Nico

Søg
Reklame
Statistik
Spørgsmål : 177557
Tips : 31968
Nyheder : 719565
Indlæg : 6408868
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste