blob: 1fbedb7193e73bd08536acdff3d783691fde08f3 [file] [log] [blame]
// Copyright 2020 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_RAM_DRIVERS_AML_RAM_AML_RAM_H_
#define SRC_DEVICES_RAM_DRIVERS_AML_RAM_AML_RAM_H_
#include <fuchsia/device/llcpp/fidl.h>
#include <lib/mmio/mmio.h>
#include <ddktl/device.h>
namespace amlogic_ram {
// The AmlRam device provides FIDL services directly to applications
// to query performance counters. For example effective DDR bandwith.
class AmlRam;
using DeviceType = ddk::Device<AmlRam, ddk::Messageable>;
class AmlRam : public DeviceType {
public:
DISALLOW_COPY_AND_ASSIGN_ALLOW_MOVE(AmlRam);
static zx_status_t Create(void* context, zx_device_t* parent);
explicit AmlRam(zx_device_t* parent, ddk::MmioBuffer mmio);
void DdkRelease();
// Implements ddk::Messageable
zx_status_t DdkMessage(fidl_msg_t* msg, fidl_txn_t* txn);
private:
zx_status_t Bind();
ddk::MmioBuffer mmio_;
};
} // namespace amlogic_ram
#endif // SRC_DEVICES_RAM_DRIVERS_AML_RAM_AML_RAM_H_