X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fdev%2Fuart8250.hh;h=7d577954cf6c3b1157e185cc327afe911242400f;hb=d2fd3b2ec2c265eb9ed3bdcc1db3e4c3feee3846;hp=44e90132f2bf3e64689227d18c19d91a74b2fdd9;hpb=4ed184eadefb16627f2807cb3dc7886bb1b920d1;p=gem5.git diff --git a/src/dev/uart8250.hh b/src/dev/uart8250.hh index 44e90132f..7d577954c 100644 --- a/src/dev/uart8250.hh +++ b/src/dev/uart8250.hh @@ -35,11 +35,9 @@ #ifndef __DEV_UART8250_HH__ #define __DEV_UART8250_HH__ -#include "dev/tsunamireg.h" -#include "base/range.hh" #include "dev/io_device.hh" #include "dev/uart.hh" - +#include "params/Uart8250.hh" /* UART8250 Interrupt ID Register * bit 0 Interrupt Pending 0 = true, 1 = false @@ -54,15 +52,26 @@ const uint8_t IIR_TXID = 0x02; /* Tx Data */ const uint8_t IIR_RXID = 0x04; /* Rx Data */ const uint8_t IIR_LINE = 0x06; /* Rx Line Status (highest priority)*/ -class SimConsole; +const uint8_t UART_IER_RDI = 0x01; +const uint8_t UART_IER_THRI = 0x02; +const uint8_t UART_IER_RLSI = 0x04; + + +const uint8_t UART_LSR_TEMT = 0x40; +const uint8_t UART_LSR_THRE = 0x20; +const uint8_t UART_LSR_DR = 0x01; + +const uint8_t UART_MCR_LOOP = 0x10; + + +class Terminal; class Platform; class Uart8250 : public Uart { - - protected: uint8_t IER, DLAB, LCR, MCR; + Tick lastTxInt; class IntrEvent : public Event { @@ -72,7 +81,7 @@ class Uart8250 : public Uart public: IntrEvent(Uart8250 *u, int bit); virtual void process(); - virtual const char *description(); + virtual const char *description() const; void scheduleIntr(); }; @@ -80,12 +89,17 @@ class Uart8250 : public Uart IntrEvent rxIntrEvent; public: - Uart8250(Params *p); - - virtual Tick read(Packet *pkt); - virtual Tick write(Packet *pkt); - virtual void addressRanges(AddrRangeList &range_list); + typedef Uart8250Params Params; + const Params * + params() const + { + return dynamic_cast(_params); + } + Uart8250(const Params *p); + virtual Tick read(PacketPtr pkt); + virtual Tick write(PacketPtr pkt); + virtual AddrRangeList getAddrRanges() const; /** * Inform the uart that there is data available.