Home | History | Annotate | Download | only in pnpbus
History log of /src/sys/arch/prep/pnpbus/wdc_pnpbus.c
RevisionDateAuthorComments
 1.16  20-Dec-2023  thorpej Remove unnecessary <sys/malloc.h>.
 1.15  20-Oct-2017  jdolecek 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.14  07-Oct-2017  jdolecek Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
 1.13  31-Jul-2012  bouyer branches: 1.13.2; 1.13.28;
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.12  26-Jul-2012  jakllsch Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@
 1.11  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.10  01-Jul-2011  dyoung branches: 1.10.2;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.9  28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8  28-Apr-2008  garbled Add floppy support to prep (the croud goes wild)

Add an additional argument to pnpbus_intr_establish to allow overriding of
the pnp interrupt type, because some devices lie.
Change how the pnpbus match routine works, to avoid attaching it when we
are probing for cpu's.
Fix a few stray printf's in the autoconf output.
 1.7  18-Mar-2008  cube branches: 1.7.2; 1.7.4;
Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.
 1.6  20-Mar-2007  garbled branches: 1.6.14; 1.6.30; 1.6.34;
Special case the MTX604 and other RAVEN based machines to not attach
wdc@pnpbus.
 1.5  15-Jun-2006  garbled branches: 1.5.2; 1.5.8; 1.5.12; 1.5.14; 1.5.18; 1.5.20; 1.5.22;
A bit of clock rototill. It's safer to detect things known by the
residual with the pnpbus probes, than it is to do it with raw isa probes,
so I've replaced the isa mkclock and mcclock code with a pnpbus attachment.

While writing the mkclock code, I realized that on motorola prep machines
the mkclock uses the same port range as the nvram part. (it's actually
the same chip/part). This was causing the nvram not to work on those
machines. Now the nvram code will recognize this, and wire up the
mkclock as well. The mkclock probe is just a stub probe used to
pre-detect the fact that this is one of those machines.
 1.4  26-Apr-2006  garbled branches: 1.4.2; 1.4.4;
Support fixes for the Motorola Powerstack E1.
1) The E1 seems to have the int. siop wired to irq 14-level and the internal
wdc wired to irq 14-edge. special case and fail the wdc probe on E1's.
2) If we fail to map the NVRAM registers, return, rather than trying to talk
to them and panic'ing the box.
3) revert my previous "fix" to pnpbus to make irq's default to level. It
was wrong, and didn't even fix the powerstack.

With this, we have limited PowerStack E1 support. The machine cannot
talk to it's IDE controller, and cannot detect it's boot device
automatically, but it does come up and run. Tested with NFS root.
 1.3  29-Mar-2006  thorpej branches: 1.3.2; 1.3.4;
Use device_cfdata().
 1.2  16-Mar-2006  garbled branches: 1.2.2;
More changes to prep port:
1) Add the NVRAM device. This device allows us to speak with the nvram on
prep-based machines and read/write to it. Also add a simple IOCTL
interface for speaking with the nvram from userland. This hasn't been
tested yet, but eventually I plan to support it with the sparc eeprom
command.
2) Change the root device detection to use the nvram device to attempt to
guess the boot device. Most machines should now correctly guess thier
boot device, though I expect a few devices to still not work quite right yet.
3) change the default IRQ to level rather than edge in the pnpbus if the
flags are invalid or empty. (based on output from a PowerStack E1)
4) correctly handle older machines in pnpbus that have FixedIOPorts
rather than variable ones.

Still have much to do.
 1.1  09-Mar-2006  garbled branches: 1.1.2;
Prep super-commit:

1) create new pnpbus psuedo bus. This is a bus layer that reads the PNP
tree from the residual data and allows attachment of devices with the
information given therein. Based loosely on i386/pnpbios.

2) Delete obio bus, as with the pnp bus we no longer need it.

3) Create a number of functions that gather the information needed to set
up the machine from the residual data, rather than hardcoding it in.

4) Create a quirk table for machines that are bizzare enough that the
residual information is not sufficient. (such as the 6015)

5) Using the data gathering routines and the quirk table, delete struct
platform completely from the architecture. Prep is now almost completely
dynamic in figuring out the machine it is running on and setting things
up properly.

6) Add a wdc_pnpbus driver which attaches the wdc controller found on
some 7248's and the 6015. This replaces the now-defunct wdc_obio.

7) delete all the mot_* and ibm_* files, and replace them with a single
ibm_machdep.c which only contains the quirk functions for the 6015 and
the 6050.

8) Modify GENERIC to work with all this stuff.
 1.1.2.5  26-Jun-2006  yamt sync with head.
 1.1.2.4  24-May-2006  yamt sync with head.
 1.1.2.3  01-Apr-2006  yamt sync with head.
 1.1.2.2  13-Mar-2006  yamt sync with head.
 1.1.2.1  09-Mar-2006  yamt file wdc_pnpbus.c was added on branch yamt-pdpolicy on 2006-03-13 09:06:59 +0000
 1.2.2.2  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.2.2.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.3.4.3  01-Jun-2006  kardel Sync with head.
 1.3.4.2  22-Apr-2006  simonb Sync with head.
 1.3.4.1  29-Mar-2006  simonb file wdc_pnpbus.c was added on branch simonb-timecounters on 2006-04-22 11:37:54 +0000
 1.3.2.3  11-May-2006  elad sync with head
 1.3.2.2  19-Apr-2006  elad sync with head - hopefully this will work
 1.3.2.1  29-Mar-2006  elad file wdc_pnpbus.c was added on branch elad-kernelauth on 2006-04-19 02:33:38 +0000
 1.4.4.1  13-Jul-2006  gdamore Merge from HEAD.
 1.4.2.1  19-Jun-2006  chap Sync with head.
 1.5.22.1  29-Mar-2007  reinoud Pullup to -current
 1.5.20.1  11-Jul-2007  mjf Sync with head.
 1.5.18.1  10-Apr-2007  ad Sync with head.
 1.5.14.1  24-Mar-2007  yamt sync with head.
 1.5.12.1  31-Mar-2007  bouyer Pull up following revision(s) (requested by garbled in ticket #528):
sys/arch/prep/pci/pci_machdep.c: revision 1.29
sys/arch/prep/pnpbus/wdc_pnpbus.c: revision 1.6
Special case the MTX604 and other RAVEN based machines to not attach
wdc@pnpbus.
The motorola RAVEN is both a pchb and an MPIC. Block out the pci
configuration of it's mem area to keep the PIC available.
 1.5.8.2  09-Sep-2006  rpaulo sync with head
 1.5.8.1  15-Jun-2006  rpaulo file wdc_pnpbus.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:42:43 +0000
 1.5.2.4  24-Mar-2008  yamt sync with head.
 1.5.2.3  03-Sep-2007  yamt sync with head.
 1.5.2.2  21-Jun-2006  yamt sync with head.
 1.5.2.1  15-Jun-2006  yamt file wdc_pnpbus.c was added on branch yamt-lazymbuf on 2006-06-21 14:55:19 +0000
 1.6.34.2  02-Jun-2008  mjf Sync with HEAD.
 1.6.34.1  03-Apr-2008  mjf Sync with HEAD.
 1.6.30.1  24-Mar-2008  keiichi sync with head.
 1.6.14.1  23-Mar-2008  matt sync with HEAD
 1.7.4.1  16-May-2008  yamt sync with head.
 1.7.2.1  18-May-2008  yamt sync with head.
 1.10.2.1  30-Oct-2012  yamt sync with head
 1.13.28.2  27-Sep-2017  jdolecek change wdc_init_shadow_regs() to accept only struct wdc_regs, it doesn't
touch anything else

factor out the probe-only struct ata_channel initialization to wdcprobe(), to
reduce duplication of logic in individual drivers, and to actually work now
that more init is needed beyond the memset()
 1.13.28.1  26-Sep-2017  jdolecek switch to ata_queue_alloc() so that this at least compiles
 1.13.2.1  03-Dec-2017  jdolecek update from HEAD

RSS XML Feed