From fd21387149c272b8aaee62466fe96863f3ef458f Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Fri, 14 May 2004 17:34:15 -0400 Subject: Linux boots... various fixes to make console work correctly dev/console.cc: commented out code that checks if an interrupt is happening before issuing one because they can get lost when linux boots dev/console.hh: added a setPlatform function to set the platform to interrupt dev/platform.hh: dev/tsunami.cc: dev/tsunami.hh: Added virtual functions to post console interrupts dev/tsunami_io.cc: allowed a 64bit read of the PIC since we can't do a physical byte read dev/tsunami_uart.cc: moved TsunamiUart to PioDevice various little fixes to make linux work dev/tsunami_uart.hh: Made Tsunami_Uart a PIO device dev/tsunamireg.h: added some UART defines and used the ULL macros kern/linux/linux_system.cc: commented out waiting for gdb --HG-- extra : convert_revision : 8cfd0700f3812ab349a6d7f132f85f4f421c5c5e --- dev/tsunami_io.cc | 47 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) (limited to 'dev/tsunami_io.cc') diff --git a/dev/tsunami_io.cc b/dev/tsunami_io.cc index d32291d0d..2dda86fbc 100644 --- a/dev/tsunami_io.cc +++ b/dev/tsunami_io.cc @@ -151,12 +151,21 @@ TsunamiIO::read(MemReqPtr &req, uint8_t *data) req->vaddr, req->size, req->vaddr & 0xfff); Addr daddr = (req->paddr - (addr & PA_IMPL_MASK)); -// ExecContext *xc = req->xc; -// int cpuid = xc->cpu_id; + switch(req->size) { case sizeof(uint8_t): switch(daddr) { + case TSDEV_PIC1_ISR: + // !!! If this is modified 64bit case needs to be too + // Pal code has to do a 64 bit physical read because there is + // no load physical byte instruction + *(uint8_t*)data = picr; + return No_Fault; + case TSDEV_PIC2_ISR: + // PIC2 not implemnted... just return 0 + *(uint8_t*)data = 0x00; + return No_Fault; case TSDEV_TMR_CTL: *(uint8_t*)data = timer2.Status(); return No_Fault; @@ -206,7 +215,22 @@ TsunamiIO::read(MemReqPtr &req, uint8_t *data) } case sizeof(uint16_t): case sizeof(uint32_t): + panic("I/O Read - invalid size - va %#x size %d\n", + req->vaddr, req->size); + case sizeof(uint64_t): + switch(daddr) { + case TSDEV_PIC1_ISR: + // !!! If this is modified 8bit case needs to be too + // Pal code has to do a 64 bit physical read because there is + // no load physical byte instruction + *(uint64_t*)data = (uint64_t)picr; + return No_Fault; + default: + panic("I/O Read - invalid size - va %#x size %d\n", + req->vaddr, req->size); + } + default: panic("I/O Read - invalid size - va %#x size %d\n", req->vaddr, req->size); @@ -231,17 +255,30 @@ TsunamiIO::write(MemReqPtr &req, const uint8_t *data) case sizeof(uint8_t): switch(daddr) { case TSDEV_PIC1_MASK: - mask1 = *(uint8_t*)data; + mask1 = ~(*(uint8_t*)data); if ((picr & mask1) && !picInterrupting) { picInterrupting = true; tsunami->cchip->postDRIR(55); DPRINTF(Tsunami, "posting pic interrupt to cchip\n"); } + if ((!(picr & mask1)) && picInterrupting) { + picInterrupting = false; + tsunami->cchip->clearDRIR(55); + DPRINTF(Tsunami, "clearing pic interrupt\n"); + } return No_Fault; case TSDEV_PIC2_MASK: mask2 = *(uint8_t*)data; //PIC2 Not implemented to interrupt return No_Fault; + case TSDEV_PIC1_ACK: + // clear the interrupt on the PIC + picr &= ~(1 << (*(uint8_t*)data & 0xF)); + if (!(picr & mask1)) + tsunami->cchip->clearDRIR(55); + return No_Fault; + case TSDEV_PIC2_ACK: + return No_Fault; case TSDEV_DMA1_RESET: return No_Fault; case TSDEV_DMA2_RESET: @@ -321,8 +358,7 @@ TsunamiIO::postPIC(uint8_t bitvector) { //PIC2 Is not implemented, because nothing of interest there picr |= bitvector; - if ((picr & mask1) && !picInterrupting) { - picInterrupting = true; + if (picr & mask1) { tsunami->cchip->postDRIR(55); DPRINTF(Tsunami, "posting pic interrupt to cchip\n"); } @@ -334,7 +370,6 @@ TsunamiIO::clearPIC(uint8_t bitvector) //PIC2 Is not implemented, because nothing of interest there picr &= ~bitvector; if (!(picr & mask1)) { - picInterrupting = false; tsunami->cchip->clearDRIR(55); DPRINTF(Tsunami, "clearing pic interrupt to cchip\n"); } -- cgit v1.2.3