Re: FT232H variant in uftdi(4)

2020-12-09 Thread Theo de Raadt
I'm not sure about this chunk.

There are fdti chipsets that expose two uftdi, with a ucom each.

But maybe there are chipsets that expose one uftdi, which has two ucom?
It could be saying such a model is not supported.

If that is the gap, it is wrong to say ucom needs extending.  uftdi would
need to be extended to support two ucom subsids.

Daniel Bolgheroni  wrote:

> diff --git a/sys/dev/usb/uftdi.c b/sys/dev/usb/uftdi.c
> index fb7b8ae8621..80eb3f2c928 100644
> --- a/sys/dev/usb/uftdi.c
> +++ b/sys/dev/usb/uftdi.c
> @@ -34,11 +34,6 @@
>   * FTDI FT8U100AX serial adapter driver
>   */
> 
> -/*
> - * XXX This driver will not support multiple serial ports.
> - * XXX The ucom layer needs to be extended first.
> - */
> -
>  #include 
>  #include 
>  #include 



Re: FT232H variant in uftdi(4)

2020-12-09 Thread Daniel Bolgheroni
On Wed, Dec 09, 2020 at 09:11:35AM +0100, Jan Klemkow wrote:
> On Tue, Dec 08, 2020 at 09:03:53PM -0300, Daniel Bolgheroni wrote:
> > I have a FT232H variant (marked FT232HQ, 0403:6014) which works with 
> > uftdi(4).
> > 
> > Still related to uftdi(4), sys/dev/usb/ftdi.c has a comment saying uftdi(4)
> > does not support multiple serial ports because ucom(4), but I'm able to use
> > both ucom(4) in parallel from the same FT2232H (dual).
> 
> Hi Daniel,
> 
> How does your device attach?  Could you send with your device attached?

Hi Jan,

In the case of FT232H(Q), before the patch adding it to usbdevs, it was
attaching as ugen(4).  After the patch:

uftdi0 at uhub0 port 1 configuration 1 interface 0 "FTDI Single RS232-HS" rev 
2.00/9.00 addr 3
ucom0 at uftdi0 portno 1

In the case of FT2232H (dual):

uftdi0 at uhub0 port 2 configuration 1 interface 0 "FTDI Dual RS232-HS" rev 
2.00/7.00 addr 3
ucom0 at uftdi0 portno 1
uftdi1 at uhub0 port 2 configuration 1 interface 1 "FTDI Dual RS232-HS" rev 
2.00/7.00 addr 3
ucom1 at uftdi1 portno 2

The full dmesg is below.  Custom kernel, but the only change is the IDs for the
device I mentioned before.

Thank you.

full dmesg:
OpenBSD 6.8-current (GENERIC.MP) #9: Tue Dec  8 10:57:52 -03 2020

dbolgheroni@a320:/home/dbolgheroni/openbsd/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8469942272 (8077MB)
avail mem = 8197922816 (7818MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xccbfd000 (64 entries)
bios0: vendor LENOVO version "N10ET54W (1.33 )" date 09/18/2018
bios0: LENOVO 20CL006VBR
acpi0 at bios0: ACPI 5.0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SLIC ASF! HPET ECDT APIC MCFG SSDT SSDT SSDT SSDT SSDT 
SSDT SSDT SSDT SSDT PCCT SSDT UEFI MSDM BATB FPDT UEFI BGRT DMAR
acpi0: wakeup devices LID_(S4) SLPB(S3) IGBE(S4) EXP2(S4) XHCI(S3) EHC1(S3)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpiec0 at acpi0
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz, 2494.57 MHz, 06-3d-04
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,RDSEED,ADX,SMAP,PT,SRBDS_CTRL,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,MELTDOWN
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1.1.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz, 2494.25 MHz, 06-3d-04
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,RDSEED,ADX,SMAP,PT,SRBDS_CTRL,MD_CLEAR,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,MELTDOWN
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 40 pins
acpimcfg0 at acpi0
acpimcfg0: addr 0xf800, bus 0-63
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEG_)
acpiprt2 at acpi0: bus 2 (EXP1)
acpiprt3 at acpi0: bus 3 (EXP2)
acpiprt4 at acpi0: bus -1 (EXP3)
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpipci0 at acpi0 PCI0: 0x 0x0011 0x0001
acpicmos0 at acpi0
acpibat0 at acpi0: BAT0 model "45N1773" serial  1004 type LION oem "SANYO"
acpibat1 at acpi0: BAT1 model "45N1775" serial   632 type LION oem "SANYO"
acpiac0 at acpi0: AC unit online
acpithinkpad0 at acpi0: version 1.0
"PNP0C14" at acpi0 not configured
"PNP0C14" at acpi0 not configured
"PNP0C14" at acpi0 not configured
"INT340F" at acpi0 not configured
acpicpu0 at acpi0: C3(200@233 mwait.1@0x40), C2(200@148 mwait.1@0x33), 
C1(1000@1 mwait.1), PSS
acpicpu1 at acpi0: C3(200@233 mwait.1@0x40), C2(200@148 mwait.1@0x33), 
C1(1000@1 mwait.1), PSS
acpipwrres0 at acpi0: PUBS, resource for XHCI, EHC1
acpipwrres1 at acpi0: NVP3, resource for PEG_
acpipwrres2 at acpi0: NVP2, resource for PEG_
acpitz0 at acpi0: critical temperature is 128 degC
acpivideo0 at acpi0: VID_
acpivout0 at acpivideo0: LCD0
acpivideo1 at acpi0: VID_
cpu0: using VERW MDS workaround (except on vmm entry)
cpu0: Enhanced SpeedStep 2494 MHz: speeds: 2601, 2600, 2500, 2300, 2100, 2000, 
1800, 1700, 1500, 1400, 1200, 1100, 900, 800, 600, 500 MHz
pci0 at mainbus0 bus 

Re: FT232H variant in uftdi(4)

2020-12-09 Thread Jan Klemkow
On Wed, Dec 09, 2020 at 09:11:35AM +0100, Jan Klemkow wrote:
> On Tue, Dec 08, 2020 at 09:03:53PM -0300, Daniel Bolgheroni wrote:
> > I have a FT232H variant (marked FT232HQ, 0403:6014) which works with 
> > uftdi(4).
> > 
> > Still related to uftdi(4), sys/dev/usb/ftdi.c has a comment saying uftdi(4)
> > does not support multiple serial ports because ucom(4), but I'm able to use
> > both ucom(4) in parallel from the same FT2232H (dual).
> 
> Hi Daniel,
> 
> How does your device attach?

Could you send a dmesg with your device attached?

sorry, for the noise.

> Thanks,
> Jan
> 
> > diff --git a/sys/dev/usb/uftdi.c b/sys/dev/usb/uftdi.c
> > index fb7b8ae8621..80eb3f2c928 100644
> > --- a/sys/dev/usb/uftdi.c
> > +++ b/sys/dev/usb/uftdi.c
> > @@ -34,11 +34,6 @@
> >   * FTDI FT8U100AX serial adapter driver
> >   */
> > 
> > -/*
> > - * XXX This driver will not support multiple serial ports.
> > - * XXX The ucom layer needs to be extended first.
> > - */



Re: FT232H variant in uftdi(4)

2020-12-09 Thread Jan Klemkow
On Tue, Dec 08, 2020 at 09:03:53PM -0300, Daniel Bolgheroni wrote:
> I have a FT232H variant (marked FT232HQ, 0403:6014) which works with uftdi(4).
> 
> Still related to uftdi(4), sys/dev/usb/ftdi.c has a comment saying uftdi(4)
> does not support multiple serial ports because ucom(4), but I'm able to use
> both ucom(4) in parallel from the same FT2232H (dual).

Hi Daniel,

How does your device attach?  Could you send with your device attached?

Thanks,
Jan

> diff --git a/sys/dev/usb/uftdi.c b/sys/dev/usb/uftdi.c
> index fb7b8ae8621..80eb3f2c928 100644
> --- a/sys/dev/usb/uftdi.c
> +++ b/sys/dev/usb/uftdi.c
> @@ -34,11 +34,6 @@
>   * FTDI FT8U100AX serial adapter driver
>   */
> 
> -/*
> - * XXX This driver will not support multiple serial ports.
> - * XXX The ucom layer needs to be extended first.
> - */