blob: 723e4d36399b127036a90e3a593df8d109a8612f [file] [log] [blame]
// 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 zx;
// TODO: Not need this anymore.
[repr="C"]
struct ZxDevice {};
[repr="C"]
struct DeviceAddArgs {};
struct PdevDeviceInfo {
uint32 vid;
uint32 pid;
uint32 did;
uint32 mmio_count;
uint32 irq_count;
uint32 gpio_count;
uint32 i2c_channel_count;
uint32 clk_count;
uint32 bti_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.
string:32 board_name;
/// Board specific revision number.
uint32 board_revision;
};
[Layout="ddk-protocol"]
interface PlatformDevice {
1: MapMmio(uint32 index, uint32 cache_policy) -> (zx.status s, vector<void>? vaddr,
zx.paddr paddr, handle<vmo> @handle);
2: MapInterrupt(uint32 index, uint32 flags) -> (zx.status s, handle<interrupt> irq);
3: GetBti(uint32 index) -> (zx.status s, handle<bti> bti);
4: GetDeviceInfo() -> (zx.status s, PdevDeviceInfo info);
5: GetBoardInfo() -> (zx.status s, PdevBoardInfo info);
6: DeviceAdd (uint32 index, DeviceAddArgs args) -> (zx.status s, ZxDevice? out);
};