From 3110e7eed8d7fc55bb19e64ccc5a081e0ae0ffda Mon Sep 17 00:00:00 2001 From: Ian Lepore Date: Mon, 4 Nov 2013 22:45:26 +0000 Subject: [PATCH] Move remaining code and data related to static device mapping into the new devmap.[ch] files. Emphasize the MD nature of these things by using the prefix arm_devmap_ on the function and type names (already a few of these things found their way into MI code, hopefully it will be harder to do by accident in the future). --- sys/arm/allwinner/a10_machdep.c | 5 +-- sys/arm/arm/devmap.c | 38 ++++++++++++++++++---- sys/arm/arm/machdep.c | 3 +- sys/arm/at91/at91.c | 5 +-- sys/arm/at91/at91_machdep.c | 5 +-- sys/arm/broadcom/bcm2835/bcm2835_machdep.c | 5 +-- sys/arm/econa/econa_machdep.c | 5 +-- sys/arm/freescale/imx/imx_machdep.c | 8 ++--- sys/arm/include/devmap.h | 27 +++++++++++++++ sys/arm/include/fdt.h | 6 ++-- sys/arm/include/machdep.h | 3 -- sys/arm/include/pmap.h | 14 -------- sys/arm/lpc/lpc_machdep.c | 5 +-- sys/arm/mv/mv_localbus.c | 5 ++- sys/arm/mv/mv_machdep.c | 11 ++++--- sys/arm/mv/mvvar.h | 1 - sys/arm/rockchip/rk30xx_machdep.c | 7 ++-- sys/arm/s3c2xx0/s3c24x0_machdep.c | 5 +-- sys/arm/sa11x0/assabet_machdep.c | 5 +-- sys/arm/samsung/exynos/exynos5_machdep.c | 5 +-- sys/arm/tegra/tegra2_machdep.c | 5 +-- sys/arm/ti/ti_machdep.c | 5 +-- sys/arm/versatile/versatile_machdep.c | 5 +-- sys/arm/xilinx/zy7_machdep.c | 5 +-- sys/arm/xscale/i80321/ep80219_machdep.c | 5 +-- sys/arm/xscale/i80321/iq31244_machdep.c | 5 +-- sys/arm/xscale/i8134x/crb_machdep.c | 5 +-- sys/arm/xscale/ixp425/avila_machdep.c | 9 ++--- sys/arm/xscale/pxa/pxa_machdep.c | 5 +-- sys/dev/fdt/fdt_pci.c | 2 +- 30 files changed, 137 insertions(+), 82 deletions(-) diff --git a/sys/arm/allwinner/a10_machdep.c b/sys/arm/allwinner/a10_machdep.c index 90badf25dd5..e9f93e82932 100644 --- a/sys/arm/allwinner/a10_machdep.c +++ b/sys/arm/allwinner/a10_machdep.c @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -71,7 +72,7 @@ initarm_late_init(void) } #define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } }; @@ -91,7 +92,7 @@ platform_devmap_init(void) i++; - pmap_devmap_bootstrap_table = &fdt_devmap[0]; + arm_devmap_register_table(&fdt_devmap[0]); return (0); } diff --git a/sys/arm/arm/devmap.c b/sys/arm/arm/devmap.c index 0ade6c72cb9..a8819bd8242 100644 --- a/sys/arm/arm/devmap.c +++ b/sys/arm/arm/devmap.c @@ -38,18 +38,42 @@ __FBSDID("$FreeBSD$"); #include #include -static const struct pmap_devmap *devmap_table; +static const struct arm_devmap_entry *devmap_table; /* - * Map all of the static regions in the devmap table, and remember - * the devmap table so other parts of the kernel can do lookups later. + * Register the given table as the one to use in arm_devmap_bootstrap(). */ void -pmap_devmap_bootstrap(vm_offset_t l1pt, const struct pmap_devmap *table) +arm_devmap_register_table(const struct arm_devmap_entry *table) { - const struct pmap_devmap *pd; devmap_table = table; +} + +/* + * Map all of the static regions in the devmap table, and remember the devmap + * table so the mapdev, ptov, and vtop functions can do lookups later. + * + * If a non-NULL table pointer is given it is used unconditionally, otherwise + * the previously-registered table is used. This smooths transition from legacy + * code that fills in a local table then calls this function passing that table, + * and newer code that uses arm_devmap_register_table() in platform-specific + * code, then lets the common initarm() call this function with a NULL pointer. + */ +void +arm_devmap_bootstrap(vm_offset_t l1pt, const struct arm_devmap_entry *table) +{ + const struct arm_devmap_entry *pd; + + /* + * If given a table pointer, use it, else ensure a table was previously + * registered. This happens early in boot, and there's a good chance + * the panic message won't be seen, but there's not much we can do. + */ + if (table != NULL) + devmap_table = table; + else if (devmap_table == NULL) + panic("arm_devmap_bootstrap: No devmap table registered."); for (pd = devmap_table; pd->pd_size != 0; ++pd) { pmap_map_chunk(l1pt, pd->pd_va, pd->pd_pa, pd->pd_size, @@ -64,7 +88,7 @@ pmap_devmap_bootstrap(vm_offset_t l1pt, const struct pmap_devmap *table) void * arm_devmap_ptov(vm_paddr_t pa, vm_size_t size) { - const struct pmap_devmap *pd; + const struct arm_devmap_entry *pd; if (devmap_table == NULL) return (NULL); @@ -84,7 +108,7 @@ arm_devmap_ptov(vm_paddr_t pa, vm_size_t size) vm_paddr_t arm_devmap_vtop(void * vpva, vm_size_t size) { - const struct pmap_devmap *pd; + const struct arm_devmap_entry *pd; vm_offset_t va; if (devmap_table == NULL) diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c index 68a9fdb4656..ec6fa9c0276 100644 --- a/sys/arm/arm/machdep.c +++ b/sys/arm/arm/machdep.c @@ -159,7 +159,6 @@ struct pv_addr undstack; struct pv_addr abtstack; static struct pv_addr kernelstack; -const struct pmap_devmap *pmap_devmap_bootstrap_table; #endif #if defined(LINUX_BOOT_ABI) @@ -1422,7 +1421,7 @@ initarm(struct arm_boot_params *abp) /* Map pmap_devmap[] entries */ err_devmap = platform_devmap_init(); - pmap_devmap_bootstrap(l1pagetable, pmap_devmap_bootstrap_table); + arm_devmap_bootstrap(l1pagetable, NULL); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | DOMAIN_CLIENT); pmap_pa = kernel_l1pt.pv_pa; diff --git a/sys/arm/at91/at91.c b/sys/arm/at91/at91.c index d574fb1cd8c..583d1ab4a5b 100644 --- a/sys/arm/at91/at91.c +++ b/sys/arm/at91/at91.c @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #define _ARM32_BUS_DMA_PRIVATE #include +#include #include #include @@ -52,7 +53,7 @@ static struct at91_softc *at91_softc; static void at91_eoi(void *); -extern const struct pmap_devmap at91_devmap[]; +extern const struct arm_devmap_entry at91_devmap[]; uint32_t at91_master_clock; @@ -257,7 +258,7 @@ static int at91_attach(device_t dev) { struct at91_softc *sc = device_get_softc(dev); - const struct pmap_devmap *pdevmap; + const struct arm_devmap_entry *pdevmap; int i; arm_post_filter = at91_eoi; diff --git a/sys/arm/at91/at91_machdep.c b/sys/arm/at91/at91_machdep.c index f4a931653f6..f7c21f9c6a5 100644 --- a/sys/arm/at91/at91_machdep.c +++ b/sys/arm/at91/at91_machdep.c @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -128,7 +129,7 @@ struct pv_addr abtstack; struct pv_addr kernelstack; /* Static device mappings. */ -const struct pmap_devmap at91_devmap[] = { +const struct arm_devmap_entry at91_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. @@ -566,7 +567,7 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); } - pmap_devmap_bootstrap(l1pagetable, at91_devmap); + arm_devmap_bootstrap(l1pagetable, at91_devmap); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | DOMAIN_CLIENT); setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); diff --git a/sys/arm/broadcom/bcm2835/bcm2835_machdep.c b/sys/arm/broadcom/bcm2835/bcm2835_machdep.c index 2a549a2b639..dcf8178919a 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_machdep.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_machdep.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -93,7 +94,7 @@ initarm_late_init(void) } #define FDT_DEVMAP_MAX (2) // FIXME -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } }; @@ -113,7 +114,7 @@ platform_devmap_init(void) fdt_devmap[i].pd_cache = PTE_DEVICE; i++; - pmap_devmap_bootstrap_table = &fdt_devmap[0]; + arm_devmap_register_table(&fdt_devmap[0]); return (0); } diff --git a/sys/arm/econa/econa_machdep.c b/sys/arm/econa/econa_machdep.c index d64e826d1e7..0323e7b51ff 100644 --- a/sys/arm/econa/econa_machdep.c +++ b/sys/arm/econa/econa_machdep.c @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -108,7 +109,7 @@ struct pv_addr abtstack; struct pv_addr kernelstack; /* Static device mappings. */ -static const struct pmap_devmap econa_devmap[] = { +static const struct arm_devmap_entry econa_devmap[] = { { /* * This maps DDR SDRAM @@ -275,7 +276,7 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); } - pmap_devmap_bootstrap(l1pagetable, econa_devmap); + arm_devmap_bootstrap(l1pagetable, econa_devmap); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT); setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); diff --git a/sys/arm/freescale/imx/imx_machdep.c b/sys/arm/freescale/imx/imx_machdep.c index 8e47dbc3ffc..de0eb68aeca 100644 --- a/sys/arm/freescale/imx/imx_machdep.c +++ b/sys/arm/freescale/imx/imx_machdep.c @@ -47,14 +47,14 @@ __FBSDID("$FreeBSD$"); #define IMX_MAX_DEVMAP_ENTRIES 8 -static struct pmap_devmap devmap_entries[IMX_MAX_DEVMAP_ENTRIES]; +static struct arm_devmap_entry devmap_entries[IMX_MAX_DEVMAP_ENTRIES]; static u_int devmap_idx; static vm_offset_t devmap_vaddr = ARM_VECTORS_HIGH; void imx_devmap_addentry(vm_paddr_t pa, vm_size_t sz) { - struct pmap_devmap *m; + struct arm_devmap_entry *m; /* * The last table entry is the all-zeroes end-of-table marker. If we're @@ -103,7 +103,7 @@ initarm_lastaddr(void) */ imx_devmap_init(); - pmap_devmap_bootstrap_table = devmap_entries; + arm_devmap_register_table(devmap_entries); return (devmap_vaddr); } @@ -128,7 +128,7 @@ initarm_gpio_init(void) void initarm_late_init(void) { - struct pmap_devmap *m; + struct arm_devmap_entry *m; /* * We did the static devmap setup earlier, during initarm_lastaddr(), diff --git a/sys/arm/include/devmap.h b/sys/arm/include/devmap.h index d720e7d8dc3..ee16b670d71 100644 --- a/sys/arm/include/devmap.h +++ b/sys/arm/include/devmap.h @@ -29,6 +29,33 @@ #ifndef _MACHINE_DEVMAP_H_ #define _MACHINE_DEVMAP_H_ +/* + * This structure is used by MD code to describe static mappings of devices + * which are established as part of bringing up the MMU early in the boot. + */ +struct arm_devmap_entry { + vm_offset_t pd_va; /* virtual address */ + vm_paddr_t pd_pa; /* physical address */ + vm_size_t pd_size; /* size of region */ + vm_prot_t pd_prot; /* protection code */ + int pd_cache; /* cache attributes */ +}; + +/* + * Register a platform-local table to be bootstrapped by the generic + * initarm() in arm/machdep.c. This is used by newer code that allocates and + * fills in its own local table but does not have its own initarm() routine. + */ +void arm_devmap_register_table(const struct arm_devmap_entry * _table); + +/* + * Directly process a table; called from initarm() of older platforms that don't + * use the generic initarm() in arm/machdep.c. If the table pointer is NULL, + * this will use the table installed previously by arm_devmap_register_table(). + */ +void arm_devmap_bootstrap(vm_offset_t _l1pt, + const struct arm_devmap_entry *_table); + /* * Routines to translate between virtual and physical addresses within a region * that is static-mapped by the devmap code. If the given address range isn't diff --git a/sys/arm/include/fdt.h b/sys/arm/include/fdt.h index f84402b7484..0be9927d9be 100644 --- a/sys/arm/include/fdt.h +++ b/sys/arm/include/fdt.h @@ -56,10 +56,10 @@ struct mem_region { vm_size_t mr_size; }; -struct pmap_devmap; +struct arm_devmap_entry; -int fdt_localbus_devmap(phandle_t, struct pmap_devmap *, int, int *); -int fdt_pci_devmap(phandle_t, struct pmap_devmap *devmap, vm_offset_t, +int fdt_localbus_devmap(phandle_t, struct arm_devmap_entry *, int, int *); +int fdt_pci_devmap(phandle_t, struct arm_devmap_entry *devmap, vm_offset_t, vm_offset_t); #endif /* _MACHINE_FDT_H_ */ diff --git a/sys/arm/include/machdep.h b/sys/arm/include/machdep.h index c48b0a3a557..08e9e219a26 100644 --- a/sys/arm/include/machdep.h +++ b/sys/arm/include/machdep.h @@ -43,9 +43,6 @@ int platform_devmap_init(void); void board_set_serial(uint64_t); void board_set_revision(uint32_t); -/* Needs to be initialised by platform_devmap_init */ -extern const struct pmap_devmap *pmap_devmap_bootstrap_table; - /* Setup standard arrays */ void arm_dump_avail_init( vm_offset_t memsize, size_t max); diff --git a/sys/arm/include/pmap.h b/sys/arm/include/pmap.h index d393d1bb465..7448929a512 100644 --- a/sys/arm/include/pmap.h +++ b/sys/arm/include/pmap.h @@ -696,20 +696,6 @@ void pmap_use_minicache(vm_offset_t, vm_size_t); void vector_page_setprot(int); -/* - * This structure is used by machine-dependent code to describe - * static mappings of devices, created at bootstrap time. - */ -struct pmap_devmap { - vm_offset_t pd_va; /* virtual address */ - vm_paddr_t pd_pa; /* physical address */ - vm_size_t pd_size; /* size of region */ - vm_prot_t pd_prot; /* protection code */ - int pd_cache; /* cache attributes */ -}; - -void pmap_devmap_bootstrap(vm_offset_t, const struct pmap_devmap *); - #define SECTION_CACHE 0x1 #define SECTION_PT 0x2 void pmap_kenter_section(vm_offset_t, vm_paddr_t, int flags); diff --git a/sys/arm/lpc/lpc_machdep.c b/sys/arm/lpc/lpc_machdep.c index cb3ab844362..576eda4c39f 100644 --- a/sys/arm/lpc/lpc_machdep.c +++ b/sys/arm/lpc/lpc_machdep.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -85,7 +86,7 @@ initarm_late_init(void) } #define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } }; @@ -105,7 +106,7 @@ platform_devmap_init(void) fdt_devmap[0].pd_prot = VM_PROT_READ | VM_PROT_WRITE; fdt_devmap[0].pd_cache = PTE_NOCACHE; - pmap_devmap_bootstrap_table = &fdt_devmap[0]; + arm_devmap_register_table(&fdt_devmap[0]); return (0); } diff --git a/sys/arm/mv/mv_localbus.c b/sys/arm/mv/mv_localbus.c index 7ed9e24ba93..5258b0adc0a 100644 --- a/sys/arm/mv/mv_localbus.c +++ b/sys/arm/mv/mv_localbus.c @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include #include #include @@ -380,7 +383,7 @@ localbus_get_devinfo(device_t bus, device_t child) } int -fdt_localbus_devmap(phandle_t dt_node, struct pmap_devmap *fdt_devmap, +fdt_localbus_devmap(phandle_t dt_node, struct arm_devmap_entry *fdt_devmap, int banks_max_num, int *banks_added) { pcell_t ranges[MV_LOCALBUS_MAX_BANKS * MV_LOCALBUS_MAX_BANK_CELLS]; diff --git a/sys/arm/mv/mv_machdep.c b/sys/arm/mv/mv_machdep.c index 6dca733b50c..ace8ddecb35 100644 --- a/sys/arm/mv/mv_machdep.c +++ b/sys/arm/mv/mv_machdep.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include /* XXX */ @@ -245,12 +246,12 @@ initarm_late_init(void) } #define FDT_DEVMAP_MAX (MV_WIN_CPU_MAX + 2) -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } }; static int -platform_sram_devmap(struct pmap_devmap *map) +platform_sram_devmap(struct arm_devmap_entry *map) { #if !defined(SOC_MV_ARMADAXP) phandle_t child, root; @@ -295,10 +296,10 @@ out: * real implementation of this function in dev/fdt/fdt_pci.c overrides the weak * alias defined here. */ -int mv_default_fdt_pci_devmap(phandle_t node, struct pmap_devmap *devmap, +int mv_default_fdt_pci_devmap(phandle_t node, struct arm_devmap_entry *devmap, vm_offset_t io_va, vm_offset_t mem_va); int -mv_default_fdt_pci_devmap(phandle_t node, struct pmap_devmap *devmap, +mv_default_fdt_pci_devmap(phandle_t node, struct arm_devmap_entry *devmap, vm_offset_t io_va, vm_offset_t mem_va) { @@ -322,7 +323,7 @@ platform_devmap_init(void) int i, num_mapped; i = 0; - pmap_devmap_bootstrap_table = &fdt_devmap[0]; + arm_devmap_register_table(&fdt_devmap[0]); #ifdef SOC_MV_ARMADAXP vm_paddr_t cur_immr_pa; diff --git a/sys/arm/mv/mvvar.h b/sys/arm/mv/mvvar.h index 754541f37ff..54abf4634b8 100644 --- a/sys/arm/mv/mvvar.h +++ b/sys/arm/mv/mvvar.h @@ -66,7 +66,6 @@ struct decode_win { vm_paddr_t remap; }; -extern const struct pmap_devmap pmap_devmap[]; extern const struct gpio_config mv_gpio_config[]; extern const struct decode_win *cpu_wins; extern const struct decode_win *idma_wins; diff --git a/sys/arm/rockchip/rk30xx_machdep.c b/sys/arm/rockchip/rk30xx_machdep.c index 6496d5e73e5..e4eb16229cf 100644 --- a/sys/arm/rockchip/rk30xx_machdep.c +++ b/sys/arm/rockchip/rk30xx_machdep.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -73,7 +74,7 @@ initarm_late_init(void) } #define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } }; @@ -92,8 +93,8 @@ platform_devmap_init(void) fdt_devmap[i].pd_cache = PTE_DEVICE; i++; - pmap_devmap_bootstrap_table = &fdt_devmap[0]; - + arm_devmap_register_table(&fdt_devmap[0]); + return (0); } diff --git a/sys/arm/s3c2xx0/s3c24x0_machdep.c b/sys/arm/s3c2xx0/s3c24x0_machdep.c index 1811b520189..3fc0f8ec16b 100644 --- a/sys/arm/s3c2xx0/s3c24x0_machdep.c +++ b/sys/arm/s3c2xx0/s3c24x0_machdep.c @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -126,7 +127,7 @@ struct pv_addr kernelstack; #define _S(s) (((s) + L1_S_SIZE - 1) & ~(L1_S_SIZE-1)) /* Static device mappings. */ -static const struct pmap_devmap s3c24x0_devmap[] = { +static const struct arm_devmap_entry s3c24x0_devmap[] = { /* * Map the devices we need early on. */ @@ -324,7 +325,7 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); } - pmap_devmap_bootstrap(l1pagetable, s3c24x0_devmap); + arm_devmap_bootstrap(l1pagetable, s3c24x0_devmap); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT); setttb(kernel_l1pt.pv_pa); diff --git a/sys/arm/sa11x0/assabet_machdep.c b/sys/arm/sa11x0/assabet_machdep.c index 0808798106a..79014f2c037 100644 --- a/sys/arm/sa11x0/assabet_machdep.c +++ b/sys/arm/sa11x0/assabet_machdep.c @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -134,7 +135,7 @@ struct pv_addr abtstack; struct pv_addr kernelstack; /* Static device mappings. */ -static const struct pmap_devmap assabet_devmap[] = { +static const struct arm_devmap_entry assabet_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. @@ -324,7 +325,7 @@ initarm(struct arm_boot_params *abp) pmap_map_entry(l1pagetable, vector_page, systempage.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); /* Map the statically mapped devices. */ - pmap_devmap_bootstrap(l1pagetable, assabet_devmap); + arm_devmap_bootstrap(l1pagetable, assabet_devmap); pmap_map_chunk(l1pagetable, sa1_cache_clean_addr, 0xf0000000, CPU_SA110_CACHE_CLEAN_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); diff --git a/sys/arm/samsung/exynos/exynos5_machdep.c b/sys/arm/samsung/exynos/exynos5_machdep.c index 007bdb55321..1c5a879b984 100644 --- a/sys/arm/samsung/exynos/exynos5_machdep.c +++ b/sys/arm/samsung/exynos/exynos5_machdep.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -63,7 +64,7 @@ initarm_late_init(void) } #define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) /* FIXME */ -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } }; @@ -83,7 +84,7 @@ platform_devmap_init(void) fdt_devmap[i].pd_cache = PTE_NOCACHE; i++; - pmap_devmap_bootstrap_table = &fdt_devmap[0]; + arm_devmap_register_table(&fdt_devmap[0]); return (0); } diff --git a/sys/arm/tegra/tegra2_machdep.c b/sys/arm/tegra/tegra2_machdep.c index 66fe0a96cec..92ca04a1119 100644 --- a/sys/arm/tegra/tegra2_machdep.c +++ b/sys/arm/tegra/tegra2_machdep.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -123,7 +124,7 @@ initarm_late_init(void) } #define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) /* FIXME */ -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } }; @@ -141,7 +142,7 @@ platform_devmap_init(void) fdt_devmap[i].pd_cache = PTE_NOCACHE; i++; - pmap_devmap_bootstrap_table = &fdt_devmap[0]; + arm_devmap_register_table(&fdt_devmap[0]); return (0); } diff --git a/sys/arm/ti/ti_machdep.c b/sys/arm/ti/ti_machdep.c index 66bd4a09588..8a3184af8f9 100644 --- a/sys/arm/ti/ti_machdep.c +++ b/sys/arm/ti/ti_machdep.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -77,7 +78,7 @@ initarm_late_init(void) } #define FDT_DEVMAP_MAX (2) // FIXME -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } }; @@ -107,7 +108,7 @@ platform_devmap_init(void) #error "Unknown SoC" #endif - pmap_devmap_bootstrap_table = &fdt_devmap[0]; + arm_devmap_register_table(&fdt_devmap[0]); return (0); } diff --git a/sys/arm/versatile/versatile_machdep.c b/sys/arm/versatile/versatile_machdep.c index 0a8c0d852e3..08ce039fc0d 100644 --- a/sys/arm/versatile/versatile_machdep.c +++ b/sys/arm/versatile/versatile_machdep.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -74,7 +75,7 @@ initarm_late_init(void) } #define FDT_DEVMAP_MAX (2) /* FIXME */ -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, }, { 0, 0, 0, 0, 0, } }; @@ -93,7 +94,7 @@ platform_devmap_init(void) fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; fdt_devmap[i].pd_cache = PTE_DEVICE; - pmap_devmap_bootstrap_table = &fdt_devmap[0]; + arm_devmap_register_table(&fdt_devmap[0]); return (0); } diff --git a/sys/arm/xilinx/zy7_machdep.c b/sys/arm/xilinx/zy7_machdep.c index edda8d76aed..a2b01b5bf2a 100644 --- a/sys/arm/xilinx/zy7_machdep.c +++ b/sys/arm/xilinx/zy7_machdep.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -73,7 +74,7 @@ initarm_late_init(void) } #define FDT_DEVMAP_SIZE 3 -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_SIZE]; +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_SIZE]; /* * Construct pmap_devmap[] with DT-derived config data. @@ -104,7 +105,7 @@ platform_devmap_init(void) fdt_devmap[i].pd_prot = 0; fdt_devmap[i].pd_cache = 0; - pmap_devmap_bootstrap_table = &fdt_devmap[0]; + arm_devmap_register_table(&fdt_devmap[0]); return (0); } diff --git a/sys/arm/xscale/i80321/ep80219_machdep.c b/sys/arm/xscale/i80321/ep80219_machdep.c index 9d39193bec5..7697b617838 100644 --- a/sys/arm/xscale/i80321/ep80219_machdep.c +++ b/sys/arm/xscale/i80321/ep80219_machdep.c @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -125,7 +126,7 @@ struct pv_addr minidataclean; /* #define IQ80321_OBIO_SIZE 0x00100000UL */ /* Static device mappings. */ -static const struct pmap_devmap ep80219_devmap[] = { +static const struct arm_devmap_entry ep80219_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. @@ -300,7 +301,7 @@ initarm(struct arm_boot_params *abp) /* Map the vector page. */ pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - pmap_devmap_bootstrap(l1pagetable, ep80219_devmap); + arm_devmap_bootstrap(l1pagetable, ep80219_devmap); /* * Give the XScale global cache clean code an appropriately * sized chunk of unmapped VA space starting at 0xff000000 diff --git a/sys/arm/xscale/i80321/iq31244_machdep.c b/sys/arm/xscale/i80321/iq31244_machdep.c index eac3f149fbe..6074bbcba1d 100644 --- a/sys/arm/xscale/i80321/iq31244_machdep.c +++ b/sys/arm/xscale/i80321/iq31244_machdep.c @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -123,7 +124,7 @@ struct pv_addr minidataclean; #define IQ80321_OBIO_BASE 0xfe800000UL #define IQ80321_OBIO_SIZE 0x00100000UL /* Static device mappings. */ -static const struct pmap_devmap iq80321_devmap[] = { +static const struct arm_devmap_entry iq80321_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. @@ -301,7 +302,7 @@ initarm(struct arm_boot_params *abp) /* Map the vector page. */ pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - pmap_devmap_bootstrap(l1pagetable, iq80321_devmap); + arm_devmap_bootstrap(l1pagetable, iq80321_devmap); /* * Give the XScale global cache clean code an appropriately * sized chunk of unmapped VA space starting at 0xff000000 diff --git a/sys/arm/xscale/i8134x/crb_machdep.c b/sys/arm/xscale/i8134x/crb_machdep.c index 3b98bd30955..a9205ee9700 100644 --- a/sys/arm/xscale/i8134x/crb_machdep.c +++ b/sys/arm/xscale/i8134x/crb_machdep.c @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -123,7 +124,7 @@ struct pv_addr abtstack; struct pv_addr kernelstack; /* Static device mappings. */ -static const struct pmap_devmap iq81342_devmap[] = { +static const struct arm_devmap_entry iq81342_devmap[] = { { IOP34X_VADDR, IOP34X_HWADDR, @@ -285,7 +286,7 @@ initarm(struct arm_boot_params *abp) /* Map the vector page. */ pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - pmap_devmap_bootstrap(l1pagetable, iq81342_devmap); + arm_devmap_bootstrap(l1pagetable, iq81342_devmap); /* * Give the XScale global cache clean code an appropriately * sized chunk of unmapped VA space starting at 0xff000000 diff --git a/sys/arm/xscale/ixp425/avila_machdep.c b/sys/arm/xscale/ixp425/avila_machdep.c index 8b16631f503..b47e70a216f 100644 --- a/sys/arm/xscale/ixp425/avila_machdep.c +++ b/sys/arm/xscale/ixp425/avila_machdep.c @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -125,7 +126,7 @@ struct pv_addr kernelstack; struct pv_addr minidataclean; /* Static device mappings. */ -static const struct pmap_devmap ixp425_devmap[] = { +static const struct arm_devmap_entry ixp425_devmap[] = { /* Physical/Virtual address for I/O space */ { IXP425_IO_VBASE, IXP425_IO_HWBASE, IXP425_IO_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, @@ -158,7 +159,7 @@ static const struct pmap_devmap ixp425_devmap[] = { }; /* Static device mappings. */ -static const struct pmap_devmap ixp435_devmap[] = { +static const struct arm_devmap_entry ixp435_devmap[] = { /* Physical/Virtual address for I/O space */ { IXP425_IO_VBASE, IXP425_IO_HWBASE, IXP425_IO_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE, }, @@ -368,9 +369,9 @@ initarm(struct arm_boot_params *abp) pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); if (cpu_is_ixp43x()) - pmap_devmap_bootstrap(l1pagetable, ixp435_devmap); + arm_devmap_bootstrap(l1pagetable, ixp435_devmap); else - pmap_devmap_bootstrap(l1pagetable, ixp425_devmap); + arm_devmap_bootstrap(l1pagetable, ixp425_devmap); /* * Give the XScale global cache clean code an appropriately * sized chunk of unmapped VA space starting at 0xff000000 diff --git a/sys/arm/xscale/pxa/pxa_machdep.c b/sys/arm/xscale/pxa/pxa_machdep.c index f7922832221..01f9c5efec3 100644 --- a/sys/arm/xscale/pxa/pxa_machdep.c +++ b/sys/arm/xscale/pxa/pxa_machdep.c @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -124,7 +125,7 @@ static void pxa_probe_sdram(bus_space_tag_t, bus_space_handle_t, uint32_t *, uint32_t *); /* Static device mappings. */ -static const struct pmap_devmap pxa_devmap[] = { +static const struct arm_devmap_entry pxa_devmap[] = { /* * Map the on-board devices up into the KVA region so we don't muck * up user-space. @@ -281,7 +282,7 @@ initarm(struct arm_boot_params *abp) /* Map the vector page. */ pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - pmap_devmap_bootstrap(l1pagetable, pxa_devmap); + arm_devmap_bootstrap(l1pagetable, pxa_devmap); /* * Give the XScale global cache clean code an appropriately diff --git a/sys/dev/fdt/fdt_pci.c b/sys/dev/fdt/fdt_pci.c index c0ebb07f18a..fae5f07aa86 100644 --- a/sys/dev/fdt/fdt_pci.c +++ b/sys/dev/fdt/fdt_pci.c @@ -335,7 +335,7 @@ next: #if defined(__arm__) int -fdt_pci_devmap(phandle_t node, struct pmap_devmap *devmap, vm_offset_t io_va, +fdt_pci_devmap(phandle_t node, struct arm_devmap_entry *devmap, vm_offset_t io_va, vm_offset_t mem_va) { struct fdt_pci_range io_space, mem_space;