Search
lxdream.org :: lxdream :: r1078:d8f1cf224e7e
lxdream 0.9.1
released Jun 29
Download Now
changeset1078:d8f1cf224e7e
parent1077:136fc24d17ef
child1079:691f9f621c5a
authornkeynes
dateThu Oct 08 08:44:39 2009 +1000 (11 years ago)
Fix SCIF operation
- status updates weren't being written back to the register (oops)
- slice cycle not updated on partial tick execution
- baudrate computation was always 0
src/sh4/scif.c
1.1 --- a/src/sh4/scif.c Wed Oct 07 17:53:56 2009 +1000
1.2 +++ b/src/sh4/scif.c Thu Oct 08 08:44:39 2009 +1000
1.3 @@ -436,6 +436,7 @@
1.4 (MMIO_READ( SCIF, SCLSR2 ) & SCLSR2_ORER) == 0 )
1.5 intc_clear_interrupt( INT_SCIF_ERI );
1.6 }
1.7 + MMIO_WRITE( SCIF, SCFSR2, result );
1.8 }
1.9
1.10 /**
1.11 @@ -467,12 +468,12 @@
1.12 /* Then process the bitrate register */
1.13 int bbr = MMIO_READ( SCIF, SCBRR2 ) & 0xFF;
1.14
1.15 - int baudrate = sh4_peripheral_freq / (32 * mult * (bbr+1) );
1.16 + SCIF_tick_period = sh4_peripheral_period * (32 * mult * (bbr+1));
1.17 + int baudrate = 1000000000 / SCIF_tick_period;
1.18
1.19 if( serial_device != NULL && serial_device->set_line_speed != NULL )
1.20 serial_device->set_line_speed( serial_device, baudrate );
1.21
1.22 - SCIF_tick_period = sh4_peripheral_period * (32 * mult * (bbr+1));
1.23
1.24 /*
1.25 clock_set_tick_rate( CLOCK_SCIF, baudrate / 10 );
1.26 @@ -666,6 +667,7 @@
1.27 SCIF_tick_remainder -= SCIF_tick_period;
1.28 SCIF_clock_tick();
1.29 }
1.30 + SCIF_slice_cycle = nanosecs;
1.31 }
1.32
1.33 void SCIF_run_slice( uint32_t nanosecs )
.