summaryrefslogtreecommitdiffstats
path: root/sys/arm/mv
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2013-01-27 00:39:02 +0000
committerian <ian@FreeBSD.org>2013-01-27 00:39:02 +0000
commit60d7652a68f6e9688f7117ffdd2584fdb79b6d43 (patch)
tree02b58046be8003c189904e5ed6e030896e79a3aa /sys/arm/mv
parentac1b6656c3b6deb472065703a5c1311d5f39c15e (diff)
downloadFreeBSD-src-60d7652a68f6e9688f7117ffdd2584fdb79b6d43.zip
FreeBSD-src-60d7652a68f6e9688f7117ffdd2584fdb79b6d43.tar.gz
Add a default do-nothing implementation of fdt_pci_devmap() using a weak alias,
so that we don't need an empty implementation of it for every Marvell platform that has no PCI. This allows the removal of the SheevaPlug-specific stub and config files, and eliminates the need to add similar stubs for future models. Marvell platforms that do expose PCI are compiled with 'device pci' which causes the real (non-weak) implementation in dev/fdt/fdt_pci.c to be used. Approved by: cognet (mentor)
Diffstat (limited to 'sys/arm/mv')
-rw-r--r--sys/arm/mv/kirkwood/files.sheevaplug4
-rw-r--r--sys/arm/mv/kirkwood/sheevaplug.c44
-rw-r--r--sys/arm/mv/kirkwood/std.sheevaplug5
-rw-r--r--sys/arm/mv/mv_machdep.c19
4 files changed, 19 insertions, 53 deletions
diff --git a/sys/arm/mv/kirkwood/files.sheevaplug b/sys/arm/mv/kirkwood/files.sheevaplug
deleted file mode 100644
index f56c2ab..0000000
--- a/sys/arm/mv/kirkwood/files.sheevaplug
+++ /dev/null
@@ -1,4 +0,0 @@
-# $FreeBSD$
-
-include "arm/mv/kirkwood/files.kirkwood"
-arm/mv/kirkwood/sheevaplug.c standard
diff --git a/sys/arm/mv/kirkwood/sheevaplug.c b/sys/arm/mv/kirkwood/sheevaplug.c
deleted file mode 100644
index 3463106..0000000
--- a/sys/arm/mv/kirkwood/sheevaplug.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * Copyright (c) 2010 The FreeBSD Foundation
- * All rights reserved.
- *
- * This software was developed by Semihalf under sponsorship from
- * the FreeBSD Foundation.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <dev/fdt/fdt_common.h>
-#include <dev/ofw/openfirm.h>
-
-#include <machine/fdt.h>
-
-int
-fdt_pci_devmap(phandle_t node, struct pmap_devmap *devmap, vm_offset_t io_va,
- vm_offset_t mem_va)
-{
-
- return (0);
-}
diff --git a/sys/arm/mv/kirkwood/std.sheevaplug b/sys/arm/mv/kirkwood/std.sheevaplug
deleted file mode 100644
index 44c977e..0000000
--- a/sys/arm/mv/kirkwood/std.sheevaplug
+++ /dev/null
@@ -1,5 +0,0 @@
-# $FreeBSD$
-
-include "../mv/std.mv"
-include "../mv/kirkwood/std.kirkwood"
-files "../mv/kirkwood/files.sheevaplug"
diff --git a/sys/arm/mv/mv_machdep.c b/sys/arm/mv/mv_machdep.c
index ae74fa3..fba222d 100644
--- a/sys/arm/mv/mv_machdep.c
+++ b/sys/arm/mv/mv_machdep.c
@@ -279,6 +279,25 @@ out:
}
/*
+ * Supply a default do-nothing implementation of fdt_pci_devmap() via a weak
+ * alias. Many Marvell platforms don't support a PCI interface, but to support
+ * those that do, we end up with a reference to this function below, in
+ * platform_devmap_init(). If "device pci" appears in the kernel config, the
+ * 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,
+ vm_offset_t io_va, vm_offset_t mem_va);
+int
+mv_default_fdt_pci_devmap(phandle_t node, struct pmap_devmap *devmap,
+ vm_offset_t io_va, vm_offset_t mem_va)
+{
+
+ return (0);
+}
+__weak_reference(mv_default_fdt_pci_devmap, fdt_pci_devmap);
+
+/*
* XXX: When device entry in devmap has pd_size smaller than section size,
* system will freeze during initialization
*/
OpenPOWER on IntegriCloud