From fefbe5ab0a495d58849a7fe9d9908d64840bdc2c Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 4 Nov 2013 22:45:26 +0000 Subject: 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 90badf2..e9f93e8 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 0ade6c7..a8819bd 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 68a9fdb..ec6fa9c 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 d574fb1..583d1ab 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 f4a9316..f7c21f9 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 2a549a2..dcf8178 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 d64e826..0323e7b 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 8e47dbc..de0eb68 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 d720e7d..ee16b67 100644 --- a/sys/arm/include/devmap.h +++ b/sys/arm/include/devmap.h @@ -30,6 +30,33 @@ #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 * static-mapped, then ptov returns NULL and vtop returns DEVMAP_PADDR_NOTFOUND. diff --git a/sys/arm/include/fdt.h b/sys/arm/include/fdt.h index f84402b..0be9927 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 c48b0a3..08e9e21 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 d393d1b..7448929 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 cb3ab84..576eda4 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 7ed9e24..5258b0a 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 6dca733..ace8dde 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 754541f..54abf46 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 6496d5e..e4eb162 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 1811b52..3fc0f8e 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 0808798..79014f2 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 007bdb5..1c5a879 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 66fe0a9..92ca04a 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 66bd4a0..8a3184a 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 0a8c0d8..08ce039 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 edda8d7..a2b01b5 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 9d39193..7697b61 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 eac3f14..6074bbc 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 3b98bd3..a9205ee 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 8b16631..b47e70a 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 f792283..01f9c5e 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 c0ebb07..fae5f07 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; -- cgit v1.1