31#include "debug/LupioBLK.hh"
34#include "params/LupioBLK.hh"
37#define LUPIO_BLK_TYPE 0x2
40#define LUPIO_BLK_IRQE 0x1
43#define LUPIO_BLK_BUSY 0x1
44#define LUPIO_BLK_ERRR 0x4
48#define SECTOR_SIZE (1ULL << SECTOR_BITS)
55 platform(params.platform),
57 pioAddr(params.pio_addr),
58 pioSize(params.pio_size),
60 lupioBLKIntID(params.int_id)
63 " match LupIO device\n");
64 nbBlocks = image.size();
73 int64_t _offset =
lba;
126 panic(
"Unexpected read to the LupioBLK device at address"
136 uint32_t
val = val64;
159 panic(
"Attempting to write to LupioBLK device while transfer"
165 panic(
"Unexpected write to the LupioBLK device at address"
176 panic(
"Bad LBA range\n");
185 int64_t _offset =
lba;
212 "Read request - addr: %#x, size: %#x\n",
addr, pkt->
getSize());
virtual std::streampos write(const uint8_t *data, std::streampos offset)=0
virtual std::streampos read(uint8_t *data, std::streampos offset) const =0
void dmaWrite(Addr addr, int size, Event *event, uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay=0)
void dmaRead(Addr addr, int size, Event *event, uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay=0)
LupioBLK: A virtual block device which aims to provide a disk-like interface for second-level storage...
void lupioBLKCmd(void)
Function to initiate and direct the transfer of data by the DMA device.
AddrRangeList getAddrRanges() const override
Implement BasicPioDevice virtual functions.
void lupioBLKWrite(const uint8_t addr, uint64_t val64)
Function to write to registers containing data pertaining to block transfers.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
LupioBLK(const Params ¶ms)
const ByteOrder byteOrder
uint64_t lupioBLKRead(const uint8_t addr)
Function to return data pertaining to blocks being transferred.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
EventFunctionWrapper dmaEvent
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void setUintX(uint64_t w, ByteOrder endian)
Set the value in the word w after truncating it to the length of the packet and then byteswapping it ...
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
uint64_t getUintX(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness and zero-extended to 64 bits.
AddrRange RangeSize(Addr start, Addr size)
static constexpr std::enable_if_t< std::is_integral_v< T >, int > floorLog2(T x)
static constexpr int ceilLog2(const T &n)
static constexpr bool isPowerOf2(const T &n)
#define panic(...)
This implements a cprintf based panic() function.
#define gem5_assert(cond,...)
The assert macro will function like a normal assert, but will use panic instead of straight abort().
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.
const std::string & name()