Module Name: src Committed By: jmcneill Date: Mon Sep 13 23:30:52 UTC 2021
Modified Files: src/sys/arch/arm/apple: apple_platform.c Log Message: apple: provide a non-posted bs tag by default This tag is still used for early console attachment. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/apple/apple_platform.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/apple/apple_platform.c diff -u src/sys/arch/arm/apple/apple_platform.c:1.3 src/sys/arch/arm/apple/apple_platform.c:1.4 --- src/sys/arch/arm/apple/apple_platform.c:1.3 Thu Sep 2 20:57:57 2021 +++ src/sys/arch/arm/apple/apple_platform.c Mon Sep 13 23:30:52 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: apple_platform.c,v 1.3 2021/09/02 20:57:57 jmcneill Exp $ */ +/* $NetBSD: apple_platform.c,v 1.4 2021/09/13 23:30:52 jmcneill Exp $ */ /*- * Copyright (c) 2021 Jared McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: apple_platform.c,v 1.3 2021/09/02 20:57:57 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apple_platform.c,v 1.4 2021/09/13 23:30:52 jmcneill Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -60,6 +60,8 @@ __KERNEL_RCSID(0, "$NetBSD: apple_platfo extern struct bus_space arm_generic_bs_tag; +static struct bus_space apple_nonposted_bs_tag; + struct arm32_bus_dma_tag apple_coherent_dma_tag; static struct arm32_dma_range apple_coherent_ranges[] = { [0] = { @@ -70,11 +72,25 @@ static struct arm32_dma_range apple_cohe } }; +static int +apple_nonposted_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flag, + bus_space_handle_t *bshp) +{ + if (flag == 0) { + flag |= _ARM_BUS_SPACE_MAP_STRONGLY_ORDERED; + } + + return bus_space_map(&arm_generic_bs_tag, bpa, size, flag, bshp); +} + static void apple_platform_bootstrap(void) { extern struct arm32_bus_dma_tag arm_generic_dma_tag; + apple_nonposted_bs_tag = arm_generic_bs_tag; + apple_nonposted_bs_tag.bs_map = apple_nonposted_bs_map; + apple_coherent_dma_tag = arm_generic_dma_tag; apple_coherent_dma_tag._ranges = apple_coherent_ranges; apple_coherent_dma_tag._nranges = __arraycount(apple_coherent_ranges); @@ -85,7 +101,7 @@ apple_platform_bootstrap(void) static void apple_platform_init_attach_args(struct fdt_attach_args *faa) { - faa->faa_bst = &arm_generic_bs_tag; + faa->faa_bst = &apple_nonposted_bs_tag; faa->faa_dmat = &apple_coherent_dma_tag; }