History log of /haiku-fatelf/src/add-ons/kernel/busses/scsi/ahci/ahci_port.cpp
Revision Date Author Comments
# 5ec5667d 28-Jan-2013 Axel Dörfler <axeld@pinc-software.de>

ata/ahci: Move some ATA functionality into the ATAInfoBlock.

* The AHCI driver was actually ignoring sector size information, and always
set the size to 512.
* Now both, the AHCI driver, and the ATA bus manager, use the same method of
retrieving the sector count, and size.


# 50af89af 28-Nov-2012 Michael Lotz <mmlr@mlotz.ch>

Put the swapped ATA model/serial strings into the SCSI inquiry.

The ATA info block has the model, serial and firmware revision byte
swapped that we already converted and then printed out correctly. The
original values were however copied to the SCSI inquiry data so the
device names that end up in different places were incorrect. This
fixes #7926.

Also added a comment explaining that there's way too little space in
the SCSI inquiry block to fit in the full ATA data.


# 3c521617 14-Sep-2012 Marcus Overhagen <marcus@overhagen.de>

implement support for harddisks bigger than 2TB
* can't test this, it's untested, but similar to ATADevice.cpp
* should no longer panic when hdd > 2TB is connected
* fix request completition in two error cases
* add const to some parameters


# a63b046e 14-Sep-2012 Marcus Overhagen <marcus@overhagen.de>

add missing line breaks in debug output


# 886f1456 02-Aug-2012 Rene Gollent <anevilyak@gmail.com>

Printf format adjustments to get ahci building on x86_64.


# b937bd21 08-Jun-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

ahci: Initial TRIM work

* Since ahci devices are emulated as scsi, we use
the SAS style TRIM call (unmap in scsi write same)
* This prevents the need for special, one off trim
calls.
* We don't perform the TRIM just yet, just laying
the goundwork for the request.


# 7c8e5614 05-Jun-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

ATA: Display trim support of ata disk


# 44954094 03-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Abort the request instead of crashing when out of memory.


# 3553f189 21-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Use the correct type for physical addresses.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37219 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 64d79eff 27-May-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changed physical_entry::{address,size} to phys_{addr,size}_t and changed
map_physical_memory()'s physicalAddress parameter type from void* to
phys_addr_t. This breaks source compatibility, but -- as long as
phys_{addr,size}_t remain 32 bit wide -- keeps binary compatibility with
BeOS.
* Adjusted all code using the affected interfaces (Oh what fun!). Added a few
TODOs in places where the wrong types (e.g. void* for physical addresses
are used). Looks like quite a few drivers aren't 64 bit safe and others
will break with PAE.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36960 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 31794499 26-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Renamed ATAInfoblock.h to ATAInfoBlock.h.
* Fixed copyright as pointed out by Ingo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36480 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dba5fcae 21-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Use the ATAInfoblock.h header file instead of redoing it somehow.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36412 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a2f24998 21-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Style and automatic whitespace cleanup, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36410 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 87b68ba0 10-Sep-2009 Marcus Overhagen <marcusoverhagen@gmail.com>

cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33045 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 501ba967 08-Sep-2009 Marcus Overhagen <marcusoverhagen@gmail.com>

remove color usage from debug output


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33004 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e10fbc44 12-Jun-2009 Michael Lotz <mmlr@mlotz.ch>

Not really sure why the inquiry command was special cased on ATAPI, but it
prevents tools that try to read other inquiry pages (like cdrecord) from getting
the required infos. This way the inquiry command is sent to the ATAPI device,
which seems to work fine (at least for the drive I have here).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31019 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1d4c4d3a 12-Jun-2009 Michael Lotz <mmlr@mlotz.ch>

* Call PostReset() at the end of ResetPort() as it's always used in that way.
* Reset the port directly after executing a command failed instead of letting
the next call do the reset first. This is arbitrary but looks cleaner to me.
* Provide a way to check if a given sata_request is a SCSI_OP_TEST_UNIT_READY
over ATAPI and use this info to calm down all error output. This avoids
spamming the syslog with error output on each media status poll when no disk
is present in a ATAPI device.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31014 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d60fa63b 15-Mar-2009 Axel Dörfler <axeld@pinc-software.de>

* Turned off sync debug output.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29542 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 22e22417 02-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

* Fixed a race condition where the interrupt for a command happened before
the thread issuing the command called acquire_sem_etc() on the semaphore
that the interrupt handler would otherwise release. The semaphore is now
released unconditionally, but to prevent the race condition that the
B_RELEASE_IF_WAITING_ONLY was trying to avoid, it is released with the
spinlock held.
* The error interrupt handler did not reset the fCommandsActive flag, but
it seemed to us like it should do that.
* WaitForTransfer now also acquires the spinlock to reset fCommandsActive,
which may be unnecessary but does not harm either.
* Cleanup of some long lines, sorry for mixing that with the actual fix.

Fixes bug #2359 (long pauses when accessing the disk).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26223 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d7c32123 01-Jul-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Set transfer length when doing ATAPI transfers.
Dump ATAPI command packet on error.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26205 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1c8de858 01-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added optional spinlock contention measurement feature. Enabled when
B_DEBUG_SPINLOCK_CONTENTION is defined to 1. It typedefs spinlock to a
structure (thus breaking BeOS binary compatibility), containing a
counter which is incremented whenever a thread has to wait for the
spinlock.
* Added macros for spinlock initialization and access and changed
code using spinlocks accordingly. This breaks compilation for BeOS --
the macros should be defined in the respective compatibility wrappers.
* Added generic syscall to get the spinlock counters for the thread and
the team spinlocks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25752 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d53ddcce 24-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Provide better sense data. Turn off auto-sense
for ATAPI, as we can't report anything.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25653 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 205acfb4 24-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

first attempt to report sense data


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25652 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b54c7094 24-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Use scsi direction mask to determine if the command to execute is a write,
instead of checking every single command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25650 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ec5161c7 24-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

add more error handling


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25649 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 88bd06fb 24-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Separate port and device reset. Only perform device reset during error handling if the device is busy.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25648 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c3342cf8 24-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

added simple error handling


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25647 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 47386374 21-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

The AHCI controller doesn't natively support ATAPI commands.
Instead, one needs to execute the ATA command 0xa0 (PACKET) using
a normal ATA PIO FIS and in addition fill the SCSI CDB into the ACMD
space to transfer the ATAPI PACKET command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25597 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fd735f9b 20-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

More preparation for sending ATAPI PACKET commands (pass through of SCSI commands).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25585 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c940faf1 20-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

disable "identify device" debug output


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25581 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6e251c66 20-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

moved tracing into it's own header


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25579 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5d92f82a 20-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Begin ATAPI support. The scsi_cd driver already tries opening the device.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25576 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 11a1e0e5 18-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Trace address of prd table.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25553 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c1b9831b 02-May-2008 Bruno G. Albuquerque <bga@bug-br.org.br>

- Moved AHCI_PORT_TRACING define to its correct position.
- Prepend "ahci port" to all trace entries in ahci_port.cpp.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25293 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 110d4031 02-May-2008 Bruno G. Albuquerque <bga@bug-br.org.br>

- Added AHCI port tracing (Only PRD table tracing for now).
- Added controller attribute to the AHCIPort class for debugging purposes.

AHCI is failing whenever the PRD table has an address above the 2048 Mb mark.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25291 a95241bf-73f2-0310-859d-f6bbb57e9c96


# de5c8292 05-Jan-2008 Jérôme Duval <korli@users.berlios.de>

fix gcc4 build


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23259 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b830be90 05-Jan-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Marked some bits as RWC and RW1.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23256 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0762289b 05-Jan-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Cleanup ccb->data_length handling.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23255 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ebd99341 05-Jan-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Fixed a copy&paste error. scsi_cmd_rw_10 has only a 16 bit length field,
while scsi_cmd_rw_12 has a 32 bit field. As both are big endian, that
error shouldn't have caused any problem or data corruption.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23254 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ec2bf719 04-Jan-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Implemented ExecuteSataRequest() to execute all ATA and (later) ATAPI commands.
Converted Identify Device and Read / Write commands, they now create a sata_request
and pass it to ExecuteSataRequest. Added support for cache flushing.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23250 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c374980 19-Nov-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

improved debug output


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22958 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 79844706 10-Nov-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Propagate is-ATAPI restriction to the SCSI bus manager.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22874 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c134c7b0 01-Oct-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

disable some debug output


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22394 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bfd9a59f 30-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

This enable write support. The driver should be useable now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22387 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a2a169fe 30-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Improved interrupt handling
Removed DBC_I interrupt
Reduce debug output


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22386 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ea44575a 30-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Cleanup, improved error handling, fix setting of DBC_I bit


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22385 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0845746b 29-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Cleanup, device present detection improved.
Added support for non-48-bit LBA, added write support.
Proper error handling still missing, write support disabled for your protection.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22376 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 55d356bd 28-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

check for device presence before executing commands


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22367 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 21b4398f 28-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

don't set the "clear on RX_OK" bits


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22363 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f5ea6b32 28-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

added debugging code


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22362 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6b8c1c2a 28-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

improved prd table handling


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22361 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2bf99ebd 28-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Added byte swapping of identify device strings.
Added capacity reporting.
Wait for interrupts to finish transfers.
Added lba 48-bit read support.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22360 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2ae9d564 28-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

added scatter gather prd table setup, implement scsi inquiry command and emulate test unit ready


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22354 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a1a08606 28-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22346 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4af29ec0 25-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Implemented a identify device command for further testing, works on Intel, doesn't work on Jmicron.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22312 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2c766017 25-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Cleanup of hard reset, works on Intel, doesn't work on Jmicron.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22307 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c32beda5 24-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

start dma later, reduce timeouts


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22298 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fab4e5b1 24-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

oops


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22295 a95241bf-73f2-0310-859d-f6bbb57e9c96


# de372c5c 24-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

wait for phy communication


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22294 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 22cf14cf 24-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

perform port reset and wait for devices to be detected


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22293 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8961bec0 23-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

try to activate link and spin up the device


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22280 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cb8be294 22-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Start and stop DMA engine and FIS receive, enable port interrupts.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22278 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 63399028 19-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Setup command list, command table, FIS and PRDT pointers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22257 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9382f576 11-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

correct port number handling
allocate memory for command list and fis


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22221 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 25f926d8 01-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

forward scsi request to the ports


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22146 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4f733fe9 01-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

added Interrupt handling framework


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22145 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9815383e 01-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

a class for the SATA ports


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22143 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c5216179e02f3b711bbac9c021f821ad3628cc7 14-Sep-2012 Marcus Overhagen <marcus@overhagen.de>

implement support for harddisks bigger than 2TB
* can't test this, it's untested, but similar to ATADevice.cpp
* should no longer panic when hdd > 2TB is connected
* fix request completition in two error cases
* add const to some parameters


# a63b046e90d48e47b2b88a519057b43344976f90 14-Sep-2012 Marcus Overhagen <marcus@overhagen.de>

add missing line breaks in debug output


# 886f1456afb2fa1c6fdae82cde908e5e3e4217d4 02-Aug-2012 Rene Gollent <anevilyak@gmail.com>

Printf format adjustments to get ahci building on x86_64.


# b937bd211c37af1cbd71f58ab0b1f272020f1103 08-Jun-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

ahci: Initial TRIM work

* Since ahci devices are emulated as scsi, we use
the SAS style TRIM call (unmap in scsi write same)
* This prevents the need for special, one off trim
calls.
* We don't perform the TRIM just yet, just laying
the goundwork for the request.


# 7c8e561489a7c3b66094fc7fe704c14f0992f09e 05-Jun-2012 Alexander von Gluck IV <kallisti5@unixzen.com>

ATA: Display trim support of ata disk


# 44954094997c3f1e7ceb8c9826768b679f87152d 03-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Abort the request instead of crashing when out of memory.


# 3553f1894dc98c2124813b2393aa9e80f11de2bb 21-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Use the correct type for physical addresses.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37219 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 64d79eff7290437d24b1a420537c3ed5c144ab96 27-May-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Changed physical_entry::{address,size} to phys_{addr,size}_t and changed
map_physical_memory()'s physicalAddress parameter type from void* to
phys_addr_t. This breaks source compatibility, but -- as long as
phys_{addr,size}_t remain 32 bit wide -- keeps binary compatibility with
BeOS.
* Adjusted all code using the affected interfaces (Oh what fun!). Added a few
TODOs in places where the wrong types (e.g. void* for physical addresses
are used). Looks like quite a few drivers aren't 64 bit safe and others
will break with PAE.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36960 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 31794499331ff7359c7757b4a972030bb644eb13 26-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Renamed ATAInfoblock.h to ATAInfoBlock.h.
* Fixed copyright as pointed out by Ingo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36480 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dba5fcaed879c719a5e74d56d96b7df1fed0d98a 21-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Use the ATAInfoblock.h header file instead of redoing it somehow.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36412 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a2f249984063e429b403e409a05339632871022b 21-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Style and automatic whitespace cleanup, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36410 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 87b68ba08fbcd6578eb8f57a762bee98cc245a3f 10-Sep-2009 Marcus Overhagen <marcusoverhagen@gmail.com>

cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33045 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 501ba9675989ad39474756d9c3cce54f1feaa559 08-Sep-2009 Marcus Overhagen <marcusoverhagen@gmail.com>

remove color usage from debug output


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33004 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e10fbc44fbdb4cb1995f5422e0aa772274487a4a 12-Jun-2009 Michael Lotz <mmlr@mlotz.ch>

Not really sure why the inquiry command was special cased on ATAPI, but it
prevents tools that try to read other inquiry pages (like cdrecord) from getting
the required infos. This way the inquiry command is sent to the ATAPI device,
which seems to work fine (at least for the drive I have here).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31019 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1d4c4d3a5bb167a4df0202a1c1d9e44abd4c156d 12-Jun-2009 Michael Lotz <mmlr@mlotz.ch>

* Call PostReset() at the end of ResetPort() as it's always used in that way.
* Reset the port directly after executing a command failed instead of letting
the next call do the reset first. This is arbitrary but looks cleaner to me.
* Provide a way to check if a given sata_request is a SCSI_OP_TEST_UNIT_READY
over ATAPI and use this info to calm down all error output. This avoids
spamming the syslog with error output on each media status poll when no disk
is present in a ATAPI device.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31014 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d60fa63b38e1e16b7d04ff85df155c927ee89ed5 15-Mar-2009 Axel Dörfler <axeld@pinc-software.de>

* Turned off sync debug output.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29542 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 22e22417630a904747894120193428271ec41d98 02-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

* Fixed a race condition where the interrupt for a command happened before
the thread issuing the command called acquire_sem_etc() on the semaphore
that the interrupt handler would otherwise release. The semaphore is now
released unconditionally, but to prevent the race condition that the
B_RELEASE_IF_WAITING_ONLY was trying to avoid, it is released with the
spinlock held.
* The error interrupt handler did not reset the fCommandsActive flag, but
it seemed to us like it should do that.
* WaitForTransfer now also acquires the spinlock to reset fCommandsActive,
which may be unnecessary but does not harm either.
* Cleanup of some long lines, sorry for mixing that with the actual fix.

Fixes bug #2359 (long pauses when accessing the disk).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26223 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d7c321236fb72c4044f75bbad7144ecc37cc0a1a 01-Jul-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Set transfer length when doing ATAPI transfers.
Dump ATAPI command packet on error.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26205 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1c8de8581b66c14ea94bccd7ddcea99291955796 01-Jun-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added optional spinlock contention measurement feature. Enabled when
B_DEBUG_SPINLOCK_CONTENTION is defined to 1. It typedefs spinlock to a
structure (thus breaking BeOS binary compatibility), containing a
counter which is incremented whenever a thread has to wait for the
spinlock.
* Added macros for spinlock initialization and access and changed
code using spinlocks accordingly. This breaks compilation for BeOS --
the macros should be defined in the respective compatibility wrappers.
* Added generic syscall to get the spinlock counters for the thread and
the team spinlocks.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25752 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d53ddcce75d9c0dffc1ec1f1b30898a6d470080f 24-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Provide better sense data. Turn off auto-sense
for ATAPI, as we can't report anything.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25653 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 205acfb4dc452e04bb015a7f64939d1f23e1dc63 24-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

first attempt to report sense data


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25652 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b54c709405f803f31c865130f48473bae0f486da 24-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Use scsi direction mask to determine if the command to execute is a write,
instead of checking every single command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25650 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ec5161c7b27d4ce69224101f33dd495f059fa403 24-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

add more error handling


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25649 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 88bd06fbc7b1b34939662b91bb1026d070e2c97a 24-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Separate port and device reset. Only perform device reset during error handling if the device is busy.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25648 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c3342cf811cdf0d1f51f56acd6d2737a278a6115 24-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

added simple error handling


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25647 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4738637486e91d326ef8d2fb16b19d9c36bc44ea 21-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

The AHCI controller doesn't natively support ATAPI commands.
Instead, one needs to execute the ATA command 0xa0 (PACKET) using
a normal ATA PIO FIS and in addition fill the SCSI CDB into the ACMD
space to transfer the ATAPI PACKET command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25597 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fd735f9bb07a88b6f0b8c5ec1531106d9c2081b5 20-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

More preparation for sending ATAPI PACKET commands (pass through of SCSI commands).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25585 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c940faf16a5ecf234984d72e07624586c9092417 20-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

disable "identify device" debug output


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25581 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6e251c66044329ea9119de81a757d7fbbe4d48ec 20-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

moved tracing into it's own header


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25579 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5d92f82a942927771e14736d7ee86f26f5e92c24 20-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Begin ATAPI support. The scsi_cd driver already tries opening the device.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25576 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 11a1e0e580c65a2ea97e3421f6a4daa7bd252cd8 18-May-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Trace address of prd table.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25553 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c1b9831bbe4ac55ea5d7d93681421ebe1f64ed88 02-May-2008 Bruno G. Albuquerque <bga@bug-br.org.br>

- Moved AHCI_PORT_TRACING define to its correct position.
- Prepend "ahci port" to all trace entries in ahci_port.cpp.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25293 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 110d4031fb55f72790afe108e77805fdaaaff183 02-May-2008 Bruno G. Albuquerque <bga@bug-br.org.br>

- Added AHCI port tracing (Only PRD table tracing for now).
- Added controller attribute to the AHCIPort class for debugging purposes.

AHCI is failing whenever the PRD table has an address above the 2048 Mb mark.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25291 a95241bf-73f2-0310-859d-f6bbb57e9c96


# de5c8292aea22b084ca3dbe93c8aaf5742ac7d59 05-Jan-2008 Jérôme Duval <korli@users.berlios.de>

fix gcc4 build


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23259 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b830be90e29060aa4638c07f73fbef8417d5103c 05-Jan-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Marked some bits as RWC and RW1.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23256 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0762289b3f6fc460ea1e4d5b51db1d1cbb6b4d78 05-Jan-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Cleanup ccb->data_length handling.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23255 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ebd99341e9926ed1d8e4fbe65546f363875355b3 05-Jan-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Fixed a copy&paste error. scsi_cmd_rw_10 has only a 16 bit length field,
while scsi_cmd_rw_12 has a 32 bit field. As both are big endian, that
error shouldn't have caused any problem or data corruption.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23254 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ec2bf719e84581b317de5ac2924f9da3718402ad 04-Jan-2008 Marcus Overhagen <marcusoverhagen@gmail.com>

Implemented ExecuteSataRequest() to execute all ATA and (later) ATAPI commands.
Converted Identify Device and Read / Write commands, they now create a sata_request
and pass it to ExecuteSataRequest. Added support for cache flushing.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23250 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c374980b51cf410a27af623bb084e65490dbaac 19-Nov-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

improved debug output


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22958 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 79844706c278112c1e949850c11757de3fd26fc0 10-Nov-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Propagate is-ATAPI restriction to the SCSI bus manager.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22874 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c134c7b07cd0a04b078840587c39e6e003ec0e36 01-Oct-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

disable some debug output


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22394 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bfd9a59f77e408d032ddd53abf573c63a512a1c0 30-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

This enable write support. The driver should be useable now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22387 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a2a169feab7494700b4595eaa6f144c5fefaa2f2 30-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Improved interrupt handling
Removed DBC_I interrupt
Reduce debug output


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22386 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ea44575a3187a20c81d6633944809c71e22e1893 30-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Cleanup, improved error handling, fix setting of DBC_I bit


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22385 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0845746bf749a717bb2b95d5e9bc730fb52b26f8 29-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Cleanup, device present detection improved.
Added support for non-48-bit LBA, added write support.
Proper error handling still missing, write support disabled for your protection.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22376 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 55d356bd98262b503988ddd102b2277e32260751 28-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

check for device presence before executing commands


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22367 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 21b4398f6a18ac9369e8db9db3da6ea619510776 28-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

don't set the "clear on RX_OK" bits


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22363 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f5ea6b32a5b568b97acbec291c361ad57b6899be 28-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

added debugging code


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22362 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6b8c1c2ad75f3848c3b0fa4901a6b9b2f723b1c5 28-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

improved prd table handling


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22361 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2bf99ebdee117d83860fa8f94b57048f9ae504b6 28-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Added byte swapping of identify device strings.
Added capacity reporting.
Wait for interrupts to finish transfers.
Added lba 48-bit read support.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22360 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2ae9d56421f5bf78b767c8918bb8b4325d898340 28-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

added scatter gather prd table setup, implement scsi inquiry command and emulate test unit ready


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22354 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a1a086067da7fbd23cdcd2a4cd2cd575886e0cea 28-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

cleanup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22346 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4af29ec0bd92d44cdcdec9bb22cbf652ee6b8e7f 25-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Implemented a identify device command for further testing, works on Intel, doesn't work on Jmicron.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22312 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2c7660170913bd0bbd02c6fe1e812cec3e091ec0 25-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Cleanup of hard reset, works on Intel, doesn't work on Jmicron.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22307 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c32beda5c4072f95c506426cb2f2576225b4cecc 24-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

start dma later, reduce timeouts


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22298 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fab4e5b126fff2c5790c4f222a38f49433ba8df0 24-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

oops


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22295 a95241bf-73f2-0310-859d-f6bbb57e9c96


# de372c5c6bd6f00f0d8d75a507612dd623f3e064 24-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

wait for phy communication


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22294 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 22cf14cfbeb75dfc24947cb395368050f919b127 24-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

perform port reset and wait for devices to be detected


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22293 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8961bec039b0e54f171183f64ac91410eced8e1e 23-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

try to activate link and spin up the device


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22280 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cb8be2945773a37f4f569ce08c79d27af1a172df 22-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Start and stop DMA engine and FIS receive, enable port interrupts.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22278 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 633990282e4296854a8e928132854aaba79b4473 19-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Setup command list, command table, FIS and PRDT pointers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22257 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9382f576917776521166203d7a1ecde8aaab8341 11-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

correct port number handling
allocate memory for command list and fis


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22221 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 25f926d8e4b852f0d88a63ce005c18309205407b 01-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

forward scsi request to the ports


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22146 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4f733fe93bda89631a901a417e0cbca1b00b97c0 01-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

added Interrupt handling framework


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22145 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9815383e54ccce94caaf8b92874211cec907405c 01-Sep-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

a class for the SATA ports


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22143 a95241bf-73f2-0310-859d-f6bbb57e9c96