summaryrefslogtreecommitdiff
path: root/sys/dev/uart/uart_cpu_acpi.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix AccessWidth and BitWidth parsing in SPCR tableMarcin Wojtas2020-06-241-4/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ACPI Specification defines a Generic Address Structure (GAS), which is used to describe UART controller register layout in the SPCR table. The driver responsible for parsing it (uart_cpu_acpi) wrongly associates the Access Size field to the uart_bas's regshft and the register BitWidth to the regiowidth - according to the definitions it should be opposite. This problem remained hidden most likely because the majority of platforms use 32-bit registers (BitWidth) which are accessed with the according size (Dword). However on Marvell Armada 8k / Cn913x platforms, the 32-bit registers should be accessed with Byte granulity, which unveiled the issue. This patch fixes above by proper values assignment and slightly improved parsing. Note that handling of the AccessWidth set to EFI_ACPI_6_0_UNDEFINED is needed to work around a buggy SPCR table on EC2 x86 "bare metal" instances. Reviewed by: manu, imp, cperciva, greg_unrelenting.technology Obtained from: Semihalf MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25373 Notes: svn path=/head/; revision=362574
* uart_cpu_acpi: Fix GCC build break from r348195Conrad Meyer2019-05-231-3/+0
| | | | | | | | | | extern declarations are redundant with those in uart_cpu.h, which this file includes. X-MFC-with: r348195 Notes: svn path=/head/; revision=348198
* Use ACPI SPCR on x86Colin Percival2019-05-231-0/+167
This takes the SPCR code currently in uart_cpu_arm64.c, moves it into a new uart_cpu_acpi.c (with some associated refactoring), and uses it from both arm64 and x86. An SPCR serial port address AccessWidth field value of 0 ("reserved") is now treated as 1 ("byte access") in order to work around a buggy SPCR table on Amazon EC2 i3.metal instances. Reviewed by: manu, Greg V MFC after: 3 days Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D20357 Notes: svn path=/head/; revision=348195