blob: 4a02f913a7c73af81e0179a1c5ad6e56e7960f5e [file] [log] [blame]
// Copyright 2019 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.
#ifndef SRC_DEVICES_BOARD_DRIVERS_QEMU_ARM64_QEMU_BUS_H_
#define SRC_DEVICES_BOARD_DRIVERS_QEMU_ARM64_QEMU_BUS_H_
#include <threads.h>
#include <ddktl/device.h>
#include <ddktl/protocol/platform/bus.h>
namespace board_qemu_arm64 {
// BTI IDs for our devices
enum {
BTI_SYSMEM,
};
class QemuArm64 : public ddk::Device<QemuArm64> {
public:
QemuArm64(zx_device_t* parent, const ddk::PBusProtocolClient& pbus)
: ddk::Device<QemuArm64>(parent), pbus_(pbus) {}
static zx_status_t Create(void* ctx, zx_device_t* parent);
void DdkRelease() { delete this; }
private:
zx_status_t Start();
int Thread();
static zx_status_t PciInit();
zx_status_t PciAdd();
zx_status_t RtcInit();
zx_status_t SysmemInit();
zx_status_t DisplayInit();
const ddk::PBusProtocolClient pbus_;
thrd_t thread_;
};
} // namespace board_qemu_arm64
#endif // SRC_DEVICES_BOARD_DRIVERS_QEMU_ARM64_QEMU_BUS_H_