diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-10-15 21:16:50 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-10-15 21:16:50 +0000 |
commit | b85b6be3aa05510a1aca173a6f5a762c4448fdae (patch) | |
tree | 7d6b3571c1f0572c4ae6e99fce885493b5664e37 /firmware | |
parent | c08c081211d1eba8115569af9eaeae60e7cf4a9b (diff) | |
download | rockbox-b85b6be3aa05510a1aca173a6f5a762c4448fdae.tar.gz rockbox-b85b6be3aa05510a1aca173a6f5a762c4448fdae.zip |
Coldfire targets: enable buffered writes by default. Speeds up all sorts of I/O that writes to ports: LCD update (except the functions using DMA on H300), ATA writes, .... Some timings had to be adjusted for the new configuration.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15129 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/coldfire/crt0.S | 4 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/m5/lcd-as-m5.S | 6 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/system-iaudio.c | 2 | ||||
-rw-r--r-- | firmware/target/coldfire/iriver/h100/adc-h100.c | 4 | ||||
-rw-r--r-- | firmware/target/coldfire/iriver/h100/lcd-as-h100.S | 12 | ||||
-rw-r--r-- | firmware/target/coldfire/pcf50606-coldfire.c | 2 | ||||
-rw-r--r-- | firmware/target/coldfire/system-target.h | 2 |
7 files changed, 16 insertions, 16 deletions
diff --git a/firmware/target/coldfire/crt0.S b/firmware/target/coldfire/crt0.S index 215ccfe432..1393bc8bbd 100644 --- a/firmware/target/coldfire/crt0.S +++ b/firmware/target/coldfire/crt0.S | |||
@@ -218,8 +218,8 @@ start: | |||
218 | move.l #0x01000000,%d0 | 218 | move.l #0x01000000,%d0 |
219 | movec.l %d0,%cacr | 219 | movec.l %d0,%cacr |
220 | 220 | ||
221 | /* Enable cache, default=non-cacheable,no buffered writes */ | 221 | /* Enable cache, default=non-cacheable, buffered writes */ |
222 | move.l #0x80000000,%d0 | 222 | move.l #0x80000100,%d0 |
223 | movec.l %d0,%cacr | 223 | movec.l %d0,%cacr |
224 | 224 | ||
225 | /* Cache enabled in SDRAM only, buffered writes enabled */ | 225 | /* Cache enabled in SDRAM only, buffered writes enabled */ |
diff --git a/firmware/target/coldfire/iaudio/m5/lcd-as-m5.S b/firmware/target/coldfire/iaudio/m5/lcd-as-m5.S index c973dc2c40..4a88dc92b0 100644 --- a/firmware/target/coldfire/iaudio/m5/lcd-as-m5.S +++ b/firmware/target/coldfire/iaudio/m5/lcd-as-m5.S | |||
@@ -70,13 +70,13 @@ lcd_write_data: | |||
70 | 70 | ||
71 | lea 0xf0008002, %a1 | 71 | lea 0xf0008002, %a1 |
72 | .loop: | 72 | .loop: |
73 | /* When running in IRAM, this loop takes 7 cycles plus the LCD write. | 73 | /* When running in IRAM, this loop takes 10 cycles plus the LCD write. |
74 | The 7 cycles are necessary to follow the LCD timing specs | 74 | The 10 cycles are necessary to follow the LCD timing specs |
75 | at 140MHz */ | 75 | at 140MHz */ |
76 | nop /* 3(0/0) */ | ||
76 | move.b (%a0)+, %d1 /* 3(1/0) */ | 77 | move.b (%a0)+, %d1 /* 3(1/0) */ |
77 | move.w %d1, (%a1) /* 1(0/1) */ | 78 | move.w %d1, (%a1) /* 1(0/1) */ |
78 | subq.l #1, %d0 /* 1(0/0) */ | 79 | subq.l #1, %d0 /* 1(0/0) */ |
79 | nop /* 1(0/0) */ | ||
80 | bne .loop /* 2(0/0) */ | 80 | bne .loop /* 2(0/0) */ |
81 | rts | 81 | rts |
82 | .wd_end: | 82 | .wd_end: |
diff --git a/firmware/target/coldfire/iaudio/system-iaudio.c b/firmware/target/coldfire/iaudio/system-iaudio.c index 4e32d360fa..c04d4ffc2d 100644 --- a/firmware/target/coldfire/iaudio/system-iaudio.c +++ b/firmware/target/coldfire/iaudio/system-iaudio.c | |||
@@ -71,7 +71,7 @@ void cf_set_cpu_frequency(long frequency) | |||
71 | RECALC_DELAYS(CPUFREQ_MAX); | 71 | RECALC_DELAYS(CPUFREQ_MAX); |
72 | PLLCR = 0x0102c049 | (PLLCR & 0x70C00000); | 72 | PLLCR = 0x0102c049 | (PLLCR & 0x70C00000); |
73 | CSCR0 = 0x00001180; /* Flash: 4 wait states */ | 73 | CSCR0 = 0x00001180; /* Flash: 4 wait states */ |
74 | CSCR1 = 0x00000980; /* LCD: 2 wait states */ | 74 | CSCR1 = 0x00001180; /* LCD: 4 wait states */ |
75 | while(!(PLLCR & 0x80000000)) {}; /* Wait until the PLL has locked. | 75 | while(!(PLLCR & 0x80000000)) {}; /* Wait until the PLL has locked. |
76 | This may take up to 10ms! */ | 76 | This may take up to 10ms! */ |
77 | timers_adjust_prescale(CPUFREQ_MAX_MULT, true); | 77 | timers_adjust_prescale(CPUFREQ_MAX_MULT, true); |
diff --git a/firmware/target/coldfire/iriver/h100/adc-h100.c b/firmware/target/coldfire/iriver/h100/adc-h100.c index b69204aa02..0c14d7b338 100644 --- a/firmware/target/coldfire/iriver/h100/adc-h100.c +++ b/firmware/target/coldfire/iriver/h100/adc-h100.c | |||
@@ -37,7 +37,7 @@ | |||
37 | ({ \ | 37 | ({ \ |
38 | int _x_; \ | 38 | int _x_; \ |
39 | asm volatile ( \ | 39 | asm volatile ( \ |
40 | "move.l #11, %[_x_] \r\n" \ | 40 | "move.l #13, %[_x_] \r\n" \ |
41 | "1: \r\n" \ | 41 | "1: \r\n" \ |
42 | "subq.l #1, %[_x_] \r\n" \ | 42 | "subq.l #1, %[_x_] \r\n" \ |
43 | "bhi.b 1b \r\n" \ | 43 | "bhi.b 1b \r\n" \ |
@@ -94,7 +94,7 @@ unsigned short adc_scan(int channel) | |||
94 | data <<= 1; | 94 | data <<= 1; |
95 | data |= DO?1:0; | 95 | data |= DO?1:0; |
96 | } | 96 | } |
97 | 97 | ||
98 | CS_HI; | 98 | CS_HI; |
99 | 99 | ||
100 | set_irq_level(level); | 100 | set_irq_level(level); |
diff --git a/firmware/target/coldfire/iriver/h100/lcd-as-h100.S b/firmware/target/coldfire/iriver/h100/lcd-as-h100.S index 1605b210c1..c7509871fc 100644 --- a/firmware/target/coldfire/iriver/h100/lcd-as-h100.S +++ b/firmware/target/coldfire/iriver/h100/lcd-as-h100.S | |||
@@ -29,8 +29,8 @@ | |||
29 | 29 | ||
30 | lcd_write_command: | 30 | lcd_write_command: |
31 | move.l (4,%sp),%d0 | 31 | move.l (4,%sp),%d0 |
32 | lea MBAR2,%a1 | 32 | lea MBAR2,%a1 |
33 | move.l #~8,%d1 | 33 | move.l #~8,%d1 |
34 | and.l %d1,(0xb4,%a1) | 34 | and.l %d1,(0xb4,%a1) |
35 | move.w %d0,0xf0000000 | 35 | move.w %d0,0xf0000000 |
36 | rts | 36 | rts |
@@ -77,19 +77,19 @@ lcd_write_command_ex: | |||
77 | lcd_write_data: | 77 | lcd_write_data: |
78 | move.l (4,%sp),%a0 /* Data pointer */ | 78 | move.l (4,%sp),%a0 /* Data pointer */ |
79 | move.l (8,%sp),%d0 /* Length */ | 79 | move.l (8,%sp),%d0 /* Length */ |
80 | lea MBAR2,%a1 | 80 | lea MBAR2,%a1 |
81 | moveq #8,%d1 | 81 | moveq #8,%d1 |
82 | or.l %d1,(0xb4,%a1) | 82 | or.l %d1,(0xb4,%a1) |
83 | 83 | ||
84 | lea 0xf0000000,%a1 | 84 | lea 0xf0000000,%a1 |
85 | .loop: | 85 | .loop: |
86 | /* When running in IRAM, this loop takes 7 cycles plus the LCD write. | 86 | /* When running in IRAM, this loop takes 10 cycles plus the LCD write. |
87 | The 7 cycles are necessary to follow the LCD timing specs | 87 | The 10 cycles are necessary to follow the LCD timing specs |
88 | at 140MHz */ | 88 | at 140MHz */ |
89 | nop /* 3(0/0) */ | ||
89 | move.b (%a0)+,%d1 /* 3(1/0) */ | 90 | move.b (%a0)+,%d1 /* 3(1/0) */ |
90 | move.w %d1,(%a1) /* 1(0/1) */ | 91 | move.w %d1,(%a1) /* 1(0/1) */ |
91 | subq.l #1,%d0 /* 1(0/0) */ | 92 | subq.l #1,%d0 /* 1(0/0) */ |
92 | nop /* 1(0/0) */ | ||
93 | bne .loop /* 2(0/0) */ | 93 | bne .loop /* 2(0/0) */ |
94 | rts | 94 | rts |
95 | .wd_end: | 95 | .wd_end: |
diff --git a/firmware/target/coldfire/pcf50606-coldfire.c b/firmware/target/coldfire/pcf50606-coldfire.c index d57b249f0d..3c1f402791 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; | |||
81 | 81 | ||
82 | void pcf50606_i2c_recalc_delay(int cpu_clock) | 82 | void pcf50606_i2c_recalc_delay(int cpu_clock) |
83 | { | 83 | { |
84 | i2c_delay = MAX(cpu_clock / (400000*2*3) - 7, 1); | 84 | i2c_delay = MAX(cpu_clock / (400000*2*3) - 5, 1); |
85 | } | 85 | } |
86 | 86 | ||
87 | inline void pcf50606_i2c_start(void) | 87 | inline void pcf50606_i2c_start(void) |
diff --git a/firmware/target/coldfire/system-target.h b/firmware/target/coldfire/system-target.h index 8e3a2a3d5a..706ecf6150 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) | |||
155 | { | 155 | { |
156 | asm volatile ("move.l #0x01000000,%d0\n" | 156 | asm volatile ("move.l #0x01000000,%d0\n" |
157 | "movec.l %d0,%cacr\n" | 157 | "movec.l %d0,%cacr\n" |
158 | "move.l #0x80000000,%d0\n" | 158 | "move.l #0x80000100,%d0\n" |
159 | "movec.l %d0,%cacr"); | 159 | "movec.l %d0,%cacr"); |
160 | } | 160 | } |
161 | 161 | ||