From nobody Fri Sep 20 23:10:14 2024 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X9Sm36r1Cz5Xktq for ; Fri, 20 Sep 2024 23:10:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X9Sm358cmz40nN for ; Fri, 20 Sep 2024 23:10:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2055f630934so22410625ad.1 for ; Fri, 20 Sep 2024 16:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1726873826; x=1727478626; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=623MyVWJ1TI9gDvl6WkYs3HUm9mTJu/+IDBSfOOI3ZA=; b=lxEz4W51CO36lW+IFvMs4g/mt8UpPgPotZPD7+4ewdW/nD/3eZmAeoUkhafi2AUWYQ EDqLOxU/dWPvXyy76niI2xAeMTQAS8/FVgMdfSmbWJbSwn2PFpWoBoVL5WdW2W5irK3J zve4r60vturSyv9a8P0jFI0Jy6BTy/U3APZ27Totd6ikSippRglOcJMrAPp+GBVB0K+C KVu9dISLVYfYEgzAsp2oLEJOn9VIpeBRXOCMH6Ug0wcETAxk5Zeos0JrlxeKPeqzijl1 abK3Hk28ThBFIoxfRnHzgNcwap8i7p6WKX2uf+lXNnpQniDz2NT8SmMeL18AzZx36TCu 6yNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726873826; x=1727478626; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=623MyVWJ1TI9gDvl6WkYs3HUm9mTJu/+IDBSfOOI3ZA=; b=FTmGmpqW3/+jEkgMMkT9t5GwN6XyL/HOxzbVOXtHzPL4DzKDZqPQEotUBWzu7Ri9NC QDc1eMMjRsG3YPo7RuXtUxDY6QJnMYF5wgL5p3c8Llw1+Z1RYJHks4Hj1/SAL7C2669y yDVQxCY//n4agRe+FLs9ZpNrjxG5gO+aLfeKr1FCRKJ04udwVliz14FDtYL0k0uTwGSG CbjC6CCJCQUIuNriw9zW2P6EO0WCSw1NThYuerbu/6stRO25Q7pUNUwqptXRPm63hj/H eHAd/lCDC2/ufmqA4fI5NSxQtMlZL7QNzsf6q3vXuMXiwP+Uf2qev4H6co5wW2XPaDWr A4+A== X-Gm-Message-State: AOJu0Yw/c9lh4asKzIMrYndPfbqzTtLWDsO3lZ8koT5ecAwGSCztPMix 8Y6DBuaVfcIifYeWHCrTY/k3h1tZ6HMZCf3ylBdMPAzUMq2lVab2KTpnyuMgnQM2Pd+B/pquhYE EAroVFvSJYz0oVNUWCMOb3e9hgwe7kwRH8tJnBbOIqHzBDbUmKUQ= X-Google-Smtp-Source: AGHT+IEX3VlRrbgI0PEdVM0DAnKwQGiZT0YaRrp0r5JlBSRoDPYfuGyEcm64vLezyGqBDw06u5QbLbUOKE1uyP4pJaQ= X-Received: by 2002:a17:90b:3c48:b0:2d8:e3cc:6c0 with SMTP id 98e67ed59e1d1-2dd7f3daaa7mr5889612a91.1.1726873826530; Fri, 20 Sep 2024 16:10:26 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Sat, 21 Sep 2024 00:10:14 +0100 Message-ID: Subject: Re: gpio pins -> tty/cua device To: "Bjoern A. Zeeb" Cc: "freebsd-hackers@freebsd.org" Content-Type: multipart/alternative; boundary="00000000000000ba3006229525be" X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4X9Sm358cmz40nN X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --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


On Fri, Sep 20, 2024, 11:07=E2=80=AFPM Bjoern A. Zeeb = <bzeeb-lists@lists.zab= badoz.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) w= hich
>> on the other end have a serial console which I would love to read/= wwrite
>> 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 p= recision
> 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&#= 39;re lucky and the pins you want to use can be muxed via FDT changes to a = UART, which makes things suddenly easy.

Warner

<= div class=3D"gmail_quote">
/bz

--
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
--00000000000000ba3006229525be--