summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2006-07-26 17:12:54 +0000
committermarcel <marcel@FreeBSD.org>2006-07-26 17:12:54 +0000
commit98879d5954171959172ad751ea8a8361bc15b06a (patch)
tree5431afacb987a1189486b592f289b7f0e76a8ce3 /sys/powerpc
parent987baddcf7038cdf212b39ca4d5fd466805bff76 (diff)
downloadFreeBSD-src-98879d5954171959172ad751ea8a8361bc15b06a.zip
FreeBSD-src-98879d5954171959172ad751ea8a8361bc15b06a.tar.gz
o Move the prototype of mem_valid() from ofw_machdep.h to md_var.h.
This avoids that mem.c has to include ofw_machdep.h, including all OFW related headers. o Provide a stub for OF_decode_addr(), which is used by low-level console drivers to obtain a tag and handle given a OFW phandle. This is different from sparc64, where a fake bus tag needs to be created explicitly.
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/aim/ofw_machdep.c18
-rw-r--r--sys/powerpc/include/md_var.h1
-rw-r--r--sys/powerpc/include/ofw_machdep.h2
-rw-r--r--sys/powerpc/powerpc/mem.c1
-rw-r--r--sys/powerpc/powerpc/ofw_machdep.c18
5 files changed, 38 insertions, 2 deletions
diff --git a/sys/powerpc/aim/ofw_machdep.c b/sys/powerpc/aim/ofw_machdep.c
index 8e98cac..d868eec 100644
--- a/sys/powerpc/aim/ofw_machdep.c
+++ b/sys/powerpc/aim/ofw_machdep.c
@@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_param.h>
#include <vm/vm_page.h>
+#include <machine/bus.h>
+#include <machine/md_var.h>
#include <machine/powerpc.h>
#include <machine/ofw_machdep.h>
#include <powerpc/ofw/ofw_pci.h>
@@ -284,6 +286,22 @@ OF_getetheraddr(device_t dev, u_char *addr)
OF_getprop(node, "local-mac-address", addr, ETHER_ADDR_LEN);
}
+/*
+ * Return the physical address and the bus space to use for a node
+ * referenced by its package handle and the index of the register bank
+ * to decode. Intended to be used by console drivers in early boot only.
+ * Works by mapping the address of the node's bank given in the address
+ * space of its parent upward in the device tree at each bridge along the
+ * path.
+ */
+int
+OF_decode_addr(phandle_t node, int bank, bus_space_tag_t *tag,
+ bus_space_handle_t *handle)
+{
+
+ return (ENXIO);
+}
+
int
mem_valid(vm_offset_t addr, int len)
{
diff --git a/sys/powerpc/include/md_var.h b/sys/powerpc/include/md_var.h
index 9e98647..fa868c1 100644
--- a/sys/powerpc/include/md_var.h
+++ b/sys/powerpc/include/md_var.h
@@ -52,6 +52,7 @@ struct pcicfg;
void busdma_swi(void);
int is_physical_memory(vm_offset_t addr);
+int mem_valid(vm_offset_t addr, int len);
void decr_init(void);
diff --git a/sys/powerpc/include/ofw_machdep.h b/sys/powerpc/include/ofw_machdep.h
index 7f3aa0e..a4b601e 100644
--- a/sys/powerpc/include/ofw_machdep.h
+++ b/sys/powerpc/include/ofw_machdep.h
@@ -30,7 +30,7 @@
#include <sys/bus.h>
+int OF_decode_addr(phandle_t, int, bus_space_tag_t *, bus_space_handle_t *);
void OF_getetheraddr(device_t dev, u_char *addr);
-int mem_valid(vm_offset_t addr, int len);
#endif /* _MACHINE_OFW_MACHDEP_H_ */
diff --git a/sys/powerpc/powerpc/mem.c b/sys/powerpc/powerpc/mem.c
index c7f30205..340fa82 100644
--- a/sys/powerpc/powerpc/mem.c
+++ b/sys/powerpc/powerpc/mem.c
@@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$");
#include <sys/uio.h>
#include <machine/md_var.h>
-#include <machine/ofw_machdep.h>
#include <machine/vmparam.h>
#include <vm/vm.h>
diff --git a/sys/powerpc/powerpc/ofw_machdep.c b/sys/powerpc/powerpc/ofw_machdep.c
index 8e98cac..d868eec 100644
--- a/sys/powerpc/powerpc/ofw_machdep.c
+++ b/sys/powerpc/powerpc/ofw_machdep.c
@@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_param.h>
#include <vm/vm_page.h>
+#include <machine/bus.h>
+#include <machine/md_var.h>
#include <machine/powerpc.h>
#include <machine/ofw_machdep.h>
#include <powerpc/ofw/ofw_pci.h>
@@ -284,6 +286,22 @@ OF_getetheraddr(device_t dev, u_char *addr)
OF_getprop(node, "local-mac-address", addr, ETHER_ADDR_LEN);
}
+/*
+ * Return the physical address and the bus space to use for a node
+ * referenced by its package handle and the index of the register bank
+ * to decode. Intended to be used by console drivers in early boot only.
+ * Works by mapping the address of the node's bank given in the address
+ * space of its parent upward in the device tree at each bridge along the
+ * path.
+ */
+int
+OF_decode_addr(phandle_t node, int bank, bus_space_tag_t *tag,
+ bus_space_handle_t *handle)
+{
+
+ return (ENXIO);
+}
+
int
mem_valid(vm_offset_t addr, int len)
{
OpenPOWER on IntegriCloud