aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/uart/uart_cpu_arm64.c
Commit message (Collapse)AuthorAgeFilesLines
* uart: Add uart_cpu_acpi_setup to setup the uartAndrew Turner2024-03-181-1/+1
| | | | | | | | | In preperation for adding debug port support add a generic function to setup the uart from ACPI tables. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44358
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* uart: uart_cpu_arm64: fix the build without FDTKyle Evans2022-09-291-21/+31
| | | | | | | | | | clang 14 doesn't properly determine that we're unconditionally returning if we have ACPI but not FDT. Push FDT setup entirely into a new function, much like we currently do with ACPI, and just return ENXIO if that doesn't succeed. Reviewed by: andrew, manu (earlier version) Differential Revision: https://reviews.freebsd.org/D36788
* Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrightsEd Maste2021-08-081-1/+0
| | | | | | | These ones were unambiguous cases where the Foundation was the only listed copyright holder (in the associated license block). Sponsored by: The FreeBSD Foundation
* uart: allow UART_DEV_DBGPORT for fdt consolesMitchell Horne2020-12-021-5/+1
| | | | | | | | | | | | | | | | | | | | Allow fdt devices to be used as debug ports for gdb(4). A debug console can be specified with the "freebsd,debug-path" property in the device tree's /chosen node, or using the environment variable hw.fdt.dbgport. The device should be specified by its name in the device tree, for example hw.fdt.dbgport="serial2". PR: 251053 Submitted by: Dmitry Salychev <dsl@mcusim.org> Submitted by: stevek (original patch, D5986) Reviewed by: andrew, mhorne Differential Revision: https://reviews.freebsd.org/D27422 Notes: svn path=/head/; revision=368284
* Use ACPI SPCR on x86Colin Percival2019-05-231-95/+6
| | | | | | | | | | | | | | | | | | 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
* ACPI SPCR: handle BaudRate=0Rebecca Cran2019-04-251-0/+7
| | | | | | | | | | | | | | | | | | | From https://github.com/tianocore/edk2-platforms/commit/7d8dc6544c93a5f5a03c83316489ba8700946e9f "The mcbin (and likely others) have a nonstandard uart clock. This means that the earlycon programming will incorrectly set the baud rate if it is specified. The way around this is to tell the kernel to continue using the preprogrammed baud rate. This is done by setting the baud to 0." Our drivers (uart_dev_ns8250) do respect zero, but SPCR would error. Let's not error. Submitted by: Greg V <greg@unrelenting.technology> Reviewed by: mw, imp, bcran Differential Revision: https://reviews.freebsd.org/D19914 Notes: svn path=/head/; revision=346657
* Add quirk for ignoring SPCR AccessWidth values on the PL011 UARTEd Maste2019-04-151-0/+5
| | | | | | | | | | | | | | | | | | The SPCR table on the Lenovo HR330A Ampere eMAG server indicates 8-bit access, but 32-bit access is required for the PL011 to work. PL011 on SBSA platforms always supports 32-bit access (and that was hardcoded here before my EC2 fix), let's use 32-bit access for PL011 and 32BIT interface types. Tested by emaste on Ampere eMAG and Cavium/Marvell ThunderX2. Submitted by: Greg V <greg@unrelenting.technology> Reviewed by: andrew, imp (earlier) Differential Revision: https://reviews.freebsd.org/D19507 Notes: svn path=/head/; revision=346228
* Initialize uart_bus_space_mem.Colin Percival2019-03-221-1/+2
| | | | | | | | | | | | | | | | This value was being used uninitialized, resulting in predictable issues on systems with memory-mapped UART registers. A case could be made that memmap_bus should be declared in a header rather than being declared in each .c file which needs to refer to it, but that's a broader style question. This commit unbreaks hw.uart.console="mm:..." on ARM64. Submitted by: Greg V Notes: svn path=/head/; revision=345406
* Obey SPCR AccessWidth parameter.Colin Percival2019-03-221-1/+1
| | | | | | | | | | | | The "access width" value was hard-coded as 2, indicating 32-bit accesses; instead, use the value specified in the SPCR table. This unbreaks the console on EC2 "A1" family instances. Submitted by: Greg V Notes: svn path=/head/; revision=345405
* add snps IP uart support / genaralize UARTMatt Macy2018-08-191-5/+5
| | | | | | | | | | | | | | | | This is an amalgam of a patch by Doug Ambrisko to generalize uart_acpi_find_device, imp moving the ACPI table to uart_dev_ns8250.c and advice by jhb to work around a bug in the EPYC 3151 BIOS (the BIOS incorrectly marks the serial ports as disabled) Reviewed by: imp MFC after: 8 weeks Differential Revision: https://reviews.freebsd.org/D16432 Notes: svn path=/head/; revision=338074
* Check all entries in the ACPI uart compat table and not just the first.Andrew Turner2018-02-261-5/+12
| | | | | | | Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=330016
* Set the io width when using an ACPI uart. Previously it would only ever beAndrew Turner2017-12-081-2/+5
| | | | | | | | | set when finding the uart from the device tree. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=326683
* Allow setting access-width for UART registers.Ruslan Bukin2017-02-271-2/+3
| | | | | | | | | | | | | | | This is required for FDT's standard "reg-io-width" property (similar to "reg-shift" property) found in many DTS files. This fixes operation on Altera Arria 10 SOC Development Kit, where standard ns8250 uart allows 4-byte access only. Reviewed by: kan, marcel Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9785 Notes: svn path=/head/; revision=314362
* Include the missing accommon.h from the ACPI uart code.Andrew Turner2016-11-211-0/+1
| | | | | | | | Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=308939
* Add support to find the arm64 serial using the ACPI tables. This uses theAndrew Turner2016-11-211-1/+83
| | | | | | | | | | Serial Port Console Redirection Table to find the device to use. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=308938
* Add an arm64 specific uart cpu driver. As arm64 may use ACPI to find theAndrew Turner2016-11-211-0/+117
uart we need to handle both it and FDT, and as such we need to have an architecture specific driver. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7796 Notes: svn path=/head/; revision=308922