Closed jernejs closed 5 years ago
@miczyg1 isn't just configuration?
@pietrushnic it may be configuration, but it is not simple as it sounds. SeaBIOS serial console configuration is a file in CBFS, so the firmware has to be already prebuilt to support COM2. Runtime configuration of that feature is a lot of trouble or rather will require bunch of custom modifications. IMO the best option would be to prepare build system to support COM2. Serial output in coreboot will still require digging into SuperIO code as well. However I will try to schedule it for v4.8.0.6.
@jernejs unfortunately in light of above analysis the only way it can be addressed are:
I'm sorry, but those are the only options I can offer now. Maybe in future, we will get back to this topic, but cannot promise anything.
Could you generate a binary with com2 for console output instead of com1? A customer of ours is asking for that too.
Am Di., 23. Okt. 2018 um 15:30 Uhr schrieb Piotr Król < notifications@github.com>:
@jernejs https://github.com/jernejs unfortunately in light of above analysis the only way it can be addressed are:
- Gather a bigger audience to push the features or convince PC Engines that this is important features that firmware developers should spend time on
- Contribute patches
- Sponsor development directly or through the company you work in. Of course, if there is any business value in that feature.
I'm sorry, but those are the only options I can offer now. Maybe in future, we will get back to this topic, but cannot promise anything.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pcengines/coreboot/issues/212#issuecomment-432246209, or mute the thread https://github.com/notifications/unsubscribe-auth/ARUmfwFbG-eulpHmLf7ZQJ3EnbzTeRAhks5unxnfgaJpZM4Xud1K .
In this case I will prioritize implementing the feature, so it will be available in v4.8.0.6 release.
I can also support the request for such feature, in my case I would like COM1 to be used for connecting external UPS via nut-tools on pfSense (since most UPS devices have RS232 levels COM2 can't be used directly). I also don't mind having to use different BIOS binary for the COM2 output, and if we can help with something (testing/experimenting), please just say so. Thanks!
@istamov change is already prepared. Will be available in v4.8.0.6 along with guide how to build the binary Yourself. I think we will distribute also the binaries with COM2 this time, because it is not yet ready for runtime configuration.
@miczyg1 Thanks, I already saw pull request https://github.com/pcengines/coreboot/pull/214 and am looking forward to test it, when it is merged in v4.8.0.6. Any chance to also backport it to the legacy v4.0.20 too? I find it quite stable so far but if it is too much of a hassle, this will be just one more reason to migrate to the mainline v4.8.
@istamov yes, this is on our TODO list. v4.0.20 was already released, but will try to include it for v4.0.21.
Support for COM2 output will be available for v4.0.21: https://github.com/pcengines/coreboot/pull/215
apu2_com2_v4.0.21 apu2_com2_v4.8.0.6 apu3_com2_v4.0.21 apu3_com2_v4.8.0.6 apu4_com2_v4.0.21 apu4_com2_v4.8.0.6
These are binaries with console output redirection to COM2 in firmware. Please report any issues or suggestions, what can be improved. I already realize that it would be great to have it in runtime configuration.
There is also a guide how to build the binaries manually: https://github.com/pcengines/apu2-documentation/blob/master/docs/serial_console.md
Thanks Michał
Best regards, Michael Steinmann
Am Fr., 9. Nov. 2018 um 11:20 Uhr schrieb Michał Żygowski < notifications@github.com>:
apu2_com2_v4.0.21 https://cloud.3mdeb.com/index.php/s/ShUvqIZ2GFrwIOC/download apu2_com2_v4.8.0.6 https://cloud.3mdeb.com/index.php/s/ETVv4IEllzv1bLy/download apu3_com2_v4.0.21 https://cloud.3mdeb.com/index.php/s/5wY4z9pdOjVzstl/download apu3_com2_v4.8.0.6 https://cloud.3mdeb.com/index.php/s/SLzrYP8sJw1Tcea/download apu4_com2_v4.0.21 https://cloud.3mdeb.com/index.php/s/naCro8dKUe4pVEC/download apu4_com2_v4.8.0.6 https://cloud.3mdeb.com/index.php/s/wrmJQO9x97VH9Lv/download
These are binaries with console output redirection to COM2 in firmware. Please report any issues or suggestions, what can be improved. I already realize that it would be great to have it in runtime configuration.
There is also a guide how to build the binaries manually: https://github.com/pcengines/apu2-documentation/blob/master/docs/serial_console.md
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pcengines/coreboot/issues/212#issuecomment-437315280, or mute the thread https://github.com/notifications/unsubscribe-auth/ARUmfw5gOuzTjP8GKUbYc3pihfd446Q0ks5utVbSgaJpZM4Xud1K .
@miczyg1, thank you! I have just flashed v4.0.21 on APU2C4 remotely, but unfortunately lost access to it and didn't have remote console attached. Will try to recover it today, test it over the weekend and will report back.
@istamov of course, the console changed so there is no output on COM1 anymore (could be from OS only if console configured to ttyS0).
@miczyg1: Sorry, I meant that I lost access to the whole device (it is a test pfSense router) - when rebooted the lights (NIC indicators) are blinking, but the pfSense is unreachable, so will have to check on site what is going on (it is possible to be something pfSense-related).
@miczyg1: Under Ubuntu 16.04.3 it works just perfect - both BIOS and operating system terminal are working on COM2 and COM1 is "free" for another applications.
Under pfSense 2.4.4 it seems to hang at some point - the NIC LEDs are blinking, but the terminal is not responsive (please see below where it stops):
Successful boot, BIOS v4.0.20, console on COM1 (comconsole_port="0x3F8" >> /boot/loader.conf.local)
/boot/kernel/kernel text=0x17bf9f0 data=0xb93c38+0x517b18 syms=[0x8+0x197280+0x8+0x197de9]
/boot/entropy size=0x1000
/boot/kernel/zfs.ko size 0x381f00 at 0x2f9c000
loading required module 'opensolaris'
/boot/kernel/opensolaris.ko size 0xa3a0 at 0x331e000
Booting...
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2018 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.2-RELEASE-p3 #17 e6b497fa0a3(RELENG_2_4_4): Thu Sep 20 09:04:45 EDT 2018
root@buildbot3:/crossbuild/ce-244/obj/amd64/WvDslnYb/crossbuild/ce-244/pfSense/tmp/FreeBSD-src/sys/pfSense amd64
FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)
VT(vga): resolution 640x480
CPU: AMD GX-412TC SOC (998.16-MHz K8-class CPU)
Origin="AuthenticAMD" Id=0x730f01 Family=0x16 Model=0x30 Stepping=1
Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
Features2=0x3ed8220b<SSE3,PCLMULQDQ,MON,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AESNI,XSAVE,OSXSAVE,AVX,F16C>
AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
AMD Features2=0x1d4037ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,SKINIT,WDT,Topology,PNXC,DBE,PTSC,PL2I>
Structured Extended Features=0x8<BMI1>
XSAVE Features=0x1<XSAVEOPT>
SVM: NP,NRIP,AFlush,DAssist,NAsids=8
TSC: P-state invariant, performance statistics
real memory = 4815060992 (4592 MB)
avail memory = 4067495936 (3879 MB)
Event timer "LAPIC" quality 600
ACPI APIC Table: <CORE COREBOOT>
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 4 core(s)
ioapic1: Changing APIC ID to 5
ioapic0 <Version 2.1> irqs 0-23 on motherboard
ioapic1 <Version 2.1> irqs 24-55 on motherboard
SMP: AP CPU #3 Launched!
SMP: AP CPU #1 Launched!
SMP: AP CPU #2 Launched!
Timecounter "TSC" frequency 998159803 Hz quality 1000
ipw_bss: You need to read the LICENSE file in /usr/share/doc/legal/intel_ipw.LICENSE.
ipw_bss: If you agree with the license, set legal.intel_ipw.license_ack=1 in /boot/loader.conf.
module_register_init: MOD_LOAD (ipw_bss_fw, 0xffffffff80680430, 0) error 1
random: entropy device external interface
ipw_ibss: You need to read the LICENSE file in /usr/share/doc/legal/intel_ipw.LICENSE.
ipw_ibss: If you agree with the license, set legal.intel_ipw.license_ack=1 in /boot/loader.conf.
module_register_init: MOD_LOAD (ipw_ibss_fw, 0xffffffff806804e0, 0) error 1
ipw_monitor: You need to read the LICENSE file in /usr/share/doc/legal/intel_ipw.LICENSE.
ipw_monitor: If you agree with the license, set legal.intel_ipw.license_ack=1 in /boot/loader.conf.
module_register_init: MOD_LOAD (ipw_monitor_fw, 0xffffffff80680590, 0) error 1
wlan: mac acl policy registered
hn: tranparent VF mode, if_transmit will be used, instead of if_start
kbd0 at kbdmux0
netmap: loaded module
module_register_init: MOD_LOAD (vesa, 0xffffffff81209800, 0) error 19
nexus0
vtvga0: <VT VGA driver> on motherboard
cryptosoft0: <software crypto> on motherboard
padlock0: No ACE support.
acpi0: <CORE COREBOOT> on motherboard
acpi0: Power Button (fixed)
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
cpu2: <ACPI CPU> on acpi0
cpu3: <ACPI CPU> on acpi0
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
atrtc0: registered as a time-of-day clock, resolution 1.000000s
Event timer "RTC" frequency 32768 Hz quality 0
attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
Timecounter "ACPI-safe" frequency 3579545 Hz quality 850
acpi_timer0: <32-bit timer at 3.579545MHz> port 0x818-0x81b on acpi0
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 950
acpi_button0: <Power Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> at device 2.2 on pci0
pcib1: failed to allocate initial I/O port window: 0x1000-0x1fff
pci1: <ACPI PCI bus> on pcib1
igb0: <Intel(R) PRO/1000 Network Connection, Version - 2.5.3-k> mem 0xfe600000-0xfe61ffff,0xfe620000-0xfe623fff at device 0.0 on pci1
igb0: Using MSIX interrupts with 5 vectors
igb0: Ethernet address: xx:xx:xx:xx:xx:xx
igb0: Bound queue 0 to cpu 0
igb0: Bound queue 1 to cpu 1
igb0: Bound queue 2 to cpu 2
igb0: Bound queue 3 to cpu 3
igb0: netmap queues/slots: TX 4/1024, RX 4/1024
pcib2: <ACPI PCI-PCI bridge> at device 2.3 on pci0
pci2: <ACPI PCI bus> on pcib2
igb1: <Intel(R) PRO/1000 Network Connection, Version - 2.5.3-k> port 0x2000-0x201f mem 0xfe700000-0xfe71ffff,0xfe720000-0xfe723fff at device 0.0 on pci2
igb1: Using MSIX interrupts with 5 vectors
igb1: Ethernet address: xx:xx:xx:xx:xx:xx
igb1: Bound queue 0 to cpu 0
igb1: Bound queue 1 to cpu 1
igb1: Bound queue 2 to cpu 2
igb1: Bound queue 3 to cpu 3
igb1: netmap queues/slots: TX 4/1024, RX 4/1024
pcib3: <ACPI PCI-PCI bridge> at device 2.4 on pci0
pci3: <ACPI PCI bus> on pcib3
igb2: <Intel(R) PRO/1000 Network Connection, Version - 2.5.3-k> port 0x3000-0x301f mem 0xfe800000-0xfe81ffff,0xfe820000-0xfe823fff at device 0.0 on pci3
igb2: Using MSIX interrupts with 5 vectors
igb2: Ethernet address: xx:xx:xx:xx:xx:xx
igb2: Bound queue 0 to cpu 0
igb2: Bound queue 1 to cpu 1
igb2: Bound queue 2 to cpu 2
igb2: Bound queue 3 to cpu 3
igb2: netmap queues/slots: TX 4/1024, RX 4/1024
pci0: <encrypt/decrypt> at device 8.0 (no driver attached)
xhci0: <AMD FCH USB 3.0 controller> mem 0xfeb22000-0xfeb23fff at device 16.0 on pci0
xhci0: 32 bytes context size, 64-bit DMA
xhci0: Unable to map MSI-X table
usbus0 on xhci0
usbus0: 5.0Gbps Super Speed USB v3.0
ahci0: <AMD Hudson-2 AHCI SATA controller> port 0x4010-0x4017,0x4020-0x4023,0x4018-0x401f,0x4024-0x4027,0x4000-0x400f mem 0xfeb25000-0xfeb253ff at device 17.0 on pci0
ahci0: AHCI v1.30 with 2 6Gbps ports, Port Multiplier supported with FBS
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich1: <AHCI channel> at channel 1 on ahci0
ehci0: <AMD FCH USB 2.0 controller> mem 0xfeb25400-0xfeb254ff at device 19.0 on pci0
usbus1: EHCI version 1.0
usbus1 on ehci0
usbus1: 480Mbps High Speed USB v2.0
isab0: <PCI-ISA bridge> at device 20.3 on pci0
isa0: <ISA bus> on isab0
sdhci_pci0: <Generic SD HCI> mem 0xfeb25500-0xfeb255ff at device 20.7 on pci0
sdhci_pci0: 1 slot(s) allocated
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: console (115200,n,8,1)
orm0: <ISA Option ROMs> at iomem 0xc0000-0xc0fff,0xef000-0xeffff on isa0
ppc0: cannot reserve I/O port range
uart1: <16550 or compatible> at port 0x2f8 irq 3 on isa0
hwpstate0: <Cool`n'Quiet 2.0> on cpu0
ZFS NOTICE: Prefetch is disabled by default if less than 4GB of RAM is present;
to enable, add "vfs.zfs.prefetch_disable=0" to /boot/loader.conf.
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
Timecounters tick every 1.000 msec
ugen0.1: <0x1022 XHCI root HUB> at usbus0
ugen1.1: <AMD EHCI root HUB> at usbus1
uhub0: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
uhub1: <AMD EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
uhub0: 4 ports with 4 removable, self powered
uhub1: 2 ports with 2 removable, self powered
ugen1.2: <vendor 0x0438 product 0x7900> at usbus1
uhub2 on uhub1
uhub2: <vendor 0x0438 product 0x7900, class 9/0, rev 2.00/0.18, addr 2> on usbus1
uhub2: 4 ports with 4 removable, self powered
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <TCSUNBOW M3 60GB Q0526C> ACS-2 ATA SATA 3.x device
ada0: Serial Number xx:xx:xx:xx:xx:xx
ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 1024bytes)
ada0: Command Queueing enabled
ada0: 57241MB (117231408 512 byte sectors)
Trying to mount root from zfs:zroot/ROOT/default []...
Configuring crash dumps...
Using /dev/ada0p2 for dump device.
Filesystems are clean, continuing...
Mounting filesystems...
Setting up memory disks...random: unblocking device.
done.
Restoring contents of RAM disk store... done.
__
_ __ / _|___ ___ _ __ ___ ___
| '_ \| |_/ __|/ _ \ '_ \/ __|/ _ \
| |_) | _\__ \ __/ | | \__ \ __/
| .__/|_| |___/\___|_| |_|___/\___|
|_|
Welcome to pfSense 2.4.4-RELEASE...
Dump directory does not exist. Savecore not run.
...ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/ipsec /usr/local/lib/perl5/5.26/mach/CORE
32-bit compatibility ldconfig path:
done.
External config loader 1.0 is now starting...
Launching the init system...Updating CPU Microcode...
CPU: AMD GX-412TC SOC (998.16-MHz K8-class CPU)
Origin="AuthenticAMD" Id=0x730f01 Family=0x16 Model=0x30 Stepping=1
Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
Features2=0x3ed8220b<SSE3,PCLMULQDQ,MON,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AESNI,XSAVE,OSXSAVE,AVX,F16C>
AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
AMD Features2=0x1d4037ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,SKINIT,WDT,Topology,PNXC,DBE,PTSC,PL2I>
Structured Extended Features=0x8
- Unsuccessful, BIOS v4.0.21, console on COM2 (comconsole_port="0x2F8" >> /boot/loader.conf.local)
System hangs at "pci0: <ACPI PCI bus> on pcib0" and needs a hard reboot.
/boot/kernel/kernel text=0x17bf9f0 data=0xb93c38+0x517b18 syms=[0x8+0x197280+0x8+0x197de9]
/boot/entropy size=0x1000
/boot/kernel/zfs.ko size 0x381f00 at 0x2f9c000
loading required module 'opensolaris'
/boot/kernel/opensolaris.ko size 0xa3a0 at 0x331e000
Booting...
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2018 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.2-RELEASE-p3 #17 e6b497fa0a3(RELENG_2_4_4): Thu Sep 20 09:04:45 EDT 2018
root@buildbot3:/crossbuild/ce-244/obj/amd64/WvDslnYb/crossbuild/ce-244/pfSense/tmp/FreeBSD-src/sys/pfSense amd64
FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)
VT(vga): resolution 640x480
CPU: AMD GX-412TC SOC (998.15-MHz K8-class CPU)
Origin="AuthenticAMD" Id=0x730f01 Family=0x16 Model=0x30 Stepping=1
Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
Features2=0x3ed8220b<SSE3,PCLMULQDQ,MON,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AESNI,XSAVE,OSXSAVE,AVX,F16C>
AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
AMD Features2=0x1d4037ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,SKINIT,WDT,Topology,PNXC,DBE,PTSC,PL2I>
Structured Extended Features=0x8
@istamov I am not FreeBSD/pfSense expert, but I do not see any reason it shouldn't work with pfSense. Try setting COM2 port whenerver possible. The console ioport should be 0x2f8. Regarding the hang on pci0 string, we noticed it in v4.0.19. It seems like legacy build is not reproducible, because in v4.0.20 the issue disappeared automagically without any intervention from our side... As a workaround, plug a USB stick, and it will boot probably. Try building the firmware Yourself and flash it, i have added a guide how to build it with COM2.
@miczyg1: You are correct, when I plug in a USB stick it does boot (as described in this thread). I tried to build the firmware by myself and the result is the same - it does boot under Ubuntu but hangs on PCI initialisation under pfSense until USB stick is present. I will try to see if I can find any reason for that (but I doubt it, given the fact that you are much more experienced in coreboot/seaBIOS than me). For the moment Ubuntu works just fine and I believe BIOS/console on COM2 will be useful for other people too, so thank you very much, Michal!
Actually I just tried with another spare APU2C4 and updated it to pfSense 2.4.5-DEVELOPMENT (FreeBSD 11.2-RELEASE-p4) - and it boots without a USB stick attached! Did at least 8 consecutive reboots and all were successful 😃 So my guess is that the pci0 problem is caused by something in pfSense 2.4.4 (FreeBSD 11.2-RELEASE-p3) which is fixed in FreeBSD 11.2-RELEASE-p4. We will have to wait for the official 2.4.5 release (probably Q1 2019), but it seems to be working.
The only suggestion I can add you already know of - if there is a possibility to add runtime configuration of the console output redirection in the future releases, it would be great! But as it is at the moment is also very useful, so thank you once again!
@istamov the problem with pfSense booting was related to EHCI0 controller. We have fixed the issue in v4.0.23: https://github.com/pcengines/coreboot/blob/coreboot-4.0.x/CHANGELOG.md#fixed
EHCI0 on apu2 is not routed to an external header on the PCB like it is done on apu3/4, thus we have permanently disabled EHCI0 for apu2 to avoid such issues in the future.
Regarding the COM2 console output, it has been implemented in runtime configuration since v4.0.22 and v4.8.0.7. The only issue is that memtest86+ works on COM1 (since it is compiled with hardcoded serial configuration). All limitations and how to build fully supported COM2 redirection is available here:
https://github.com/pcengines/apu2-documentation/blob/master/docs/serial_console.md
Visit also https://pcengines.github.io for newest releases and information about firmware. We have added binary signatures, blog and newsletter for PC Engines firmware.
Since COM1 may be used for other things, it would be nice if it was possible to redirect BIOS output to COM2 (instead of just having an option to completely disable BIOS output). Would this be possible (I wouldn't mind even if a separate BIOS version would need to be flashed that would have its output hardcoded to COM2 header).