Home | History | Annotate | Download | only in ofisa
History log of /src/sys/dev/ofisa/wdc_ofisa.c
RevisionDateAuthorComments
 1.41  25-Sep-2022  thorpej Remove unnecessary include of <sys/malloc.h>.
 1.40  27-Jan-2021  thorpej Rename of_match_compat_data() to of_compatible_match(). Similarly,
rename of_search_compatible() to of_compatible_lookup().

Standardize on of_compatible_match() for driver matching, and adapt
all call sites.
 1.39  27-Jan-2021  thorpej Use DEVICE_COMPAT_EOL.
 1.38  25-Jan-2021  thorpej Since we're using designated initialisers for compat data, we should
use a completely empty initializer for the sentinel.
 1.37  19-Jan-2021  thorpej of_compatible() is a hokey API (returning -1 for no match) and nothing
here relies on its reverse-index return value semantics, so just use
of_match_compat_data() instead.
 1.36  20-Oct-2017  jdolecek branches: 1.36.18;
move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606
 1.35  10-Oct-2017  jdolecek fix wdc_init_shadow_regs() arg
 1.34  07-Oct-2017  jdolecek adapt several more wdc attachments for NCQ branch merge
 1.33  31-Jul-2012  bouyer branches: 1.33.2;
Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.
 1.32  26-Jul-2012  jakllsch Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@
 1.31  02-Jul-2012  bouyer Add sata Port MultiPlier (PMP) support to the ata bus layer,
as described in
http://mail-index.netbsd.org/tech-kern/2012/06/23/msg013442.html
PMP support in integrated to the atabus layer.
struct ata_channel's ch_drive[] is not dynamically allocated, and ch_ndrive
(renamed to ch_ndrives) closely reflects the size of the ch_drive[] array.
Add helper functions atabus_alloc_drives() and atabus_free_drives()
to manage ch_drive[]/ch_ndrives.
Add wdc_maxdrives to struct wdc_softc so that bus front-end can specify
how much drive they really support (master/slave or single).
ata_reset_drive() callback gains a uint32_t *sigp argument which,
when not NULL, will contain the signature of the device being reset.
While there, some cosmetic changes:
- added a drive_type enum to ata_drive_datas, and stop encoding the
probed drive type in drive_flags (we were out of drive flags anyway).
- rename DRIVE_ATAPIST to DRIVE_ATAPIDSCW to better reflect what this
really is
- remove ata_channel->ata_drives, it's redundant with the pointer in
ata_drive_datas
- factor out the interpretation of SATA signatures in sata_interpet_sig()

propagate these changes to the ATA HBA drivers, and add support for PMP
to ahcisata(4) and siisata(4).

Thanks to:
- Protocase (http://www.protocase.com/) which provided a system
with lots of controllers, SATA PMP and drive slots
- Conservation Genomics Laboratory, Department of Biology, New Mexico State
University for hosting the above system
- Brook Milligan, who set up remote access and has been very responsive
when SATA cable move was needed
 1.30  18-Mar-2008  cube branches: 1.30.38;
Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.
 1.29  19-Oct-2007  ad branches: 1.29.12; 1.29.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.28  29-Mar-2006  thorpej branches: 1.28.18; 1.28.32; 1.28.34; 1.28.38;
Use device_private().
 1.27  16-Jan-2006  bouyer branches: 1.27.2; 1.27.4; 1.27.6; 1.27.8; 1.27.10;
properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.
 1.26  11-Dec-2005  christos branches: 1.26.2;
merge ktrace-lwp.
 1.25  27-Feb-2005  perry branches: 1.25.4;
nuke trailing whitespace
 1.24  25-Aug-2004  reinoud branches: 1.24.4; 1.24.6;
Delay initialisation of shadow registers. Tested on a Shark.
 1.23  20-Aug-2004  thorpej Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.
 1.22  19-Aug-2004  thorpej Use ANSI function decls and "static".
 1.21  14-Aug-2004  thorpej - Split the register handles out of struct wdc_channel into a separate
wdc_regs structure, and array of which (indexed per channel) is pointed
to by struct wdc_softc.
- Move the resulting wdc_channel structure to atavar.h and rename it to
ata_channel. Rename the corresponding flags.
- Add a "ch_ndrive" member to struct ata_channel, which indicates the
maximum number of drives that can be present on the channel. For now,
this is always 2. Add an ATA_MAXDRIVES constant that places an upper
limit on this value, also currently 2.
 1.20  25-May-2004  thorpej Add the notion of "shadow registers" to the wdc driver. These shadow
registers are registers that overlap with others on many controllers, but
which may actually be distinct on some controllers. Right now, the two
shadows are:

- wd_status (usually overlaps wd_command)
- wd_features (usually overlaps wd_error)

Add a new helper function, wdc_init_shadow_regs(), used to initialize
the shadow register handles on controllers where they do actually overlap.

Partially from Jordan Rhody @ Wasabi Systems, Inc.
 1.19  03-Jan-2004  thorpej More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc
 1.18  03-Jan-2004  thorpej Rename "struct channel_softc" to "struct wdc_channel".
 1.17  01-Jan-2004  thorpej Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers. Clean up the member names of these structures while at it.
 1.16  27-Nov-2003  fvdl There are some cards that map the ATA control and IDE DMA registers
in a different fashion. Individually, they have the same functionality,
but their layout is different. An example of such a chipset is
the Promise 203xx.

To be able to deal with this, transform the cmd and dma bus_space handles
into an array of handles, each seperately created with bus_space_subregion.
The code generated by using the extra indirection shouldn't change much,
since the extra indirection is negated by having the offset calculation
already done in bus_space_subregion. E.g.

bus_space_write_4(tag, handle, offset, value)

becomes

bus_space_write_4(tag, handles[offset], 0, value)

Reviewed by Manuel Bouyer. Tested on wdc_isa, wdc_pcmcia, viaide, piixide (i386)
and on cmdide (sparc64).
 1.15  08-Oct-2003  bouyer Make the ATA mid-layer appears as atabus, as proposed in
http://mail-index.netbsd.org/tech-kern/2003/09/25/0006.html
This adds a device (atabus) between IDE controllers and wd or atapibus, to
have each ATA channel show up in the device tree. Later there will be atabus
devices in /dev, so that we can do IOCTL on them.
Each atabus has its own kernel thread, to handle operations that needs polling,
e.g. reset and others.

Device probing on each bus it defered to the atabus thread creation.
This allows to do the reset and basic device probes in parallel, which reduce
boot time on systems with several pciide controllers.
 1.14  25-Sep-2003  mycroft Hide the use of config_interrupts() in one place.
 1.13  19-Sep-2003  mycroft 1) Use config_interrupts() to attach IDE and ATAPI drives. This eliminates
most polling.
2) Clean up some goofiness in pciide -- get rid of the whole "candisable" path
(it's gratuitous) and simplify the code by calling pciide_map_compat_intr(),
*_set_modes() and wdc_print_modes() from central locations.
3) Add a register writability and register ghost test to eliminate phantom
drives more quickly.
 1.12  22-Mar-2003  matt branches: 1.12.2;
Don't malloc channel_queue, put it in the softc.
 1.11  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.10  30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.9  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.8  08-Jun-2002  yamt constify and make auto const variables static.
 1.7  13-Nov-2001  lukem branches: 1.7.8;
add RCSIDs
 1.6  04-Mar-2001  matt branches: 1.6.2; 1.6.4;
print the modes of the IDE devices we've attached.
 1.5  02-Dec-1998  sommerfe branches: 1.5.10;
Change ofisa attachment comparable to change drochner made to isa
attachment. Works at least well enough to allow kernel to build &
boot on diskless shark with wdc controller in it.
 1.4  23-Oct-1998  bouyer Pass the rigth argument to wdcintr(). Closes PR 6342.
 1.3  12-Oct-1998  bouyer Merge bouyer-ide
 1.2  21-Mar-1998  cgd branches: 1.2.2;
compile with -Wall, update for changes to dev/ofw
 1.1  07-Feb-1998  cgd initial implementation of OFW ISA bus code and attachments for a few
devices. Still a bit rough, but works well enough. Requires a bunch of
machine-dependent glue (since this is, in effect, a MI bus bridge).
 1.2.2.4  02-Oct-1998  bouyer Cleanup a few error message, remove some dead code. Re-add a reset at end of
attach, unless we have WDC_NO_EXTRA_RESETS.
Add support for data32iot/data32ioh from -current: each controller pass
WDC_CAPABILITY_DATA32 if they can do 32bit, and WDC_CAPABILITY_DATA16 if they
can do 16bit. For controller that support both, the usual autodetect
mechanism is still used.
 1.2.2.3  02-Oct-1998  matt Get this to compile and probe the devices on the Shark. (it hangs when
going multi-user).
 1.2.2.2  13-Aug-1998  bouyer - sync with -current
- b* -> mem*
 1.2.2.1  04-Jun-1998  bouyer Commit changes to the IDE system in a branch. This allows a better separation
between higth-level and low-level (i.e. registers read/write) and generalize
the queue for all commands. This also add supports for IDE DMA.
 1.5.10.1  12-Mar-2001  bouyer Sync with HEAD.
 1.6.4.3  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.6.4.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.3  18-Oct-2002  nathanw Catch up to -current.
 1.6.2.2  20-Jun-2002  nathanw Catch up to -current.
 1.6.2.1  14-Nov-2001  nathanw Catch up to -current.
 1.7.8.1  20-Jun-2002  gehenna catch up with -current.
 1.12.2.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.12.2.5  21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.2.4  18-Sep-2004  skrll Sync with HEAD.
 1.12.2.3  03-Sep-2004  skrll Sync with HEAD
 1.12.2.2  25-Aug-2004  skrll Sync with HEAD.
 1.12.2.1  03-Aug-2004  skrll Sync with HEAD
 1.24.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.24.4.1  29-Apr-2005  kent sync with -current
 1.25.4.3  24-Mar-2008  yamt sync with head.
 1.25.4.2  27-Oct-2007  yamt sync with head.
 1.25.4.1  21-Jun-2006  yamt sync with head.
 1.26.2.1  01-Feb-2006  yamt sync with head.
 1.27.10.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.27.8.1  19-Apr-2006  elad sync with head.
 1.27.6.1  01-Apr-2006  yamt sync with head.
 1.27.4.1  22-Apr-2006  simonb Sync with head.
 1.27.2.1  09-Sep-2006  rpaulo sync with head
 1.28.38.1  25-Oct-2007  bouyer Sync with HEAD.
 1.28.34.2  23-Mar-2008  matt sync with HEAD
 1.28.34.1  06-Nov-2007  matt sync with HEAD
 1.28.32.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.28.18.1  23-Oct-2007  ad Sync with head.
 1.29.16.1  03-Apr-2008  mjf Sync with HEAD.
 1.29.12.1  24-Mar-2008  keiichi sync with head.
 1.30.38.1  30-Oct-2012  yamt sync with head
 1.33.2.1  03-Dec-2017  jdolecek update from HEAD
 1.36.18.1  03-Apr-2021  thorpej Sync with HEAD.

RSS XML Feed