| // Copyright 2024 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| { |
| children: [ |
| { |
| name: "driver_manager", |
| url: "fuchsia-boot:///driver_manager#meta/driver_manager.cm", |
| environment: "#driver_manager-env", |
| }, |
| { |
| name: "driver_index", |
| url: "fuchsia-boot:///driver-index#meta/driver-index.cm", |
| on_terminate: "reboot", |
| }, |
| { |
| // Exists to augment capability graph with information about when #boot-drivers should |
| // be stopped. Most components should prefer depending on capabiliites provided by |
| // #devfs-with-pkg over this component |
| name: "devfs", |
| url: "fuchsia-boot:///devfs#meta/devfs.cm", |
| environment: "#devfs-env", |
| }, |
| { |
| // Exists to augment capability graph with information about when #pkg-drivers and |
| // #full-pkg-drivers should be stopped. Most components should prefer depending on |
| // capabiliites provided by this component over #devfs. |
| name: "devfs-with-pkg", |
| url: "fuchsia-boot:///devfs#meta/devfs-pkg.cm", |
| environment: "#devfs-env", |
| }, |
| ], |
| collections: [ |
| { |
| name: "driver-hosts", |
| environment: "#driver-host-env", |
| durability: "single_run", |
| }, |
| { |
| name: "boot-drivers", |
| environment: "#boot-driver-env", |
| durability: "single_run", |
| allowed_offers: "static_and_dynamic", |
| allow_long_names: true, |
| }, |
| ], |
| offer: [ |
| { |
| from: "parent", |
| to: "#driver_index", |
| config: [ |
| "fuchsia.driver.BaseDrivers", |
| "fuchsia.driver.BindEager", |
| "fuchsia.driver.BootDrivers", |
| "fuchsia.driver.DelayFallbackUntilBaseDriversIndexed", |
| "fuchsia.driver.DisabledDrivers", |
| "fuchsia.driver.DriverLoadFuzzerMaxDelayMs", |
| "fuchsia.driver.EnableDriverLoadFuzzer", |
| "fuchsia.driver.EnableEphemeralDrivers", |
| ], |
| }, |
| { |
| from: "parent", |
| to: "#driver_manager", |
| config: [ |
| "fuchsia.driver.DelayFallbackUntilBaseDriversIndexed", |
| "fuchsia.driver.manager.DriverHostCrashPolicy", |
| "fuchsia.driver.manager.EnableTestShutdownDelays", |
| "fuchsia.driver.manager.RootDriver", |
| ], |
| }, |
| { |
| from: "parent", |
| to: "#boot-drivers", |
| config: [ |
| "fuchsia.driver.UseHardwareIommu", |
| "fuchsia.power.SuspendEnabled", |
| "fuchsia.usb.PeripheralConfig.Functions", |
| ], |
| }, |
| { |
| protocol: "fuchsia.tracing.provider.Registry", |
| from: "parent", |
| to: [ |
| "#boot-drivers", |
| "#driver-hosts", |
| "#driver_manager", |
| ], |
| availability: "optional", |
| }, |
| { |
| protocol: "fuchsia.component.resolution.Resolver", |
| from: "parent", |
| as: "fuchsia.component.resolution.Resolver-boot", |
| to: [ |
| "#driver_index", |
| "#driver_manager", |
| ], |
| }, |
| { |
| protocol: "fuchsia.component.resolution.Resolver", |
| from: "#pkg-cache", |
| as: "fuchsia.component.resolution.Resolver-base", |
| to: [ |
| "#driver_index", |
| "#driver_manager", |
| ], |
| |
| // pkg-cache depends on fshost for blobfs and fshost depends transitively on |
| // driver_index and driver_manager, but driver_index and driver_manager don't need base |
| // packages to provide fshost's (transitive) dependencies. |
| dependency: "weak", |
| source_availability: "unknown", |
| }, |
| { |
| // This is only used when the #driver_index |enable_ephemeral_drivers| config |
| // is set, which enables loading drivers ephemerally. This is intended for |
| // eng builds only and is set through product assembly. |
| // |
| // The #driver_manager will only use this protocol in DFv1. |
| // In DFv2 resolution is done by the component framework since drivers |
| // are componenets in DFv2. |
| protocol: "fuchsia.component.resolution.Resolver", |
| from: "#full_resolver", |
| as: "fuchsia.component.resolution.Resolver-full", |
| to: [ |
| "#driver_index", |
| "#driver_manager", |
| ], |
| dependency: "weak", |
| source_availability: "unknown", |
| }, |
| { |
| directory: "boot", |
| from: "parent", |
| as: "config", |
| to: "#driver_index", |
| rights: [ "r*" ], |
| subdir: "config/driver_index", |
| }, |
| { |
| protocol: [ |
| "fuchsia.boot.Arguments", |
| "fuchsia.boot.Items", |
| "fuchsia.boot.WriteOnlyLog", |
| "fuchsia.kernel.MexecResource", |
| "fuchsia.kernel.PowerResource", |
| ], |
| from: "parent", |
| to: "#driver_manager", |
| }, |
| { |
| protocol: "fuchsia.component.Realm", |
| from: "framework", |
| to: "#driver_manager", |
| }, |
| { |
| protocol: [ |
| "fuchsia.driver.index.DevelopmentManager", |
| "fuchsia.driver.index.DriverIndex", |
| "fuchsia.driver.registrar.DriverRegistrar", |
| ], |
| from: "#driver_index", |
| to: "#driver_manager", |
| }, |
| { |
| // The dependency relationship between power-manager and |
| // driver-manager is inverted. In other words, driver-manager |
| // depends on power-manager for its policy, but the relationship is |
| // expressed in reverse in the driver framework using weak |
| // dependencies. This "protocol" is a phantom used to ensure that |
| // driver-manager is shut down before power-manager is. |
| // |
| // TODO(https://fxbug.dev/42071033): Change the APIs used here so that |
| // driver-manager pulls policy from power-manager, rather |
| // power-manager pushing it to driver-manager. |
| protocol: [ "power-manager-outlives-driver-manager" ], |
| from: "#power_manager", |
| to: "#driver_manager", |
| source_availability: "unknown", |
| }, |
| { |
| protocol: [ "fuchsia.boot.WriteOnlyLog" ], |
| from: "parent", |
| to: "#driver-hosts", |
| }, |
| { |
| protocol: [ |
| "fuchsia.boot.Items", |
| "fuchsia.kernel.CpuResource", |
| "fuchsia.kernel.FramebufferResource", |
| "fuchsia.kernel.IommuResource", |
| "fuchsia.kernel.IoportResource", |
| "fuchsia.kernel.IrqResource", |
| "fuchsia.kernel.MmioResource", |
| "fuchsia.kernel.MsiResource", |
| "fuchsia.kernel.PowerResource", |
| "fuchsia.kernel.SmcResource", |
| ], |
| from: "parent", |
| to: "#boot-drivers", |
| }, |
| { |
| protocol: "fuchsia.kernel.InfoResource", |
| from: "parent", |
| to: "#boot-drivers", |
| }, |
| { |
| protocol: "fuchsia.boot.Arguments", |
| from: "parent", |
| to: "#boot-drivers", |
| }, |
| { |
| protocol: [ "fuchsia.scheduler.RoleManager" ], |
| from: "#role_manager", |
| to: [ |
| "#boot-drivers", |
| "#driver-hosts", |
| ], |
| source_availability: "unknown", |
| }, |
| { |
| protocol: [ "fuchsia.driver.framework.CompositeNodeManager" ], |
| from: "#driver_manager", |
| to: "#boot-drivers", |
| }, |
| { |
| protocol: [ "fuchsia.device.fs.lifecycle.Lifecycle" ], |
| from: "#driver_manager", |
| to: [ "#devfs" ], |
| }, |
| { |
| protocol: "fuchsia.device.fs.with.pkg.lifecycle.Lifecycle", |
| from: "#driver_manager", |
| as: "fuchsia.device.fs.lifecycle.Lifecycle", |
| to: [ "#devfs-with-pkg" ], |
| }, |
| { |
| directory: "dev", |
| from: "#driver_manager", |
| to: [ "#devfs" ], |
| }, |
| { |
| directory: "dev-topological", |
| from: "#devfs", |
| as: "dev", |
| to: [ "#devfs-with-pkg" ], |
| }, |
| |
| // These protocols are not actually used but exist to increase the lifetime |
| // of components. The capabilities are named after their place in the topology. |
| // We cannot use a single service due to the lack of service merging. |
| { |
| service: [ "bootstrap.driver-hosts" ], |
| from: "#driver-hosts", |
| to: [ |
| "#devfs", |
| "#devfs-with-pkg", |
| ], |
| }, |
| { |
| service: [ "bootstrap.boot-drivers" ], |
| from: "#boot-drivers", |
| to: [ "#devfs" ], |
| }, |
| { |
| service: [ "bootstrap.pkg-drivers" ], |
| from: "#pkg-drivers", |
| to: [ "#devfs-with-pkg" ], |
| source_availability: "unknown", |
| }, |
| { |
| service: [ "bootstrap.full-pkg-drivers" ], |
| from: "#full-pkg-drivers", |
| to: [ "#devfs-with-pkg" ], |
| source_availability: "unknown", |
| }, |
| { |
| protocol: [ "fuchsia.scheduler.RoleManager" ], |
| from: "#role_manager", |
| to: "#driver_manager", |
| source_availability: "unknown", |
| }, |
| { |
| protocol: [ |
| "fuchsia.sysmem.Allocator", |
| "fuchsia.sysmem2.Allocator", |
| ], |
| from: "#sysmem", |
| to: "#boot-drivers", |
| source_availability: "unknown", |
| }, |
| { |
| // TODO(https://fxbug.dev/42144438) This is only needed for an ordered shutdown. |
| // Driver_manager has to shut down before shutdown_shim. |
| protocol: "fuchsia.hardware.power.statecontrol.Admin", |
| from: "#shutdown_shim", |
| to: "#driver_manager", |
| source_availability: "unknown", |
| }, |
| { |
| // TODO(https://fxbug.dev/42144438) This is only needed for an ordered shutdown. |
| // Console should outlive driver_manager so that logs at the end of the boot process |
| // can still be seen. |
| protocol: "fuchsia.hardware.pty.Device", |
| from: "#console", |
| to: "#driver_manager", |
| source_availability: "unknown", |
| }, |
| { |
| protocol: [ "fuchsia.device.manager.SystemStateTransition" ], |
| from: "#shutdown_shim", |
| to: [ |
| "#boot-drivers", |
| "#driver-hosts", |
| "#driver_manager", |
| ], |
| source_availability: "unknown", |
| }, |
| { |
| protocol: [ |
| "fuchsia.inspect.InspectSink", |
| "fuchsia.logger.LogSink", |
| ], |
| from: "#archivist", |
| to: [ |
| "#boot-drivers", |
| "#devfs", |
| "#devfs-with-pkg", |
| "#driver-hosts", |
| "#driver_index", |
| "#driver_manager", |
| ], |
| }, |
| { |
| protocol: [ "fuchsia.power.system.ActivityGovernor" ], |
| from: "#system-activity-governor", |
| to: "#boot-drivers", |
| |
| // system-activity-governor depends on the suspend HAL but not all |
| // drivers depend on system-activity-governor. |
| // Weak to resolve dependency cycles. |
| dependency: "weak", |
| source_availability: "unknown", |
| }, |
| { |
| protocol: [ "fuchsia.power.broker.Topology" ], |
| from: "#power-broker", |
| to: "#boot-drivers", |
| source_availability: "unknown", |
| }, |
| ], |
| expose: [ |
| { |
| protocol: [ "fuchsia.driver.development.Manager" ], |
| from: "#driver_manager", |
| }, |
| { |
| protocol: "fuchsia.driver.registrar.DriverRegistrar", |
| from: "#driver_index", |
| }, |
| { |
| service: "fuchsia.hardware.rtc.Service", |
| from: "#boot-drivers", |
| }, |
| { |
| service: "fuchsia.hardware.cpu.ctrl.Service", |
| from: "#boot-drivers", |
| }, |
| { |
| directory: [ |
| "dev-builtin", |
| "dev-class", |
| "dev-topological", |
| ], |
| from: "#devfs-with-pkg", |
| }, |
| ], |
| environments: [ |
| { |
| name: "driver_manager-env", |
| extends: "realm", |
| |
| // 1 minute |
| __stop_timeout_ms: 60000, |
| }, |
| { |
| name: "devfs-env", |
| extends: "realm", |
| |
| // 1 minute |
| __stop_timeout_ms: 60000, |
| }, |
| { |
| name: "driver-host-env", |
| extends: "realm", |
| runners: [ |
| { |
| runner: "driver-host2", |
| from: "#driver_manager", |
| }, |
| ], |
| |
| // 2 seconds |
| __stop_timeout_ms: 2000, |
| }, |
| { |
| name: "boot-driver-env", |
| extends: "none", |
| runners: [ |
| { |
| runner: "driver", |
| from: "#driver_manager", |
| }, |
| ], |
| resolvers: [ |
| { |
| resolver: "boot_resolver", |
| from: "parent", |
| scheme: "fuchsia-boot", |
| }, |
| ], |
| |
| // 1 second |
| __stop_timeout_ms: 1000, |
| }, |
| ], |
| } |