diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/arm64/arm64/arm64var.h | 3 | ||||
-rw-r--r-- | sys/arch/arm64/arm64/machdep.c | 8 | ||||
-rw-r--r-- | sys/arch/arm64/dev/arm64_bus_space.c | 149 | ||||
-rw-r--r-- | sys/arch/arm64/include/bus.h | 27 |
4 files changed, 4 insertions, 183 deletions
diff --git a/sys/arch/arm64/arm64/arm64var.h b/sys/arch/arm64/arm64/arm64var.h index dc6374e5efb..5c83d10ce4b 100644 --- a/sys/arch/arm64/arm64/arm64var.h +++ b/sys/arch/arm64/arm64/arm64var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: arm64var.h,v 1.1 2016/12/17 23:38:33 patrick Exp $ */ +/* $OpenBSD: arm64var.h,v 1.2 2018/05/15 11:12:35 kettenis Exp $ */ /* * Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com> * Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se> @@ -20,7 +20,6 @@ #define __ARM64VAR_H__ extern bus_space_t arm64_bs_tag; -extern bus_space_t arm64_a4x_bs_tag; #endif /* __ARM64VAR_H__ */ diff --git a/sys/arch/arm64/arm64/machdep.c b/sys/arch/arm64/arm64/machdep.c index cebcdec787f..54f95d0e353 100644 --- a/sys/arch/arm64/arm64/machdep.c +++ b/sys/arch/arm64/arm64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.32 2018/05/06 17:16:48 kettenis Exp $ */ +/* $OpenBSD: machdep.c,v 1.33 2018/05/15 11:12:35 kettenis Exp $ */ /* * Copyright (c) 2014 Patrick Wildt <patrick@blueri.se> * @@ -795,8 +795,6 @@ initarm(struct arm64_bootparams *abp) EFI_PHYSICAL_ADDRESS system_table = 0; int (*map_func_save)(bus_space_tag_t, bus_addr_t, bus_size_t, int, bus_space_handle_t *); - int (*map_a4x_func_save)(bus_space_tag_t, bus_addr_t, bus_size_t, int, - bus_space_handle_t *); // NOTE that 1GB of ram is mapped in by default in // the bootstrap memory config, so nothing is necessary @@ -947,16 +945,12 @@ initarm(struct arm64_bootparams *abp) bus_size_t size, int flags, bus_space_handle_t *bshp); map_func_save = arm64_bs_tag._space_map; - map_a4x_func_save = arm64_a4x_bs_tag._space_map; - arm64_bs_tag._space_map = pmap_bootstrap_bs_map; - arm64_a4x_bs_tag._space_map = pmap_bootstrap_bs_map; // cninit consinit(); arm64_bs_tag._space_map = map_func_save; - arm64_a4x_bs_tag._space_map = map_a4x_func_save; /* Remap EFI runtime. */ if (mmap_start != 0 && system_table != 0) diff --git a/sys/arch/arm64/dev/arm64_bus_space.c b/sys/arch/arm64/dev/arm64_bus_space.c index cab41ff1061..c09ee5f4405 100644 --- a/sys/arch/arm64/dev/arm64_bus_space.c +++ b/sys/arch/arm64/dev/arm64_bus_space.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arm64_bus_space.c,v 1.5 2018/03/20 23:04:48 patrick Exp $ */ +/* $OpenBSD: arm64_bus_space.c,v 1.6 2018/05/15 11:12:35 kettenis Exp $ */ /* * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -60,29 +60,6 @@ bus_space_t arm64_bs_tag = { }; bus_space_t *fdt_cons_bs_tag = &arm64_bs_tag; -bus_space_t arm64_a4x_bs_tag = { - .bus_base = 0ULL, // XXX - .bus_private = NULL, - ._space_read_1 = a4x_space_read_1, - ._space_write_1 = a4x_space_write_1, - ._space_read_2 = a4x_space_read_2, - ._space_write_2 = a4x_space_write_2, - ._space_read_4 = a4x_space_read_4, - ._space_write_4 = a4x_space_write_4, - ._space_read_8 = a4x_space_read_8, - ._space_write_8 = a4x_space_write_8, - ._space_read_raw_2 = a4x_space_read_raw_2, - ._space_write_raw_2 = a4x_space_write_raw_2, - ._space_read_raw_4 = a4x_space_read_raw_4, - ._space_write_raw_4 = a4x_space_write_raw_4, - ._space_read_raw_8 = a4x_space_read_raw_8, - ._space_write_raw_8 = a4x_space_write_raw_8, - ._space_map = generic_space_map, - ._space_unmap = generic_space_unmap, - ._space_subregion = generic_space_region, - ._space_vaddr = generic_space_vaddr -}; - uint8_t generic_space_read_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o) { @@ -259,127 +236,3 @@ generic_space_vaddr(bus_space_tag_t t, bus_space_handle_t h) { return (void *)h; } - -uint8_t -a4x_space_read_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o) -{ - return *(volatile uint32_t *)(h + (o*4)); -} - -uint16_t -a4x_space_read_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o) -{ - return *(volatile uint32_t *)(h + (o*4)); -} - -uint32_t -a4x_space_read_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o) -{ - return *(volatile uint32_t *)(h + (o*4)); -} - -uint64_t -a4x_space_read_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o) -{ - return *(volatile uint64_t *)(h + (o*4)); -} - -void -a4x_space_write_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - uint8_t v) -{ - *(volatile uint32_t *)(h + (o*4)) = v; -} - -void -a4x_space_write_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - uint16_t v) -{ - *(volatile uint32_t *)(h + (o*4)) = v; -} - -void -a4x_space_write_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - uint32_t v) -{ - *(volatile uint32_t *)(h + (o*4)) = v; -} - -void -a4x_space_write_8(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, - uint64_t v) -{ - *(volatile uint64_t *)(h + (o*4)) = v; -} - -void -a4x_space_read_raw_2(bus_space_tag_t t, bus_space_handle_t h, bus_addr_t o, - uint8_t *buf, bus_size_t len) -{ - volatile uint16_t *addr = (volatile uint16_t *)(h + (o*4)); - len >>= 1; - while (len-- != 0) { - *(uint16_t *)buf = *addr; - buf += 2; - } -} - -void -a4x_space_write_raw_2(bus_space_tag_t t, bus_space_handle_t h, bus_addr_t o, - const uint8_t *buf, bus_size_t len) -{ - volatile uint16_t *addr = (volatile uint16_t *)(h + (o*4)); - len >>= 1; - while (len-- != 0) { - *addr = *(uint16_t *)buf; - buf += 2; - } -} - -void -a4x_space_read_raw_4(bus_space_tag_t t, bus_space_handle_t h, bus_addr_t o, - uint8_t *buf, bus_size_t len) -{ - volatile uint32_t *addr = (volatile uint32_t *)(h + (o*4)); - len >>= 2; - while (len-- != 0) { - *(uint32_t *)buf = *addr; - buf += 4; - } -} - -void -a4x_space_write_raw_4(bus_space_tag_t t, bus_space_handle_t h, bus_addr_t o, - const uint8_t *buf, bus_size_t len) -{ - volatile uint32_t *addr = (volatile uint32_t *)(h + (o*4)); - len >>= 2; - while (len-- != 0) { - *addr = *(uint32_t *)buf; - buf += 4; - } -} - -void -a4x_space_read_raw_8(bus_space_tag_t t, bus_space_handle_t h, bus_addr_t o, - uint8_t *buf, bus_size_t len) -{ - volatile uint64_t *addr = (volatile uint64_t *)(h + (o*4)); - len >>= 3; - while (len-- != 0) { - *(uint64_t *)buf = *addr; - buf += 8; - } -} - -void -a4x_space_write_raw_8(bus_space_tag_t t, bus_space_handle_t h, bus_addr_t o, - const uint8_t *buf, bus_size_t len) -{ - volatile uint64_t *addr = (volatile uint64_t *)(h + (o*4)); - len >>= 3; - while (len-- != 0) { - *addr = *(uint64_t *)buf; - buf += 8; - } -} diff --git a/sys/arch/arm64/include/bus.h b/sys/arch/arm64/include/bus.h index 4422f424efb..d479faaaa76 100644 --- a/sys/arch/arm64/include/bus.h +++ b/sys/arch/arm64/include/bus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bus.h,v 1.3 2017/05/08 00:27:45 dlg Exp $ */ +/* $OpenBSD: bus.h,v 1.4 2018/05/15 11:12:35 kettenis Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB Sweden. All rights reserved. * @@ -504,29 +504,4 @@ void generic_space_read_raw_8(bus_space_tag_t, bus_space_handle_t, void generic_space_write_raw_8(bus_space_tag_t, bus_space_handle_t, bus_addr_t, const uint8_t *, bus_size_t); -uint8_t a4x_space_read_1(bus_space_tag_t, bus_space_handle_t, bus_size_t); -uint16_t a4x_space_read_2(bus_space_tag_t, bus_space_handle_t, bus_size_t); -uint32_t a4x_space_read_4(bus_space_tag_t, bus_space_handle_t, bus_size_t); -uint64_t a4x_space_read_8(bus_space_tag_t, bus_space_handle_t, bus_size_t); -void a4x_space_read_raw_2(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, uint8_t *, bus_size_t); -void a4x_space_write_1(bus_space_tag_t, bus_space_handle_t, bus_size_t, - uint8_t); -void a4x_space_write_2(bus_space_tag_t, bus_space_handle_t, bus_size_t, - uint16_t); -void a4x_space_write_4(bus_space_tag_t, bus_space_handle_t, bus_size_t, - uint32_t); -void a4x_space_write_8(bus_space_tag_t, bus_space_handle_t, bus_size_t, - uint64_t); -void a4x_space_write_raw_2(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const uint8_t *, bus_size_t); -void a4x_space_read_raw_4(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, uint8_t *, bus_size_t); -void a4x_space_write_raw_4(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const uint8_t *, bus_size_t); -void a4x_space_read_raw_8(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, uint8_t *, bus_size_t); -void a4x_space_write_raw_8(bus_space_tag_t, bus_space_handle_t, - bus_addr_t, const uint8_t *, bus_size_t); - #endif /* _MACHINE_BUS_H_ */ |