From 3674af64417b911ce69539abeb6b99e3875b1a90 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 17 Oct 2007 20:45:13 +0000 Subject: Coldfire: Partially revert buffered writes, and enable them explicitly for the LCD only. Turned out that with buffered writes enabled, reads after writes are not always serialized, which is a bad thing for I/O. Buffered writes to the LCD are safe because that's write-only. Fixes FS #7985. How come I didn't notice this earlier? :> git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15173 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/coldfire/crt0.S | 7 ++++--- firmware/target/coldfire/iriver/h100/adc-h100.c | 2 +- firmware/target/coldfire/pcf50606-coldfire.c | 2 +- firmware/target/coldfire/system-target.h | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/firmware/target/coldfire/crt0.S b/firmware/target/coldfire/crt0.S index 1393bc8..cb9846a 100644 --- a/firmware/target/coldfire/crt0.S +++ b/firmware/target/coldfire/crt0.S @@ -218,14 +218,15 @@ start: move.l #0x01000000,%d0 movec.l %d0,%cacr - /* Enable cache, default=non-cacheable, buffered writes */ - move.l #0x80000100,%d0 + /* Enable cache, default=non-cacheable, no buffered writes */ + move.l #0x80000000,%d0 movec.l %d0,%cacr /* Cache enabled in SDRAM only, buffered writes enabled */ move.l #0x3103c020,%d0 movec.l %d0,%acr0 - moveq.l #0,%d0 + /* Buffered writes enabled for the LCD */ + move.l #0xf000c060,%d0 movec.l %d0,%acr1 #ifndef BOOTLOADER diff --git a/firmware/target/coldfire/iriver/h100/adc-h100.c b/firmware/target/coldfire/iriver/h100/adc-h100.c index 0c14d7b..40fcc89 100644 --- a/firmware/target/coldfire/iriver/h100/adc-h100.c +++ b/firmware/target/coldfire/iriver/h100/adc-h100.c @@ -37,7 +37,7 @@ ({ \ int _x_; \ asm volatile ( \ - "move.l #13, %[_x_] \r\n" \ + "move.l #11, %[_x_] \r\n" \ "1: \r\n" \ "subq.l #1, %[_x_] \r\n" \ "bhi.b 1b \r\n" \ diff --git a/firmware/target/coldfire/pcf50606-coldfire.c b/firmware/target/coldfire/pcf50606-coldfire.c index 3c1f402..d57b249 100644 --- a/firmware/target/coldfire/pcf50606-coldfire.c +++ b/firmware/target/coldfire/pcf50606-coldfire.c @@ -81,7 +81,7 @@ static int i2c_delay IDATA_ATTR = 44; void pcf50606_i2c_recalc_delay(int cpu_clock) { - i2c_delay = MAX(cpu_clock / (400000*2*3) - 5, 1); + i2c_delay = MAX(cpu_clock / (400000*2*3) - 7, 1); } inline void pcf50606_i2c_start(void) diff --git a/firmware/target/coldfire/system-target.h b/firmware/target/coldfire/system-target.h index 706ecf6..8e3a2a3 100644 --- a/firmware/target/coldfire/system-target.h +++ b/firmware/target/coldfire/system-target.h @@ -155,7 +155,7 @@ static inline void invalidate_icache(void) { asm volatile ("move.l #0x01000000,%d0\n" "movec.l %d0,%cacr\n" - "move.l #0x80000100,%d0\n" + "move.l #0x80000000,%d0\n" "movec.l %d0,%cacr"); } -- cgit v1.1