summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Held <felix.held@amd.corp-partner.google.com>2021-10-12 23:35:48 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-10-15 14:46:58 +0000
commitad6f87d61202984e7604a35b6ce5babee614e676 (patch)
treea6ef329a6993c254c902bd8d76a46104365287a9 /src
parentcb70d836ed048b81ad8047e97c9758680cc2da2d (diff)
soc/amd/cezanne,picasso/uart: implement read_resource
Implement the read_resources function for the UART devices so that the resource allocator knows about their fixed MMIO resources when enabled. TEST=UART still works on Mandolin. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I4ffddee3f5f4281aca98ddfcefa639dfb7a38dae Reviewed-on: https://review.coreboot.org/c/coreboot/+/58306 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/soc/amd/cezanne/uart.c7
-rw-r--r--src/soc/amd/picasso/uart.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/src/soc/amd/cezanne/uart.c b/src/soc/amd/cezanne/uart.c
index e5f2e4edbb..cf535d7aec 100644
--- a/src/soc/amd/cezanne/uart.c
+++ b/src/soc/amd/cezanne/uart.c
@@ -85,8 +85,13 @@ static void uart_enable(struct device *dev)
}
}
+static void uart_read_resources(struct device *dev)
+{
+ mmio_resource(dev, 0, dev->path.mmio.addr / KiB, 4);
+}
+
struct device_operations cezanne_uart_mmio_ops = {
- .read_resources = noop_read_resources,
+ .read_resources = uart_read_resources,
.set_resources = noop_set_resources,
.scan_bus = scan_static_bus,
.enable = uart_enable,
diff --git a/src/soc/amd/picasso/uart.c b/src/soc/amd/picasso/uart.c
index b8532aaddf..1ffb2fdf70 100644
--- a/src/soc/amd/picasso/uart.c
+++ b/src/soc/amd/picasso/uart.c
@@ -103,8 +103,13 @@ static void uart_enable(struct device *dev)
}
}
+static void uart_read_resources(struct device *dev)
+{
+ mmio_resource(dev, 0, dev->path.mmio.addr / KiB, 4);
+}
+
struct device_operations picasso_uart_mmio_ops = {
- .read_resources = noop_read_resources,
+ .read_resources = uart_read_resources,
.set_resources = noop_set_resources,
.scan_bus = scan_static_bus,
.acpi_name = uart_acpi_name,