blob: a2e110cc5cf3961bbc8e70ab6cda9ff8a071aa1b [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 fuchsia.hardware.platform.device;
using zx;
type PdevDeviceInfo = struct {
vid uint32;
pid uint32;
did uint32;
mmio_count uint32;
irq_count uint32;
bti_count uint32;
smc_count uint32;
metadata_count uint32;
reserved array<uint32, 8>;
name string:32;
};
type PdevBoardInfo = struct {
/// Vendor ID for the board.
vid uint32;
/// Product ID for the board.
pid uint32;
/// Board name from the boot image platform ID record,
/// (or from the BIOS on x86 platforms).
board_name string:32;
/// Board specific revision number.
board_revision uint32;
};
type PdevMmio = resource struct {
/// Offset from beginning of VMO where the mmio region begins.
offset zx.Off;
/// Size of mmio region.
size uint64;
vmo zx.Handle:VMO;
};
@transport("Banjo")
@banjo_layout("ddk-protocol")
closed protocol PDev {
strict GetMmio(struct {
index uint32;
}) -> (resource struct {
s zx.Status;
mmio PdevMmio;
});
strict GetInterrupt(struct {
index uint32;
flags uint32;
}) -> (resource struct {
s zx.Status;
irq zx.Handle:INTERRUPT;
});
strict GetBti(struct {
index uint32;
}) -> (resource struct {
s zx.Status;
bti zx.Handle:BTI;
});
strict GetSmc(struct {
index uint32;
}) -> (resource struct {
s zx.Status;
smc zx.Handle:RESOURCE;
});
strict GetDeviceInfo() -> (struct {
s zx.Status;
info PdevDeviceInfo;
});
strict GetBoardInfo() -> (struct {
s zx.Status;
info PdevBoardInfo;
});
};