Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Aug 2009 09:30:03 +0000 (UTC)
From:      Rafal Jaworowski <raj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r196531 - in head/sys/arm/mv: . discovery kirkwood orion
Message-ID:  <200908250930.n7P9U3A3022025@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: raj
Date: Tue Aug 25 09:30:03 2009
New Revision: 196531
URL: http://svn.freebsd.org/changeset/base/196531

Log:
  Eliminate platform_pmap_init() to simplify Marvell bootstrap code.

Modified:
  head/sys/arm/mv/discovery/db78xxx.c
  head/sys/arm/mv/kirkwood/db88f6xxx.c
  head/sys/arm/mv/mv_machdep.c
  head/sys/arm/mv/mvvar.h
  head/sys/arm/mv/orion/db88f5xxx.c

Modified: head/sys/arm/mv/discovery/db78xxx.c
==============================================================================
--- head/sys/arm/mv/discovery/db78xxx.c	Tue Aug 25 07:52:09 2009	(r196530)
+++ head/sys/arm/mv/discovery/db78xxx.c	Tue Aug 25 09:30:03 2009	(r196531)
@@ -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)
 {

Modified: head/sys/arm/mv/kirkwood/db88f6xxx.c
==============================================================================
--- head/sys/arm/mv/kirkwood/db88f6xxx.c	Tue Aug 25 07:52:09 2009	(r196530)
+++ head/sys/arm/mv/kirkwood/db88f6xxx.c	Tue Aug 25 09:30:03 2009	(r196531)
@@ -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)
 {

Modified: head/sys/arm/mv/mv_machdep.c
==============================================================================
--- head/sys/arm/mv/mv_machdep.c	Tue Aug 25 07:52:09 2009	(r196530)
+++ head/sys/arm/mv/mv_machdep.c	Tue Aug 25 09:30:03 2009	(r196531)
@@ -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);

Modified: head/sys/arm/mv/mvvar.h
==============================================================================
--- head/sys/arm/mv/mvvar.h	Tue Aug 25 07:52:09 2009	(r196530)
+++ head/sys/arm/mv/mvvar.h	Tue Aug 25 09:30:03 2009	(r196531)
@@ -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, uint
 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);

Modified: head/sys/arm/mv/orion/db88f5xxx.c
==============================================================================
--- head/sys/arm/mv/orion/db88f5xxx.c	Tue Aug 25 07:52:09 2009	(r196530)
+++ head/sys/arm/mv/orion/db88f5xxx.c	Tue Aug 25 09:30:03 2009	(r196531)
@@ -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)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908250930.n7P9U3A3022025>