Commit Graph

69 Commits

Author SHA1 Message Date
bouyer
bf1a4d2af5 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.
2006-01-16 20:30:18 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
perry
f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
perry
18db93c7f6 de-__P 2005-02-04 02:10:35 +00:00
drochner
1bf98e790e one more case: don't use ISACF_* constants internally 2004-09-01 21:30:25 +00:00
reinoud
943622e723 Delay initialisation of shadow registers. Tested on a Shark. 2004-08-25 13:06:16 +00:00
thorpej
9cc521a148 Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.
2004-08-20 06:39:37 +00:00
thorpej
2926431abf Use ANSI function decls and "static". 2004-08-19 23:30:09 +00:00
thorpej
4b51cecfc2 - 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.
2004-08-14 15:08:04 +00:00
drochner
7ba5b8cd09 adapt for changed essattach() signature 2004-08-04 18:55:06 +00:00
thorpej
2ecdd552dc 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.
2004-05-25 20:42:40 +00:00
itojun
aca4c091d3 sprintf -> snprintf 2004-04-22 00:17:10 +00:00
drochner
ef369e0ed6 remove license clauses 3 and 4 from my cpoyright notices 2004-03-24 17:26:53 +00:00
jdolecek
5ecaa7ecee add dependency on isadma for atppc attachments
add atppc_isadma.c for atppc@isapnp and atppc@ofisa, too
2004-01-31 13:59:20 +00:00
jdolecek
578cce287d ofisa atppc(4) attachment
test-compiled with Shark GENERIC (with atppc* at ofisa? added), otherwise
untested
2004-01-28 18:47:13 +00:00
thorpej
a963286f8d More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc
2004-01-03 22:56:52 +00:00
thorpej
5bd80d8373 Rename "struct channel_softc" to "struct wdc_channel". 2004-01-03 01:50:52 +00:00
thorpej
527c829fa0 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.
2004-01-01 17:18:53 +00:00
fvdl
6242a54566 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).
2003-11-27 23:02:40 +00:00
bouyer
99d6009c2a 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.
2003-10-08 10:58:12 +00:00
mycroft
eefae40298 Hide the use of config_interrupts() in one place. 2003-09-25 19:29:48 +00:00
mycroft
d40837608f 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.
2003-09-19 21:35:56 +00:00
wiz
1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
matt
7ba7388e87 Don't malloc channel_queue, put it in the softc. 2003-03-22 20:01:05 +00:00
thorpej
72a7af27b0 Use aprint_normal() in cfprint routines. 2003-01-01 00:10:15 +00:00
thorpej
c9b3657ce9 Add trailing ; to CFATTACH_DECL. 2002-10-02 16:33:28 +00:00
thorpej
71adb76f75 Use CFATTACH_DECL(). 2002-09-30 21:57:46 +00:00
thorpej
f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
yamt
0f75af34c0 constify and make auto const variables static. 2002-06-08 17:07:53 +00:00
pooka
d70864a866 make this compile:
include dev/ic/joyvar.h instead of the now non-existant arm32/isa/joyvar.h
2002-02-03 23:17:58 +00:00
tsutsui
bcba62925f Call malloc(9) with M_ZERO flag instead of bzero() after malloc(). 2002-01-14 13:32:44 +00:00
yamt
dbaca00330 move dev/isa/cs89x0{.c,{var,reg}.h} into dev/ic
and split isadma parts into /dev/isa/cs89x0isa*.
2001-11-26 19:17:05 +00:00
lukem
ab5d9d2b0c add RCSIDs 2001-11-13 07:24:43 +00:00
wiz
3f9984fc90 existent', not existant' 2001-06-19 13:42:07 +00:00
jdolecek
372e5956ef Only install headers which are actually used by our userland. This
saves about 2.2MB under /usr/include/dev/. Discussed on tech-kern@
recently.

I HOPE to get the list right. The headers I left in are ones
used for MI tools and those whose usage I discovered by grep over tree sources.
Feel free to put needed includes back in if you encounter anything which
should not be removed from lists.
2001-04-11 07:42:31 +00:00
matt
9ae27fdc8c print the modes of the IDE devices we've attached. 2001-03-04 03:22:23 +00:00
matt
0da665182e Add pckbc attachment so we can get wscons on the dnard. 2001-02-26 02:39:30 +00:00
nathanw
46b2a2fcd4 Do ess_config_addr() in the ofisa front end, rather than in the match
routine. Prevents problems with non-SCR ess chips, as described in
PR 11630.
2001-01-06 22:50:00 +00:00
mycroft
a6fe4b78f2 Um, we need rnd.h so that cs_softc is defined properly. Overrunning structures
is bad.
NOTE: #IFDEF IN SOFTC DEFINITIONS IS BAD.
2000-12-26 09:42:21 +00:00
thorpej
ae7f25d8af Fix a typo. 1999-03-30 20:07:56 +00:00
cgd
a6eca03c65 pull ofisa_machdep.h in from machine/ 1999-03-19 03:30:35 +00:00
mycroft
9e041fd850 Adjustments for structure name changes. 1999-03-16 13:07:45 +00:00
mycroft
4822d3d0b0 Move IRQ setup into frontend. Need to move DRQ handling as well. 1999-02-19 16:10:44 +00:00
sommerfe
57ba10cfab 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.
1998-12-02 00:18:41 +00:00
bouyer
354f32509f Pass the rigth argument to wdcintr(). Closes PR 6342. 1998-10-23 13:58:17 +00:00
bouyer
19fddaeeb5 Merge bouyer-ide 1998-10-12 16:09:10 +00:00
thorpej
96aa1cec21 Add ofisa attachment for the ISA joystick driver.
XXX currently arm32-specific.
1998-08-20 07:02:32 +00:00
thorpej
ee26f0775b This now needs <dev/midi_if.h> to build. 1998-08-18 17:55:09 +00:00
thorpej
d0a17ab63e Fix a typo. 1998-08-17 20:34:19 +00:00
thorpej
2b869a383f Use _CS_OFISA_MD_* callbacks for old, broken OpenFirmware builds. 1998-08-15 02:59:01 +00:00