From ad6f87d61202984e7604a35b6ce5babee614e676 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Tue, 12 Oct 2021 23:35:48 +0200 Subject: [PATCH] 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 Change-Id: I4ffddee3f5f4281aca98ddfcefa639dfb7a38dae Reviewed-on: https://review.coreboot.org/c/coreboot/+/58306 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel --- src/soc/amd/cezanne/uart.c | 7 ++++++- src/soc/amd/picasso/uart.c | 7 ++++++- 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,