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)
This commit is contained in:
Ian Lepore 2013-01-27 00:39:02 +00:00
parent af66b223de
commit 427dadb03c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245954
5 changed files with 20 additions and 54 deletions

View File

@ -5,7 +5,7 @@
#
ident SHEEVAPLUG
include "../mv/kirkwood/std.sheevaplug"
include "../mv/kirkwood/std.db88f6xxx"
options SOC_MV_KIRKWOOD
makeoptions MODULES_OVERRIDE=""

View File

@ -1,4 +0,0 @@
# $FreeBSD$
include "arm/mv/kirkwood/files.kirkwood"
arm/mv/kirkwood/sheevaplug.c standard

View File

@ -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);
}

View File

@ -1,5 +0,0 @@
# $FreeBSD$
include "../mv/std.mv"
include "../mv/kirkwood/std.kirkwood"
files "../mv/kirkwood/files.sheevaplug"

View File

@ -278,6 +278,25 @@ platform_sram_devmap(struct pmap_devmap *map)
}
/*
* 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