| // Copyright 2018 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. |
| |
| library ddk.protocol.platform.device; |
| |
| using ddk.driver; |
| using zx; |
| |
| struct PdevDeviceInfo { |
| uint32 vid; |
| uint32 pid; |
| uint32 did; |
| uint32 mmio_count; |
| uint32 irq_count; |
| uint32 bti_count; |
| uint32 smc_count; |
| uint32 metadata_count; |
| array<uint32>:8 reserved; |
| string:32 name; |
| }; |
| |
| struct PdevBoardInfo { |
| /// Vendor ID for the board. |
| uint32 vid; |
| /// Product ID for the board. |
| uint32 pid; |
| /// Board name from the boot image platform ID record, |
| /// (or from the BIOS on x86 platforms). |
| string:32 board_name; |
| /// Board specific revision number. |
| uint32 board_revision; |
| }; |
| |
| struct PdevMmio { |
| /// Offset from beginning of VMO where the mmio region begins. |
| zx.off offset; |
| /// Size of mmio region. |
| usize size; |
| handle<vmo> vmo; |
| }; |
| |
| [Layout = "ddk-protocol"] |
| protocol PDev { |
| GetMmio(uint32 index) -> (zx.status s, PdevMmio mmio); |
| GetInterrupt(uint32 index, uint32 flags) -> (zx.status s, handle<interrupt> irq); |
| GetBti(uint32 index) -> (zx.status s, handle<bti> bti); |
| GetSmc(uint32 index) -> (zx.status s, handle<resource> smc); |
| GetDeviceInfo() -> (zx.status s, PdevDeviceInfo info); |
| GetBoardInfo() -> (zx.status s, PdevBoardInfo info); |
| }; |