I wanted to cross-connect the serial ports of my armv7 and riscv64 machines. Problem on riscv64: no uftdi driver. It looks like a lot of other USB drivers are missing in GENERIC, both generic drivers and hw-specific drivers: umodem, ugen, ulpt, uvideo, umb, uplcom etc. Feels like it would make sense to sync those devices from arm64/GENERIC instead of adding only what I need. Thoughts?
One glitch: usbdevs(8) isn't usable since usb(4) isn't wired in conf.c. With the diffbelow I can use usbdevs(8) on my hifive. ok for the usb.h/cdev_usb_init addition? diff --git a/sys/arch/riscv64/conf/GENERIC b/sys/arch/riscv64/conf/GENERIC index cd27318b503..225921eb04b 100644 --- a/sys/arch/riscv64/conf/GENERIC +++ b/sys/arch/riscv64/conf/GENERIC @@ -138,6 +138,8 @@ usb* at xhci? # USB devices uhub* at usb? uhub* at uhub? +uftdi* at uhub? # FTDI FT8U100AX serial adapter +ucom* at uftdi? uhidev* at uhub? uaudio* at uhub? # USB Audio audio* at uaudio? diff --git a/sys/arch/riscv64/riscv64/conf.c b/sys/arch/riscv64/riscv64/conf.c index 5256251a3a3..673fea27d85 100644 --- a/sys/arch/riscv64/riscv64/conf.c +++ b/sys/arch/riscv64/riscv64/conf.c @@ -88,10 +88,12 @@ cdev_decl(lpt); #include "midi.h" #include "ksyms.h" #include "kstat.h" +#include "usb.h" +#include "uhid.h" +#include "ucom.h" #include "radio.h" #include "drm.h" cdev_decl(drm); -#include "uhid.h" #include "fido.h" #include "wsdisplay.h" @@ -180,12 +182,12 @@ struct cdevsw cdevsw[] = cdev_notdef(), /* 59: i4b trace device */ cdev_notdef(), /* 60: i4b phone device */ /* End of reserved slots for isdn4bsd. */ - cdev_notdef(), /* 61: USB controller */ + cdev_usb_init(NUSB,usb), /* 61: USB controller */ cdev_usbdev_init(NUHID,uhid), /* 62: USB generic HID */ cdev_notdef(), /* 63: USB generic driver */ cdev_notdef(), /* 64: USB printers */ cdev_notdef(), /* 65: urio */ - cdev_notdef(), /* 66: USB tty */ + cdev_tty_init(NUCOM,ucom), /* 66: USB tty */ cdev_mouse_init(NWSKBD, wskbd), /* 67: keyboards */ cdev_mouse_init(NWSMOUSE, /* 68: mice */ wsmouse), -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE