Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58306 )
Change subject: [WIP] soc/amd/common/block/uart: implement read_resource ......................................................................
[WIP] soc/amd/common/block/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.
TODO: find out if we need the IORESOURCE_RESERVE flag and run more tests
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: I4ffddee3f5f4281aca98ddfcefa639dfb7a38dae --- M src/soc/amd/picasso/uart.c 1 file changed, 11 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/58306/1
diff --git a/src/soc/amd/picasso/uart.c b/src/soc/amd/picasso/uart.c index b8532aa..6a65048 100644 --- a/src/soc/amd/picasso/uart.c +++ b/src/soc/amd/picasso/uart.c @@ -103,8 +103,18 @@ } }
+static void uart_read_resources(struct device *dev) +{ + struct resource *res; + + res = new_resource(dev, 0); + res->base = dev->path.mmio.addr; + res->size = 4 * KiB; + res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED; +} + 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,