diff options
author | Landon J. Fuller <landonf@FreeBSD.org> | 2016-09-03 23:57:17 +0000 |
---|---|---|
committer | Landon J. Fuller <landonf@FreeBSD.org> | 2016-09-03 23:57:17 +0000 |
commit | 664a74970833402c37182bc52d64175f4750cbfa (patch) | |
tree | 9609d2f7bf1c0467348de94bc8c40b93f787bcd2 /sys/modules | |
parent | cd3912b6be0c28ff45f3d8853d69abf3e08e7d18 (diff) | |
download | src-664a74970833402c37182bc52d64175f4750cbfa.tar.gz src-664a74970833402c37182bc52d64175f4750cbfa.zip |
Implement a generic bhnd(4) device enumeration table API.
This defines a new bhnd_erom_if API, providing a common interface to device
enumeration on siba(4) and bcma(4) devices, for use both in the bhndb bridge
and SoC early boot contexts, and migrates mips/broadcom over to the new API.
This also replaces the previous adhoc device enumeration support implemented
for mips/broadcom.
Migration of bhndb to the new API will be implemented in a follow-up commit.
- Defined new bhnd_erom_if interface for bhnd(4) device enumeration, along
with bcma(4) and siba(4)-specific implementations.
- Fixed a minor bug in bhndb that logged an error when we attempted to map the
full siba(4) bus space (18000000-17FFFFFF) in the siba EROM parser.
- Reverted use of the resource's start address as the ChipCommon enum_addr in
bhnd_read_chipid(). When called from bhndb, this address is found within the
host address space, resulting in an invalid bridged enum_addr.
- Added support for falling back on standard bus_activate_resource() in
bhnd_bus_generic_activate_resource(), enabling allocation of the bhnd_erom's
bhnd_resource directly from a nexus-attached bhnd(4) device.
- Removed BHND_BUS_GET_CORE_TABLE(); it has been replaced by the erom API.
- Added support for statically initializing bhnd_erom instances, for use prior
to malloc availability. The statically allocated buffer size is verified both
at runtime, and via a compile-time assertion (see BHND_EROM_STATIC_BYTES).
- bhnd_erom classes are registered within a module via a linker set, allowing
mips/broadcom to probe available EROM parser instances without creating a
strong reference to bcma/siba-specific symbols.
- Migrated mips/broadcom to bhnd_erom_if, replacing the previous MIPS-specific
device enumeration implementation.
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7748
Notes
Notes:
svn path=/head/; revision=305366
Diffstat (limited to 'sys/modules')
-rw-r--r-- | sys/modules/bhnd/Makefile | 3 | ||||
-rw-r--r-- | sys/modules/bhnd/bcma/Makefile | 3 | ||||
-rw-r--r-- | sys/modules/bhnd/bcma_bhndb/Makefile | 3 | ||||
-rw-r--r-- | sys/modules/bhnd/siba/Makefile | 6 | ||||
-rw-r--r-- | sys/modules/bhnd/siba_bhndb/Makefile | 3 |
5 files changed, 13 insertions, 5 deletions
diff --git a/sys/modules/bhnd/Makefile b/sys/modules/bhnd/Makefile index 955565934734..9c99afd6eaa2 100644 --- a/sys/modules/bhnd/Makefile +++ b/sys/modules/bhnd/Makefile @@ -10,6 +10,9 @@ KMOD= bhnd SRCS= bhnd.c bhnd_subr.c SRCS+= bhnd_bus_if.c bhnd_bus_if.h +SRCS+= bhnd_erom.c +SRCS+= bhnd_erom_if.c bhnd_erom_if.h + # ChipCommon SRCS+= chipc.c chipc_subr.c SRCS+= bhnd_sprom_chipc.c \ diff --git a/sys/modules/bhnd/bcma/Makefile b/sys/modules/bhnd/bcma/Makefile index 7071d859ab6f..59d1eb5f1413 100644 --- a/sys/modules/bhnd/bcma/Makefile +++ b/sys/modules/bhnd/bcma/Makefile @@ -5,6 +5,7 @@ KMOD= bcma SRCS= bcma.c bcma_subr.c bcma_erom.c -SRCS+= device_if.h bus_if.h bhnd_bus_if.h +SRCS+= device_if.h bus_if.h +SRCS+= bhnd_bus_if.h bhnd_erom_if.h .include <bsd.kmod.mk> diff --git a/sys/modules/bhnd/bcma_bhndb/Makefile b/sys/modules/bhnd/bcma_bhndb/Makefile index 372a7ed0f6d2..e069cb5bdc30 100644 --- a/sys/modules/bhnd/bcma_bhndb/Makefile +++ b/sys/modules/bhnd/bcma_bhndb/Makefile @@ -5,7 +5,8 @@ KMOD= bcma_bhndb SRCS= bcma_bhndb.c -SRCS+= bhnd_bus_if.h bhndb_bus_if.h bhndb_if.h +SRCS+= bhnd_bus_if.h bhnd_erom_if.h +SRCS+= bhndb_bus_if.h bhndb_if.h SRCS+= device_if.h bus_if.h .include <bsd.kmod.mk> diff --git a/sys/modules/bhnd/siba/Makefile b/sys/modules/bhnd/siba/Makefile index 8ace993c04b6..0bf58e80a7c2 100644 --- a/sys/modules/bhnd/siba/Makefile +++ b/sys/modules/bhnd/siba/Makefile @@ -3,8 +3,10 @@ .PATH: ${.CURDIR}/../../../dev/bhnd/siba KMOD= siba -SRCS= siba.c siba_subr.c +SRCS= siba.c siba_subr.c \ + siba_erom.c -SRCS+= device_if.h bus_if.h bhnd_bus_if.h +SRCS+= device_if.h bus_if.h +SRCS+= bhnd_bus_if.h bhnd_erom_if.h .include <bsd.kmod.mk> diff --git a/sys/modules/bhnd/siba_bhndb/Makefile b/sys/modules/bhnd/siba_bhndb/Makefile index ba46a7f46cf4..bd9e6c28e4ce 100644 --- a/sys/modules/bhnd/siba_bhndb/Makefile +++ b/sys/modules/bhnd/siba_bhndb/Makefile @@ -5,7 +5,8 @@ KMOD= siba_bhndb SRCS= siba_bhndb.c -SRCS+= bhnd_bus_if.h bhndb_bus_if.h bhndb_if.h +SRCS+= bhnd_bus_if.h bhnd_erom_if.h +SRCS+= bhndb_bus_if.h bhndb_if.h SRCS+= device_if.h bus_if.h .include <bsd.kmod.mk> |