Sun Mar 20 17:54:03 2011 UTC ()
Add usb_dma attribute for DMA capable USB host controllers
and specify that usb_dma attribute to dev/usb/usb_mem.c.

usb_mem.c uses bus_dma(9) for DMA memory allocation,
but non-DMA capable USB host controllers like slhci(4)
doesn't need them at all, and some ports don't bother to
prepare MD bus_dma(9) implementation (yet).

Discussed on current-users
 http://mail-index.NetBSD.org/current-users/2011/03/13/msg015995.html
and usb_dma attribute is suggested by bouyer@.
Tested by kiyohara@ on mmeye with slhci at pcmcia.


(tsutsui)
diff -r1.1004 -r1.1005 src/sys/conf/files
diff -r1.104 -r1.105 src/sys/dev/usb/files.usb

cvs diff -r1.1004 -r1.1005 src/sys/conf/files (expand / switch to unified diff)

--- src/sys/conf/files 2011/03/06 17:08:35 1.1004
+++ src/sys/conf/files 2011/03/20 17:54:02 1.1005
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: files,v 1.1004 2011/03/06 17:08:35 bouyer Exp $ 1# $NetBSD: files,v 1.1005 2011/03/20 17:54:02 tsutsui Exp $
2# @(#)files.newconf 7.5 (Berkeley) 5/10/93 2# @(#)files.newconf 7.5 (Berkeley) 5/10/93
3 3
4version 20100430 4version 20100430
5 5
6# 6#
7# device classes 7# device classes
8# 8#
9devclass disk 9devclass disk
10devclass tape 10devclass tape
11devclass ifnet 11devclass ifnet
12devclass tty 12devclass tty
13devclass audiodev 13devclass audiodev
14devclass displaydev 14devclass displaydev
@@ -1107,27 +1107,27 @@ file dev/ic/vga_common.c vga | vga_raste @@ -1107,27 +1107,27 @@ file dev/ic/vga_common.c vga | vga_raste
1107# Integraphics Systems IGA168x and CyberPro framebuffers (linear non-VGA mode) 1107# Integraphics Systems IGA168x and CyberPro framebuffers (linear non-VGA mode)
1108# 1108#
1109device igsfb: wsemuldisplaydev, wsrasteremulops, rasops8, vcons, videomode 1109device igsfb: wsemuldisplaydev, wsrasteremulops, rasops8, vcons, videomode
1110file dev/ic/igsfb.c igsfb needs-flag 1110file dev/ic/igsfb.c igsfb needs-flag
1111file dev/ic/igsfb_subr.c igsfb 1111file dev/ic/igsfb_subr.c igsfb
1112 1112
1113device chipsfb: wsemuldisplaydev, rasops8, vcons, videomode 1113device chipsfb: wsemuldisplaydev, rasops8, vcons, videomode
1114file dev/ic/ct65550.c chipsfb 1114file dev/ic/ct65550.c chipsfb
1115defflag opt_chipsfb.h CHIPSFB_DEBUG 1115defflag opt_chipsfb.h CHIPSFB_DEBUG
1116defflag opt_chipsfb.h CHIPSFB_WAIT 1116defflag opt_chipsfb.h CHIPSFB_WAIT
1117 1117
1118# STI (hp graphics) 1118# STI (hp graphics)
1119device sti: wsemuldisplaydev 1119device sti: wsemuldisplaydev
1120file dev/ic/sti.c sti & (sti_pci | sti_gedoens) 1120file dev/ic/sti.c sti
1121 1121
1122include "dev/wscons/files.wscons" 1122include "dev/wscons/files.wscons"
1123include "dev/rasops/files.rasops" 1123include "dev/rasops/files.rasops"
1124include "dev/wsfont/files.wsfont" 1124include "dev/wsfont/files.wsfont"
1125include "dev/wsfb/files.wsfb" 1125include "dev/wsfb/files.wsfb"
1126 1126
1127# Attributes which machine-independent bus support can be attached to. 1127# Attributes which machine-independent bus support can be attached to.
1128# These should be defined here, because some of these busses can have 1128# These should be defined here, because some of these busses can have
1129# devices which provide these attributes, and we'd like to avoid hairy 1129# devices which provide these attributes, and we'd like to avoid hairy
1130# ordering constraints on inclusion of the busses' "files" files. 1130# ordering constraints on inclusion of the busses' "files" files.
1131# 1131#
1132define isabus { } # ISA attachment 1132define isabus { } # ISA attachment
1133define eisabus { } # EISA attachment 1133define eisabus { } # EISA attachment
@@ -1143,37 +1143,39 @@ define cbbus { } # CardBus attachment @@ -1143,37 +1143,39 @@ define cbbus { } # CardBus attachment
1143define pcmciaslot { } # PCMCIA slot itself 1143define pcmciaslot { } # PCMCIA slot itself
1144define sdmmcbus { } # SD/MMC attachment 1144define sdmmcbus { } # SD/MMC attachment
1145 1145
1146# We need the USB bus controllers here so different busses can 1146# We need the USB bus controllers here so different busses can
1147# use them in an 'attach-with'. 1147# use them in an 'attach-with'.
1148# UHCI USB controller 1148# UHCI USB controller
1149# 1149#
1150 1150
1151defparam USB_MEM_RESERVE 1151defparam USB_MEM_RESERVE
1152 1152
1153define usbroothub 1153define usbroothub
1154file dev/usb/usbroothub_subr.c usbroothub 1154file dev/usb/usbroothub_subr.c usbroothub
1155 1155
1156device uhci: usbus, usbroothub 1156define usb_dma
 1157
 1158device uhci: usbus, usbroothub, usb_dma
1157file dev/usb/uhci.c uhci needs-flag 1159file dev/usb/uhci.c uhci needs-flag
1158 1160
1159# OHCI USB controller 1161# OHCI USB controller
1160# 1162#
1161device ohci: usbus, usbroothub 1163device ohci: usbus, usbroothub, usb_dma
1162file dev/usb/ohci.c ohci needs-flag 1164file dev/usb/ohci.c ohci needs-flag
1163 1165
1164# EHCI USB controller 1166# EHCI USB controller
1165# 1167#
1166device ehci: usbus, usbroothub 1168device ehci: usbus, usbroothub, usb_dma
1167file dev/usb/ehci.c ehci needs-flag 1169file dev/usb/ehci.c ehci needs-flag
1168 1170
1169# SL811HS/T USB controller 1171# SL811HS/T USB controller
1170defflag opt_slhci.h SLHCI_DEBUG SLHCI_TRY_LSVH SLHCI_PROFILE_TRANSFER 1172defflag opt_slhci.h SLHCI_DEBUG SLHCI_TRY_LSVH SLHCI_PROFILE_TRANSFER
1171device slhci: usbus, usbroothub 1173device slhci: usbus, usbroothub
1172file dev/ic/sl811hs.c slhci needs-flag 1174file dev/ic/sl811hs.c slhci needs-flag
1173 1175
1174# USB HID processing (as used by bluetooth and usb code) 1176# USB HID processing (as used by bluetooth and usb code)
1175define hid 1177define hid
1176file dev/usb/hid.c hid 1178file dev/usb/hid.c hid
1177 1179
1178# SD Host controller 1180# SD Host controller
1179device sdhc: sdmmcbus 1181device sdhc: sdmmcbus

cvs diff -r1.104 -r1.105 src/sys/dev/usb/files.usb (expand / switch to unified diff)

--- src/sys/dev/usb/files.usb 2010/12/27 20:42:51 1.104
+++ src/sys/dev/usb/files.usb 2011/03/20 17:54:03 1.105
@@ -1,36 +1,36 @@ @@ -1,36 +1,36 @@
1# $NetBSD: files.usb,v 1.104 2010/12/27 20:42:51 jmcneill Exp $ 1# $NetBSD: files.usb,v 1.105 2011/03/20 17:54:03 tsutsui Exp $
2# 2#
3# Config file and device description for machine-independent USB code. 3# Config file and device description for machine-independent USB code.
4# Included by ports that need it. Ports that use it must provide 4# Included by ports that need it. Ports that use it must provide
5# their own "major" declarations for the appropriate devices. 5# their own "major" declarations for the appropriate devices.
6 6
7defflag USBVERBOSE 7defflag USBVERBOSE
8defflag opt_usb.h USB_FRAG_DMA_WORKAROUND 8defflag opt_usb.h USB_FRAG_DMA_WORKAROUND
9 9
10defflag opt_uvideo.h UVIDEO_DEBUG 10defflag opt_uvideo.h UVIDEO_DEBUG
11 11
12define usbroothubif { } 12define usbroothubif { }
13define usbdevif { [port = -1], [configuration = -1], [interface = -1], 13define usbdevif { [port = -1], [configuration = -1], [interface = -1],
14 [vendor = -1], [product = -1], [release = -1] } 14 [vendor = -1], [product = -1], [release = -1] }
15define usbifif { [port = -1], [configuration = -1], [interface = -1], 15define usbifif { [port = -1], [configuration = -1], [interface = -1],
16 [vendor = -1], [product = -1], [release = -1] } 16 [vendor = -1], [product = -1], [release = -1] }
17 17
18device usb: usbroothubif 18device usb: usbroothubif
19attach usb at usbus 19attach usb at usbus
20file dev/usb/usb.c usb needs-flag 20file dev/usb/usb.c usb needs-flag
21file dev/usb/usbdi.c usb 21file dev/usb/usbdi.c usb
22file dev/usb/usbdi_util.c usb 22file dev/usb/usbdi_util.c usb
23file dev/usb/usb_mem.c usb 23file dev/usb/usb_mem.c usb & usb_dma
24file dev/usb/usb_subr.c usb 24file dev/usb/usb_subr.c usb
25file dev/usb/usb_quirks.c usb 25file dev/usb/usb_quirks.c usb
26file dev/usb/usb_verbose.c usb & usbverbose 26file dev/usb/usb_verbose.c usb & usbverbose
27 27
28# Hub driver 28# Hub driver
29device uhub: usbdevif, usbifif 29device uhub: usbdevif, usbifif
30attach uhub at usbroothubif with uroothub 30attach uhub at usbroothubif with uroothub
31attach uhub at usbdevif 31attach uhub at usbdevif
32file dev/usb/uhub.c usb 32file dev/usb/uhub.c usb
33 33
34# Modem and com serial port "bus" 34# Modem and com serial port "bus"
35define ucombus {[ portno = -1 ]} 35define ucombus {[ portno = -1 ]}
36 36