Search
lxdream.org :: lxdream/src/sh4/scif.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/scif.c
changeset 54:d8b73031289c
prev35:21a4be098304
next428:338966c8aed0
author nkeynes
date Sun Jan 01 08:08:40 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change Add (partial) DMAC implementation
file annotate diff log raw
1.1 --- a/src/sh4/scif.c Mon Dec 26 03:54:55 2005 +0000
1.2 +++ b/src/sh4/scif.c Sun Jan 01 08:08:40 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: scif.c,v 1.7 2005-12-26 03:54:55 nkeynes Exp $
1.6 + * $Id: scif.c,v 1.8 2006-01-01 08:08:40 nkeynes Exp $
1.7 * SCIF (Serial Communication Interface with FIFO) implementation - part of the
1.8 * SH4 standard on-chip peripheral set. The SCIF is hooked up to the DCs
1.9 * external serial port
1.10 @@ -20,9 +20,10 @@
1.11 #include <glib.h>
1.12 #include "dream.h"
1.13 #include "mem.h"
1.14 -#include "sh4core.h"
1.15 -#include "sh4mmio.h"
1.16 -#include "intc.h"
1.17 +#include "sh4/sh4core.h"
1.18 +#include "sh4/sh4mmio.h"
1.19 +#include "sh4/intc.h"
1.20 +#include "sh4/dmac.h"
1.21 #include "clock.h"
1.22 #include "serial.h"
1.23
1.24 @@ -255,6 +256,7 @@
1.25 tmp |= SCFSR2_RDF;
1.26 if( IS_RECEIVE_IRQ_ENABLED() )
1.27 intc_raise_interrupt( INT_SCIF_RXI );
1.28 + DMAC_trigger( DMAC_SCIF_RDF );
1.29 }
1.30 MMIO_WRITE( SCIF, SCFSR2, tmp );
1.31 return TRUE;
1.32 @@ -313,6 +315,7 @@
1.33 tmp |= SCFSR2_TEND; /* Transmission ended - no data waiting */
1.34 if( IS_TRANSMIT_IRQ_ENABLED() )
1.35 intc_raise_interrupt( INT_SCIF_TXI );
1.36 + DMAC_trigger( DMAC_SCIF_TDE );
1.37 MMIO_WRITE( SCIF, SCFSR2, tmp );
1.38 }
1.39 return (int)(unsigned int)result;
1.40 @@ -368,6 +371,7 @@
1.41 MMIO_WRITE( SCIF, SCFSR2, MMIO_READ( SCIF, SCFSR2 ) | SCFSR2_TEND | SCFSR2_TDFE );
1.42 if( IS_TRANSMIT_IRQ_ENABLED() ) {
1.43 intc_raise_interrupt( INT_SCIF_TXI );
1.44 + DMAC_trigger( DMAC_SCIF_TDE );
1.45 }
1.46 }
1.47
1.48 @@ -609,6 +613,7 @@
1.49 MMIO_WRITE( SCIF, SCFSR2, tmp | SCFSR2_DR );
1.50 if( IS_RECEIVE_IRQ_ENABLED() )
1.51 intc_raise_interrupt( INT_SCIF_RXI );
1.52 + DMAC_trigger( DMAC_SCIF_RDF );
1.53 }
1.54 }
1.55 SCIF_rcvd_last_tick = rcvd;
.