Date: Sat, 21 Sep 2024 00:10:14 +0100 From: Warner Losh <imp@bsdimp.com> To: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net> Cc: "freebsd-hackers@freebsd.org" <hackers@freebsd.org> Subject: Re: gpio pins -> tty/cua device Message-ID: <CANCZdfpknUfuM_CTrM4A4CNzgbw78ZDeLg=qRMMuhcbeFxyX0g@mail.gmail.com> In-Reply-To: <rn7sr193-r318-163r-404p-9oon889pq2n4@yvfgf.mnoonqbm.arg> References: <pp20o9o7-7937-o09n-or3n-4rp409q13q46@yvfgf.mnoonqbm.arg> <CANCZdfr70CsutBZ_eUP1dRK_6XFgjpZCKZaWf6LFMF8m1iwkRA@mail.gmail.com> <rn7sr193-r318-163r-404p-9oon889pq2n4@yvfgf.mnoonqbm.arg>
next in thread | previous in thread | raw e-mail | index | archive | help
--00000000000000ba3006229525be Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Sep 20, 2024, 11:07=E2=80=AFPM Bjoern A. Zeeb < bzeeb-lists@lists.zabbadoz.net> wrote: > On Fri, 20 Sep 2024, Warner Losh wrote: > > > On Fri, Sep 20, 2024, 10:49=E2=80=AFPM Bjoern A. Zeeb < > > bzeeb-lists@lists.zabbadoz.net> wrote: > > > >> Hi. > >> > >> I have one/two GPIO pins for RX/TX (possibly on two controllers) which > >> on the other end have a serial console which I would love to read/wwri= te > >> to. > >> > >> Do we have any glue which takes two GPIO pins and present them as > tty/cua > >> device? > >> > > > > No. We don't do serial emulation through software. You need high > precision > > timers paired with it to even start. And input bytes are way harder to > get > > right. Likely need a dedicated thread for any decent data rates. What > speed > > were you hoping for? > > Default of this thing is 115200 ; in theory it can be changed but > probably not initially in my case today. > > Background is that some SFPs expose their (embedded u-boot/Linux) serial > console on two PINs (which may be overlayed with other SFF functionality > which makes this all tricky). > > I am just trying to find a way for remote debugging without hands on > given one of the SFPs went haywire. > > > So more helpful if future HW revisions would have these pins on a header > and a USB adapter could be attached or if they were alternatively routed > to an intenral UART of the SoC and one could switch them back and forth > or something? > Many SoCs have pinmux. Maybe you're lucky and the pins you want to use can be muxed via FDT changes to a UART, which makes things suddenly easy. Warner /bz > > -- > Bjoern A. Zeeb r15:7 --00000000000000ba3006229525be Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" = class=3D"gmail_attr">On Fri, Sep 20, 2024, 11:07=E2=80=AFPM Bjoern A. Zeeb = <<a href=3D"mailto:bzeeb-lists@lists.zabbadoz.net">bzeeb-lists@lists.zab= badoz.net</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style= =3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, = 20 Sep 2024, Warner Losh wrote:<br> <br> > On Fri, Sep 20, 2024, 10:49=E2=80=AFPM Bjoern A. Zeeb <<br> > <a href=3D"mailto:bzeeb-lists@lists.zabbadoz.net" target=3D"_blank" re= l=3D"noreferrer">bzeeb-lists@lists.zabbadoz.net</a>> wrote:<br> ><br> >> Hi.<br> >><br> >> I have one/two GPIO pins for RX/TX (possibly on two controllers) w= hich<br> >> on the other end have a serial console which I would love to read/= wwrite<br> >> to.<br> >><br> >> Do we have any glue which takes two GPIO pins and present them as = tty/cua<br> >> device?<br> >><br> ><br> > No. We don't do serial emulation through software. You need high p= recision<br> > timers paired with it to even start. And input bytes are way harder to= get<br> > right. Likely need a dedicated thread for any decent data rates. What = speed<br> > were you hoping for?<br> <br> Default of this thing is 115200 ; in theory it can be changed but<br> probably not initially in my case today.<br> <br> Background is that some SFPs expose their (embedded u-boot/Linux) serial<br= > console on two PINs (which may be overlayed with other SFF functionality<br= > which makes this all tricky).<br> <br> I am just trying to find a way for remote debugging without hands on<br> given one of the SFPs went haywire.<br> <br> <br> So more helpful if future HW revisions would have these pins on a header<br= > and a USB adapter could be attached or if they were alternatively routed<br= > to an intenral UART of the SoC and one could switch them back and forth<br> or something?<br></blockquote></div></div><div dir=3D"auto"><br></div><div = dir=3D"auto"><br></div><div dir=3D"auto">Many SoCs have pinmux. Maybe you&#= 39;re lucky and the pins you want to use can be muxed via FDT changes to a = UART, which makes things suddenly easy.</div><div dir=3D"auto"><br></div><d= iv dir=3D"auto">Warner</div><div dir=3D"auto"><br></div><div dir=3D"auto"><= div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin= :0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> /bz<br> <br> -- <br> Bjoern A. Zeeb=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0r15:7</blockquote></= div></div></div> --00000000000000ba3006229525be--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpknUfuM_CTrM4A4CNzgbw78ZDeLg=qRMMuhcbeFxyX0g>