Bug 276523 - serial console not functional orange pi 5 plus
Summary: serial console not functional orange pi 5 plus
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: 14.0-STABLE
Hardware: arm64 Any
: --- Affects Only Me
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-22 11:13 UTC by rdunkle
Modified: 2024-01-24 08:28 UTC (History)
1 user (show)

See Also:


Attachments
var/log/messages from boot -v (34.56 KB, text/plain)
2024-01-22 11:13 UTC, rdunkle
no flags Details
output --> sysctl -ad (466.95 KB, text/plain)
2024-01-22 16:05 UTC, rdunkle
no flags Details
acpidump -b (5.53 KB, application/x-zip-compressed)
2024-01-22 18:06 UTC, rdunkle
no flags Details
ns8250: Try to get the clock-frequency property (1.38 KB, patch)
2024-01-23 10:08 UTC, Emmanuel Vadot
no flags Details | Diff
acpidump after patch (5.53 KB, application/x-zip-compressed)
2024-01-23 14:16 UTC, rdunkle
no flags Details
boot -v terminal output and var-log-messages (11.24 KB, application/x-zip-compressed)
2024-01-24 08:28 UTC, rdunkle
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description rdunkle 2024-01-22 11:13:34 UTC
Created attachment 247841 [details]
var/log/messages from boot -v

FreeBSD14-stable  orange pi 5 plus
I see the same problem in FreeBSD 13.2
serial console works during the efi boot steps.
The console looks like this:
Setting currdev to disk0p2:
Loading /boot/defaults/loader.conf
Loading /boot/defaults/loader.conf
Loading /boot/device.hints
Loading /boot/loader.conf
The processors are identified and then serial output stops.
Final output looks like this:
output to serial always stops here--> I/TC: Secondary CPU 7 switching to normal world boot.
---
# dmesg | grep uart
uart0: <16750 or compatible> iomem 0xfeb50000-0xfeb50fff irq 21 on acpi0
uart0: fast interrupt
uart0: PPS capture mode: DCD
-- never see that typical line-->  uart0: console (115200,n,8,1)

I filed a bug report with the github efi project.
https://github.com/edk2-porting/edk2-rk3588/issues/118
---
I made the change as suggested to: 
sys/dev/uart/uart_dev_ns8250.c
line 452
{"HISI0031", &uart_ns8250_class, 0, 2, 0, 24000000, UART_F_BUSY_DETECT, "HiSilicon / Synopsys Designware UART"},
-----
I see the same problem with serial port.
Need guidance on how to fix this problem
Comment 1 Emmanuel Vadot freebsd_committer freebsd_triage 2024-01-22 13:08:21 UTC
Is there an ACPI method or property to get the base clock ?
Patching like you did will break what ever other hardware this compat was added for.
Comment 2 rdunkle 2024-01-22 16:05:42 UTC
Created attachment 247847 [details]
output --> sysctl -ad

attached a sysctl list from a non-patched system
Comment 3 Emmanuel Vadot freebsd_committer freebsd_triage 2024-01-22 16:50:42 UTC
sysctls won't help, do :
pkg install acpica-tools
/usr/local/bin/acpidump -b

and post the .dat file here.
Comment 4 rdunkle 2024-01-22 18:06:20 UTC
Created attachment 247848 [details]
acpidump -b
Comment 5 Emmanuel Vadot freebsd_committer freebsd_triage 2024-01-23 10:08:20 UTC
Created attachment 247879 [details]
ns8250: Try to get the clock-frequency property

Please try with this patch.
Comment 6 rdunkle 2024-01-23 14:16:53 UTC
Created attachment 247889 [details]
acpidump after patch
Comment 7 rdunkle 2024-01-23 14:18:05 UTC
the same results, no terminal.  attached new acpidump
Comment 8 Emmanuel Vadot freebsd_committer freebsd_triage 2024-01-23 18:34:09 UTC
No need to upload acpidump each time, this won't modify the table.
Also it looks like that my patch is useless because we already try to get the clock-frequency property (https://cgit.freebsd.org/src/tree/sys/dev/uart/uart_bus_acpi.c#n99) so I don't really know why it doesn't work here.
Can you share a boot -v, it might contain more info
Comment 9 rdunkle 2024-01-24 08:28:59 UTC
Created attachment 247917 [details]
boot -v terminal output and var-log-messages