diff options
author | raj <raj@FreeBSD.org> | 2009-08-25 09:30:03 +0000 |
---|---|---|
committer | raj <raj@FreeBSD.org> | 2009-08-25 09:30:03 +0000 |
commit | c1a2d532dd31a8096b7fbf2046d6494417284551 (patch) | |
tree | d0c4d8bd2673afe874c5be6a5b74604683e0e60a /sys/arm | |
parent | 998b5231f2ac0ae770ce77a9d54712659ea0bb80 (diff) | |
download | FreeBSD-src-c1a2d532dd31a8096b7fbf2046d6494417284551.zip FreeBSD-src-c1a2d532dd31a8096b7fbf2046d6494417284551.tar.gz |
Eliminate platform_pmap_init() to simplify Marvell bootstrap code.
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/mv/discovery/db78xxx.c | 15 | ||||
-rw-r--r-- | sys/arm/mv/kirkwood/db88f6xxx.c | 15 | ||||
-rw-r--r-- | sys/arm/mv/mv_machdep.c | 7 | ||||
-rw-r--r-- | sys/arm/mv/mvvar.h | 6 | ||||
-rw-r--r-- | sys/arm/mv/orion/db88f5xxx.c | 14 |
5 files changed, 13 insertions, 44 deletions
diff --git a/sys/arm/mv/discovery/db78xxx.c b/sys/arm/mv/discovery/db78xxx.c index 98b2dff..df68f50 100644 --- a/sys/arm/mv/discovery/db78xxx.c +++ b/sys/arm/mv/discovery/db78xxx.c @@ -68,11 +68,8 @@ __FBSDID("$FreeBSD$"); * 0xffff_2000 - 0xffff_ffff : unused (~55KB) */ -const struct pmap_devmap *pmap_devmap_bootstrap_table; -vm_offset_t pmap_bootstrap_lastaddr; - /* Static device mappings. */ -static const struct pmap_devmap pmap_devmap[] = { +const struct pmap_devmap pmap_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. @@ -105,16 +102,6 @@ const struct gpio_config mv_gpio_config[] = { { -1, -1, -1 } }; -int -platform_pmap_init(void) -{ - - pmap_bootstrap_lastaddr = MV_BASE - ARM_NOCACHE_KVA_SIZE; - pmap_devmap_bootstrap_table = &pmap_devmap[0]; - - return (0); -} - void platform_mpp_init(void) { diff --git a/sys/arm/mv/kirkwood/db88f6xxx.c b/sys/arm/mv/kirkwood/db88f6xxx.c index 5f89010..6e41ef8 100644 --- a/sys/arm/mv/kirkwood/db88f6xxx.c +++ b/sys/arm/mv/kirkwood/db88f6xxx.c @@ -68,11 +68,8 @@ __FBSDID("$FreeBSD$"); * 0xffff_2000 - 0xffff_ffff : unused (~55KB) */ -const struct pmap_devmap *pmap_devmap_bootstrap_table; -vm_offset_t pmap_bootstrap_lastaddr; - /* Static device mappings. */ -static const struct pmap_devmap pmap_devmap[] = { +const struct pmap_devmap pmap_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. @@ -105,16 +102,6 @@ const struct gpio_config mv_gpio_config[] = { { -1, -1, -1 } }; -int -platform_pmap_init(void) -{ - - pmap_bootstrap_lastaddr = MV_BASE - ARM_NOCACHE_KVA_SIZE; - pmap_devmap_bootstrap_table = &pmap_devmap[0]; - - return (0); -} - void platform_mpp_init(void) { diff --git a/sys/arm/mv/mv_machdep.c b/sys/arm/mv/mv_machdep.c index 59836fc..2dc20ce 100644 --- a/sys/arm/mv/mv_machdep.c +++ b/sys/arm/mv/mv_machdep.c @@ -86,6 +86,7 @@ __FBSDID("$FreeBSD$"); #include <machine/bootinfo.h> #include <arm/mv/mvvar.h> /* XXX eventually this should be eliminated */ +#include <arm/mv/mvwin.h> #ifdef DEBUG #define debugf(fmt, args...) printf(fmt, ##args) @@ -133,7 +134,9 @@ struct pcpu *pcpup = &__pcpu; vm_paddr_t phys_avail[10]; vm_paddr_t dump_avail[4]; vm_offset_t physical_pages; +vm_offset_t pmap_bootstrap_lastaddr; +const struct pmap_devmap *pmap_devmap_bootstrap_table; struct pv_addr systempage; struct pv_addr msgbufpv; struct pv_addr irqstack; @@ -423,8 +426,8 @@ initarm(void *mdp, void *unused __unused) while (1); /* Platform-specific initialisation */ - if (platform_pmap_init() != 0) - return (NULL); + pmap_bootstrap_lastaddr = MV_BASE - ARM_NOCACHE_KVA_SIZE; + pmap_devmap_bootstrap_table = &pmap_devmap[0]; pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); diff --git a/sys/arm/mv/mvvar.h b/sys/arm/mv/mvvar.h index 061f363..9274dcf 100644 --- a/sys/arm/mv/mvvar.h +++ b/sys/arm/mv/mvvar.h @@ -41,6 +41,10 @@ #define _MVVAR_H_ #include <sys/rman.h> +#include <vm/vm.h> +#include <vm/pmap.h> +#include <machine/pmap.h> +#include <machine/vm.h> #define MV_TYPE_PCI 0 #define MV_TYPE_PCIE 1 @@ -104,6 +108,7 @@ struct decode_win { int remap; }; +extern const struct pmap_devmap pmap_devmap[]; extern const struct obio_pci mv_pci_info[]; extern const struct gpio_config mv_gpio_config[]; extern bus_space_tag_t obio_tag; @@ -124,7 +129,6 @@ int mv_gpio_configure(uint32_t pin, uint32_t flags, uint32_t mask); void mv_gpio_out(uint32_t pin, uint8_t val, uint8_t enable); uint8_t mv_gpio_in(uint32_t pin); -int platform_pmap_init(void); void platform_mpp_init(void); int soc_decode_win(void); void soc_id(uint32_t *dev, uint32_t *rev); diff --git a/sys/arm/mv/orion/db88f5xxx.c b/sys/arm/mv/orion/db88f5xxx.c index 8b40f54..02759be 100644 --- a/sys/arm/mv/orion/db88f5xxx.c +++ b/sys/arm/mv/orion/db88f5xxx.c @@ -70,12 +70,10 @@ __FBSDID("$FreeBSD$"); * 0xffff_2000 - 0xffff_ffff : unused (~55KB) */ -const struct pmap_devmap *pmap_devmap_bootstrap_table; -vm_offset_t pmap_bootstrap_lastaddr; int platform_pci_get_irq(u_int bus, u_int slot, u_int func, u_int pin); /* Static device mappings. */ -static const struct pmap_devmap pmap_devmap[] = { +const struct pmap_devmap pmap_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. @@ -184,16 +182,6 @@ const struct gpio_config mv_gpio_config[] = { }; #endif -int -platform_pmap_init(void) -{ - - pmap_bootstrap_lastaddr = MV_BASE - ARM_NOCACHE_KVA_SIZE; - pmap_devmap_bootstrap_table = &pmap_devmap[0]; - - return (0); -} - void platform_mpp_init(void) { |