History log of /freebsd-current/sys/dev/uart/uart_cpu_arm64.c
Revision Date Author Comments
# a931b85a 14-Mar-2024 Andrew Turner <andrew@FreeBSD.org>

uart: Add uart_cpu_acpi_setup to setup the uart

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


# fdafd315 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Automated cleanup of cdefs and other formatting

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


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4a4ad02d 29-Sep-2022 Kyle Evans <kevans@FreeBSD.org>

uart: uart_cpu_arm64: fix the build without FDT

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


# 9feff969 08-Aug-2021 Ed Maste <emaste@FreeBSD.org>

Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights

These ones were unambiguous cases where the Foundation was the only
listed copyright holder (in the associated license block).

Sponsored by: The FreeBSD Foundation


# 1c5d066a 02-Dec-2020 Mitchell Horne <mhorne@FreeBSD.org>

uart: allow UART_DEV_DBGPORT for fdt consoles

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


# 7f166c93 23-May-2019 Colin Percival <cperciva@FreeBSD.org>

Use ACPI SPCR on x86

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


# 56a70105 24-Apr-2019 Rebecca Cran <bcran@FreeBSD.org>

ACPI SPCR: handle BaudRate=0

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


# f89f4898 15-Apr-2019 Ed Maste <emaste@FreeBSD.org>

Add quirk for ignoring SPCR AccessWidth values on the PL011 UART

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


# 0624eddc 22-Mar-2019 Colin Percival <cperciva@FreeBSD.org>

Initialize uart_bus_space_mem.

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


# b8bfd8fc 22-Mar-2019 Colin Percival <cperciva@FreeBSD.org>

Obey SPCR AccessWidth parameter.

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


# 381388b9 19-Aug-2018 Matt Macy <mmacy@FreeBSD.org>

add snps IP uart support / genaralize UART

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


# 104518ad 26-Feb-2018 Andrew Turner <andrew@FreeBSD.org>

Check all entries in the ACPI uart compat table and not just the first.

Sponsored by: DARPA, AFRL


# fb006e46 08-Dec-2017 Andrew Turner <andrew@FreeBSD.org>

Set the io width when using an ACPI uart. Previously it would only ever be
set when finding the uart from the device tree.

Sponsored by: DARPA, AFRL


# c214a270 27-Feb-2017 Ruslan Bukin <br@FreeBSD.org>

Allow setting access-width for UART registers.

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


# ef022bb1 21-Nov-2016 Andrew Turner <andrew@FreeBSD.org>

Include the missing accommon.h from the ACPI uart code.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation


# eba1a249 21-Nov-2016 Andrew Turner <andrew@FreeBSD.org>

Add support to find the arm64 serial using the ACPI tables. This uses the
Serial Port Console Redirection Table to find the device to use.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation


# 0812ab31 21-Nov-2016 Andrew Turner <andrew@FreeBSD.org>

Add an arm64 specific uart cpu driver. As arm64 may use ACPI to find the
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