From nobody Tue Jan 24 18:43:56 2023 X-Original-To: freebsd-arm@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 4P1bV21XrKz3bCpQ for ; Tue, 24 Jan 2023 18:44:10 +0000 (UTC) (envelope-from jjrushford@gmail.com) Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P1bV119G5z3lvQ for ; Tue, 24 Jan 2023 18:44:09 +0000 (UTC) (envelope-from jjrushford@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=bbPo4EF+; spf=pass (mx1.freebsd.org: domain of jjrushford@gmail.com designates 2607:f8b0:4864:20::134 as permitted sender) smtp.mailfrom=jjrushford@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-il1-x134.google.com with SMTP id m15so7832787ilq.2 for ; Tue, 24 Jan 2023 10:44:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/QN3dr+i3CXrqh6mBnmFj8MC+szoTR1cDa8HQb+J4OE=; b=bbPo4EF+ohyR+fKhf261/DCmBEHV18iCQWOTmpMvzGPVA5D4MQ6o7YkzUhzt0GYIpj L+W4CDc1SDoxzwB/EPyyep2HiIDRY48XDMO3KE9tFYQ7w2K9Z11HbznbFMAYDKerNBqM bCdcxEX13DLO5fYOpWb+GDblKkKLRaG57XVf7QDflmFN4sAU6mrZaFZfYN06KG4yDPnk nw/WqkdXiXLgT4MchwvsFtPSYITfjL3mg7tIkOgmdk+n4oLNN+6QSjtmQs79MFFkqBbP l0CkINOgpJROn/4Y0tXR6+Ign0osd8DP53vFltLzYiG3X33eVlcEjFEIiR1mObHfCIjh 0smQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/QN3dr+i3CXrqh6mBnmFj8MC+szoTR1cDa8HQb+J4OE=; b=5hrY4Gjuqbo4jNzsoQjJmpQM7L/zTg0rRFzA4NDMlEMsFcAr+rsIuuT9yuD2+lcHg9 Neb91jEkvX5A8k3xOYG1cx/c3MEHojOf5HI44hRdCmRC7neMhpqCQpCo6qGuIiIgeWJ1 KH4N62px7iQ94N3GAYEzW+HmSBH4cvo2Z/MUmO/+HgDvfxCBNM+KXI1QJID25jVeBc6C AX95sHOpVsF6FOuCJ7+LA+XC8AfKquKCEuR9QEgTH0skHPAwDGOSWNbmRJgrAnPorsbS hpS3p1WOUWaoTNHJmFTxdtuL/qYGwQrCtzYPvl+RxlO3LLDa+VsfYXaV+4c2hqA5TT0c s3Rg== X-Gm-Message-State: AO0yUKU5L18Y+319FLuGyk2CxemzFyH79B9esJkRbQE5rDLugPlwyWmw NQGrrkT0Bew52CwKzDN+2Rs= X-Google-Smtp-Source: AK7set+ggp168OHFbhNDFMOa8BDgFW2UdSQcSyRIlUGYGMzmLq+ECFgeoQZP+5Bgc1Tk8GIRU/VrnQ== X-Received: by 2002:a92:cda3:0:b0:310:8c3e:e512 with SMTP id g3-20020a92cda3000000b003108c3ee512mr3412123ild.24.1674585847293; Tue, 24 Jan 2023 10:44:07 -0800 (PST) Received: from smtpclient.apple ([2601:280:587f:1450:84e6:9743:8888:b2e8]) by smtp.gmail.com with ESMTPSA id k10-20020a056638370a00b0039df8e7af39sm934009jav.41.2023.01.24.10.44.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2023 10:44:06 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: Enabling Raspberry Pi 4B Uarts, specifically uart3 From: John Rushford In-Reply-To: Date: Tue, 24 Jan 2023 11:43:56 -0700 Cc: freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <2bd8e680-df6a-cfe1-fbd2-ade1ac2d0497@thegalacticzoo.com> To: Fred Finster X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spamd-Result: default: False [-3.48 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.984]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::134:from]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org] X-Rspamd-Queue-Id: 4P1bV119G5z3lvQ X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N Fred, Looking at the pstat -t output, I see no data available on ttyu1. I = know that there is data coming from the GPS card as I can see it when I switch OS to Debian. This confirms the problem = though with the additional uarts. pstat -t LINE INQ CAN LIN LOW OUTQ USE LOW COL SESS PGID STATE ttyu0 23040 0 0 2304 23064 0 2307 7 1167 1167 ICOil ttyu1 0 0 0 0 0 0 0 4 0 0 IC ttyv0 1920 0 0 192 1984 0 199 7 1159 1159 Oil ttyv1 1920 0 0 192 1984 0 199 7 1160 1160 Oil ttyv2 1920 0 0 192 1984 0 199 7 1161 1161 Oil ttyv3 1920 0 0 192 1984 0 199 7 1162 1162 Oil ttyv4 1920 0 0 192 1984 0 199 7 1163 1163 Oil ttyv5 1920 0 0 192 1984 0 199 7 1164 1164 Oil ttyv6 1920 0 0 192 1984 0 199 7 1165 1165 Oil ttyv7 1920 0 0 192 1984 0 199 7 1166 1166 Oil ttyv8 0 0 0 0 0 0 0 0 0 0 - ttyv9 0 0 0 0 0 0 0 0 0 0 - ttyva 0 0 0 0 0 0 0 0 0 0 - ttyvb 0 0 0 0 0 0 0 0 0 0 - pts/0 7680 0 0 768 7688 0 769 0 1336 1420 Oi pts/1 7680 0 0 768 7688 0 769 36 1380 1380 Oi On Jan 24, 2023, at 10:11 AM, John Rushford = wrote: >=20 > Fred, >=20 > This is my /boot/loader.conf. After rebooting, no change and no data = on uart3. BTW, FreeBSD does=20 > not create a /dev/ttyU1. =46rom the config.txt with dtoverlay=3Duart3, = FreeBSD creates a /dev/ttyu1 >=20 > ucom_load=3D"YES" > umodem_load=3D"YES" > usb_template_load=3D"YES" > hw.usb.template=3D3 > umodem_load=3D"YES" > umodem_load=3D"YES" > # Multiple console (serial+efi gop) enabled. > boot_multicons=3D"YES" > boot_serial=3D"YES" > # Disable the beastie menu and color > beastie_disable=3D"YES" > loader_color=3D"NO" > kern.vty=3Dvt > gpiopps_load=3D"YES"This is my /boot/loader.conf: >=20 > /boot/msdos/config.txt: >=20 > cat msdos/config.txt: >=20 > [all] > arm_64bit=3D1 > dtparam=3Daudio=3Don,i2c_arm=3Don,spi=3Don > dtoverlay=3Dmmc > dtoverlay=3Ddisable-bt > device_tree_address=3D0x4000 > kernel=3Du-boot.bin > dtoverlay=3Dpps-gpio,gpiopin=3D18 > dtoverlay=3Duart3 > enable_uart=3D1 >=20 > [pi4] > # hdmi_safe=3D1 > armstub=3Darmstub8-gic.bin >=20 > # dmesg|grep uart > uart0: mem 0x7e201000-0x7e2011ff irq 16 on = simplebus0 > uart0: console (115200,n,8,1) > uart1: mem 0x7e201600-0x7e2017ff irq 43 on = simplebus0 >=20 > The memory address 0x7e201600 corresponds to that assigned to uart3 = in: src/freebsd-src/sys/contrib/device-tree/src/arm/bcm2711.dtsi=20 >=20 > Still no data seen >=20 > thanks > John Rushford >=20 >=20 >> On Jan 24, 2023, at 6:09 AM, Fred Finster = wrote: >>=20 >> */ >> /* >>=20 >> */From:/* >> */Date:/*Sun, 22 Jan 2023 21:36:36 UTC >>=20 >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269104 >>=20 >> Bug ID: 269104 >> Summary: The uarts2 - uarts5 do not function on raspberry pi = 4B >> Product: Base System >> Version: 13.1-RELEASE >> Hardware: arm64 >> OS: Any >> Status: New >> Severity: Affects Only Me >> Priority: --- >> Component: arm >> Assignee: freebsd-arm@FreeBSD.org >> Reporter: jjrushford@gmail.com >>=20 >> I=E2=80=99ve tried using the additional serial ports that are = available with a >> raspberry pi 4B by enabling them in config.txt and when I try to read = data on >> them, I see nothing. >>=20 >> Specifically, I=E2=80=99ve wired an Adafruit ultimate GPS to uart3, = gpio pins 4 and 5. >> I=E2=80=99ve built the RPI-firmware port and copied the uart0-5 = dtb=E2=80=99s to >> /boot/msdos/overlays. I then enable uart3 in /boot/msdos/config.txt = with >> dtoverlay=3Duart3 and reboot. After boot, I see that FreeBSD has = created >> /dev/ttyu1 and /dev/cuau1 in the dev tree for uart3. When I try = reading from >> ttyu1 or cuau1, I do not see any data whatsoever. I=E2=80=99ve set = the baud rate to >> 9600 and disabled flow control but still no data is seen. If I = change the >> wiring to use ttyu0, gpio pins 14 and 15, I do see data there. >>=20 >> Just to verify the hardware, I installed a different SD card with = raspberry pi >> OS, Debian, and enabled uart3 in config.txt. When I read the = /dev/ttyAMA1 I do >> see the NMEA time stamps coming in uart3 at 9600 baud with no issue. = Next I >> reboot back to FreeBSD 13.1, I cannot see any data from The GPS card = on ttyu1 >> or cuau1. >>=20 >> --=20 >> You are receiving this mail because: >> You are the assignee for the bug. >>=20 >> In the aarch64 arm64 Raspberry Pi FreeBSD, maybe you need to enable = some kernel modules >> kldstat >> kldload ucom umodem usb_template >> sysctl hw.usb.template=3D3 >>=20 >> add in file /boot/loader.conf >>=20 >> ucom_load=3D"YES" >> umodem_load=3D"YES" >> usb_template_load=3D"YES" >> hw.usb.template=3D3 >>=20 >>=20 >> *cu -s 9600 -l /dev/ttyU1 What do you see? or rather cu? :>) Do = report back success or failure or changes necessary to make work, = please. = *https://forums.raspberrypi.com/viewtopic.php?t=3D244827&sid=3Df4a784a3c40= ed0940e6fbb9f81af5015&start=3D25#p1590882 = >>=20 >>=20 >> Re: Pi-4 Activating additional UART ports >> = >>=20 >> Mon Jan 06, 2020 10:36 am = >>=20 >> On all Pis, UART0 is a PL011 that appear to Linux as ttyAMA, and = UART1 is an 8250 clone that appears as ttyS0. On a Pi4, UART2-5 are = additional PL011s that also appear as ttyAMA. The number starts at 0 = for the first enabled PL011 and counts up through all the enabled = interfaces. The numbering is stable for any given combination of UARTs, = but enabling or disabling one can change the number assignments of = others. >>=20 >> /PL011 appear to FreeBSD/*as /dev/ttyUx So I wonder if one has to = enable ucom and umodem and usb_template to view serial data comming back = over what looks like a USB to serial interface? Your thoughts? = https://ghostbsd-arm64.blogspot.com/2023/01/hookup-gdb-to-black-magic-prob= e-v23.html * >>=20 >> My setup trying to connect to USB serial port under X86_64 FreeBSD 13 = to a Black Magic Probe >>=20 >>=20 >> --=20 >> Fred Finster >> fred@thegalacticzoo.com >> +1 971-718-9144 >> https://GhostBSD-ARM64.blogspot.com >> https://ghostbsd.org >>=20 >=20