Page MenuHomeFreeBSD

Implement a generic bhnd(4) device enumeration table API.
ClosedPublic

Authored by landonf on Sep 1 2016, 7:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 24 2024, 7:06 AM
Unknown Object (File)
Feb 1 2024, 1:47 PM
Unknown Object (File)
Dec 20 2023, 2:17 AM
Unknown Object (File)
Dec 1 2023, 1:16 AM
Unknown Object (File)
Nov 19 2023, 1:26 PM
Unknown Object (File)
Nov 17 2023, 2:22 AM
Unknown Object (File)
Nov 15 2023, 7:01 AM
Unknown Object (File)
Nov 12 2023, 3:56 PM
Subscribers

Details

Summary

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 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 delta;
this will allow us to perform full bhndb bridge configuration *prior* to
actually attaching and enumerating the bhnd(4) child device, eliminating a
cyclic dependency that currently exists, and allowing us to safely allocate
bus-level agent/device resources during bhnd(4) bus enumeration (something
that's required for the bhnd(4) interrupt handling).

Changes:

  • Defined a new bhnd_erom_if interfaces for bhnd(4) device enumeration.
  • Migrated the bcma_erom API to the new bhnd_erom_if interface.
  • Added a new siba(4) implementation of bhnd_erom_if.
  • 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 instances 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 bcm_bcma/bcm_siba-specific implementations.
Test Plan

Verified that platform/bus enumeration executes successfully on:

  • BCM43225 (wifi/bcma)
  • BCM4312 (wifi/siba)
  • BCM4716 (mips/bcma)
  • BCM5357 (mips/bcma)
  • BCM5365 (mips/siba)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

landonf retitled this revision from to Implement a generic bhnd(4) device enumeration table API..
landonf updated this object.
landonf edited the test plan for this revision. (Show Details)
landonf added reviewers: adrian, mizhka.
adrian edited edge metadata.
This revision is now accepted and ready to land.Sep 1 2016, 9:53 PM
This revision was automatically updated to reflect the committed changes.