History log of /freebsd-current/sys/dev/ata/ata-isa.c
Revision Date Author Comments
# fdafd315 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# d5a7306c 06-May-2022 John Baldwin <jhb@FreeBSD.org>

ata: Remove ata_devclass from DRIVER_MODULE invocations.

Keep the global variable for its uses in ata-pci.c and
chipsets/ata-fsl.c but initialize it in the existing
ata_module_event_handler. Move the module event handler a bit earlier
to ensure the variable is set before any devices are attached.


# 1529c509 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

ata: clean up empty lines in .c and .h files


# d6b66397 28-Jan-2018 Warner Losh <imp@FreeBSD.org>

Add ISA PNP tables to ISA drivers. Fix a few incidental comments.
ACPI ISA PBP tables not tagged, there's bigger issues with them.


# 718cf2cc 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/dev: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.


# c47476d7 26-Feb-2016 Justin Hibbits <jhibbits@FreeBSD.org>

Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().

Most calls to bus_alloc_resource() use "anywhere" as the range, with a given
count. Migrate these to use the new bus_alloc_resource_anywhere() API.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D5370


# 2dd1bdf1 26-Jan-2016 Justin Hibbits <jhibbits@FreeBSD.org>

Convert rman to use rman_res_t instead of u_long

Summary:
Migrate to using the semi-opaque type rman_res_t to specify rman resources. For
now, this is still compatible with u_long.

This is step one in migrating rman to use uintmax_t for resources instead of
u_long.

Going forward, this could feasibly be used to specify architecture-specific
definitions of resource ranges, rather than baking a specific integer type into
the API.

This change has been broken out to facilitate MFC'ing drivers back to 10 without
breaking ABI.

Reviewed By: jhb
Sponsored by: Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D5075


# d2ce15bd 06-Apr-2013 Marius Strobl <marius@FreeBSD.org>

- With the demise of !ATA_CAM, ATA_STATIC_ID is the only ata(4) related
option left but actually consumed by ada(4), so move it to opt_ada.h
and get rid of opt_ata.h.
- Fix stand-alone build of atacore(4) by adding opt_cam.h.
- Use __FBSDID.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.


# 9a14aa01 15-Jan-2012 Ulrich Spörlein <uqs@FreeBSD.org>

Convert files to UTF-8


# c779dc14 24-Oct-2011 Alexander Motin <mav@FreeBSD.org>

Some dmesg cosmetics:
- for the legacy PCI ATA channels move channel number out of the device
description, same as it is for ahci(4), siis(4) and mvs(4);
- add device description for the ISA ATA channels.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 79ca9100 09-Mar-2009 Alexander Motin <mav@FreeBSD.org>

Add type specific suspend/resume ata channel functions. Add checks to avoid
crash on detached channel resume. Add placeholder for possible type-specific
suspend/resume routines.


# b50bb79c 18-Feb-2009 Alexander Motin <mav@FreeBSD.org>

Use channel driver's attach/detach routines instead of ata_attach()/
ata_detach() to implement IOCATAATTACH/IOCATADETACH ioctls.
This will permit channel drivers to properly shutdown port hardware on channel
detach and init it on attach.


# 6a03316a 18-Feb-2009 Alexander Motin <mav@FreeBSD.org>

Implement proper attach/detach routines for ISA driver.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 9f82379c 10-Apr-2008 Søren Schmidt <sos@FreeBSD.org>

Add experimental support for SATA Port Multipliers

Support is working on the Silicon Image SiI3124/3132.
Support is working on some AHCI chips but far from all.

Remember this is WIP, so test reports and (constructive) suggestions are welcome!


# 129230b8 21-Feb-2007 Søren Schmidt <sos@FreeBSD.org>

Update copyright headers.


# e2bf77c5 05-Jan-2006 Søren Schmidt <sos@FreeBSD.org>

Get rid of the advertising clause in the copyright.


# 0068f98f 30-Apr-2005 Søren Schmidt <sos@FreeBSD.org>

Take newbusification one step further, ie use the device_t more consequently
all way through the code down the layers, instead of the mix'n'match that
resulted from the conversion done earlier.

Sponsored by: pair.com


# ca8c70e9 28-Apr-2005 Søren Schmidt <sos@FreeBSD.org>

Provide a default setmode method.
This shaves off multiple copies of the same setmode stub.


# ecd6c15d 25-Apr-2005 Søren Schmidt <sos@FreeBSD.org>

Cosmetics


# d5514ba3 13-Apr-2005 Søren Schmidt <sos@FreeBSD.org>

Add a ata_setmode method so we dont panic on setmode.
Note that the mode is only set on the device, we (mostly) have
no knowledge on how to set mode on the controller if at all possible.


# 0e1eb682 06-Apr-2005 Søren Schmidt <sos@FreeBSD.org>

Add support for controllers that doesn't have the usual taskfile
layout. No functional changes.


# 8ca4df32 29-Mar-2005 Søren Schmidt <sos@FreeBSD.org>

This is the much rumoured ATA mkIII update that I've been working on.

o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.

o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.

o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.

o Support for "atomic" composite ATA requests used for RAID.

o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"

o Update the ioctl API to match new RAID levels etc.

o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.

o The reinit code has been worked over to be much more robust.

o The timeout code has been overhauled for races.

o Support of new chipsets.

o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.

Missing or changed features from current ATA:

o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.

o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.

o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.

HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)


# 6192895d 06-Oct-2004 Søren Schmidt <sos@FreeBSD.org>

Fix the PC98 lockups on boot.
The interchannel locking for PC98 needed to be updated to match the
rest of the locking in ATA.


# ad452ba4 30-Apr-2004 Søren Schmidt <sos@FreeBSD.org>

Spring cleanup of macros


# f2972d7e 13-Apr-2004 Søren Schmidt <sos@FreeBSD.org>

Add support for the Promise command sequencer present on all modern Promise
controllers (PDC203** PDC206**).

This also adds preliminary support for the Promise SX4/SX4000 but *only*
as a "normal" Promise ATA controller (ATA RAID's are supported though
but only RAID0, RAID1 and RAID0+1).

This cuts off yet another 5-8% of the command overhead on promise controllers,
making them the fastest we have ever had support for.

Work is now continuing to add support for this in ATA RAID, to accellerate
ATA RAID quite a bit on these controllers, and especially the SX4/SX4000
series as they have quite a few tricks in there..

This commit also adds a few fixes to the SATA code needed for proper support.


# 5df3ca78 14-Jan-2004 Søren Schmidt <sos@FreeBSD.org>

Use UMA instead of plain malloc for getting ATA request storage.
This gives +10% performance on simple tests, so definitly worth it.
A few percent more could be had by not using M_ZERO'd alloc's, but
we then need to clear fields all over the place to be safe, and
that was deemed not worth the trouble (and it makes life dangerous).


# a7a120f6 11-Jan-2004 Søren Schmidt <sos@FreeBSD.org>

Overhaul of the timeout/reinit framework. This should clear up most
of the leftovers from the old version that really doesn't work anymore.

Add a reset function for host-end of the ATA channel. This is needed
for the SiI3112 in order to whack it back to reality if a device
locks up the SATA interface (thereby preventing that we can reset the
device). The result is that ATA now recovers from the timeouts that
happens with the SiI3112A and more or less all disks based on old
PATA electronics with a Marvell PATA->SATA converter. This includes
lots of the popular SATA dongles and the WDC Raptor disks..


# 019446db 03-Dec-2003 Søren Schmidt <sos@FreeBSD.org>

Fix modesetting on ISA only systems.

Approved by: re@


# 9f06a427 25-Aug-2003 Søren Schmidt <sos@FreeBSD.org>

Unify prototypes.
Cosmetics.


# aad970f1 24-Aug-2003 David E. O'Brien <obrien@FreeBSD.org>

Use __FBSDID().
Also some minor style cleanups.


# 5fdbb0d2 24-Aug-2003 Søren Schmidt <sos@FreeBSD.org>

This is a major rework of the ATA driver (ATAng)

Restructure the way ATA/ATAPI commands are processed, use a common
ata_request structure for both. This centralises the way requests
are handled so locking is much easier to handle.

The driver is now layered much more cleanly to seperate the lowlevel
HW access so it can be tailored to specific controllers without touching
the upper layers. This is needed to support some of the newer
semi-intelligent ATA controllers showing up.

The top level drivers (disk, ATAPI devices) are more or less still
the same with just corrections to use the new interface.

Pull ATA out from under Gaint now that locking can be done in a sane way.

Add support for a the National Geode SC1100. Thanks to Soekris engineering
for sponsoring a Soekris 4801 to make this support.

Fixed alot of small bugs in the chipset code for various chips now
we are around in that corner anyways.


# 566cf07a 29-Mar-2003 Søren Schmidt <sos@FreeBSD.org>

Second round of updates to the ATA driver.

Clean up the DMA interface too much unneeded stuff crept in with
the busdma code back when.

Modify the ATA_IN* / ATA_OUT* macros so that resource and offset
are gotten from a table. That allows for new chipsets that doesn't
nessesarily have things ordered the good old way. This also removes
the need for the wierd PC98 resource functions.

Tested on: i386, PC98, Alpha, Sparc64


# c55607ce 03-Mar-2003 Søren Schmidt <sos@FreeBSD.org>

Always set the setmode funcptr.


# 472e291b 25-Feb-2003 Søren Schmidt <sos@FreeBSD.org>

Removed the ISA only hooks here, no longer needed..


# bb5bdd38 20-Feb-2003 Søren Schmidt <sos@FreeBSD.org>

First round off updates/fixes to the ATA driver.

This moves all chipset specific code to a new file 'ata-chipset.c'.
Extensive use of tables and pointers to avoid having the same switch
on chipset type in several places, and to allow substituting various
functions for different HW arch needs.
Added PIO mode setup and all DMA modes.
Support for all known SiS chipsets. Thanks to Christoph Kukulies for
sponsoring a nice ASUS P4S8X SiS648 based board for this work!

Tested on: i386, PC98, alpha and sparc64


# 8ba4488c 03-Dec-2002 Søren Schmidt <sos@FreeBSD.org>

Add support for the PC98 platform to the ATA driver.
This mostly consists of functionality to serialize accesses to
the two ATA channels (which can also be used to "fix" certain
PCI based controllers).
Add support for Acard controllers.
Enable the ATA driver in PC98 GENERIC, and add device hints.
Update man page with latest support.

The PC98 core team has kindly provided me with a PC98
machine that made this all possible, thanks to all that
contributed to that effort, without that this would
probably newer have been possible..

Approved by: re@


# c6ff03e2 20-Sep-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Remove unused #includes: <sys/disk.h> <sys/devicestat.h> and <sys/sysctl.h>

Sponsored by: DARPA & NAI Labs.
Approved by: sos


# 2f11d560 14-Sep-2002 Poul-Henning Kamp <phk@FreeBSD.org>

remove #includes of <sys/bio.h> where not needed.


# b5d0be89 21-Jul-2002 Peter Wemm <peter@FreeBSD.org>

Remove dependency on NPCI. Use 'options ATA_NOPCI' to compile without
pci support. This really needs to be fixed properly some day, but judging
by the fact that the nopci case hasn't compiled for quite a while, there
does not seem to be much urgency.

Reviewed by: sos


# 091a610a 18-Apr-2002 Søren Schmidt <sos@FreeBSD.org>

Fix the breakage of tagged queueing that the busdma integration
introduced. Since its now only possible to have one DMA control
block at a time, we move the setup to dmastart instead.


# 7800211b 05-Apr-2002 Søren Schmidt <sos@FreeBSD.org>

Make the ATA driver compile & work on the sparc64 platform.

Initial work & code by tmm.

Lots of changes and rearrangements by yours truely to make busdma
be a little less a PITA (but I still dont like it).


# 6ddce903 04-Feb-2002 Søren Schmidt <sos@FreeBSD.org>

Major update of the ATA RAID code, part 1:

Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.

A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.

Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.

Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.

Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.

If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.

Misc fixes that I had lying around for various minor bugs.

Sponsored by: Advanis Inc.


# f601b4eb 20-Sep-2001 Søren Schmidt <sos@FreeBSD.org>

Overhaul to minimize stack usage, in some places >2K was used
on the stack *blush*...


# 312ec441 24-Mar-2001 Søren Schmidt <sos@FreeBSD.org>

Add bandaid to get ISA only systems to link.


# 331c488d 06-Mar-2001 Søren Schmidt <sos@FreeBSD.org>

Split out the ata probes in seperate files for each bus type.